summaryrefslogtreecommitdiff
path: root/distrib/compare/Utils.hs
diff options
context:
space:
mode:
Diffstat (limited to 'distrib/compare/Utils.hs')
-rw-r--r--distrib/compare/Utils.hs7
1 files changed, 7 insertions, 0 deletions
diff --git a/distrib/compare/Utils.hs b/distrib/compare/Utils.hs
index 58298c12dd..d5fb8cb442 100644
--- a/distrib/compare/Utils.hs
+++ b/distrib/compare/Utils.hs
@@ -26,3 +26,10 @@ re r str = case matchM r' str :: Maybe (String, String, String, [String]) of
Nothing -> Nothing
where r' = makeRegex r :: Regex
+unSepList :: Eq a => a -> [a] -> [[a]]
+unSepList x xs = case break (x ==) xs of
+ (this, _ : xs') ->
+ this : unSepList x xs'
+ (this, []) ->
+ [this]
+