X-Git-Url: http://git.megacz.com/?p=ghc-hetmet.git;a=blobdiff_plain;f=distrib%2Fcompare%2FUtils.hs;fp=distrib%2Fcompare%2FUtils.hs;h=d5fb8cb44209aecfad3e96d23e055f1b4aacfb95;hp=58298c12ddfadfd0ce8e12a3763226ba958f550f;hb=42b40db07ce70b89f867247809c4e930fd82a6f6;hpb=3ce328c715c8ae97325d21216a4dd51050876c62 diff --git a/distrib/compare/Utils.hs b/distrib/compare/Utils.hs index 58298c1..d5fb8cb 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] +