X-Git-Url: http://git.megacz.com/?p=ghc-hetmet.git;a=blobdiff_plain;f=compiler%2Futils%2FUtil.lhs;fp=compiler%2Futils%2FUtil.lhs;h=3de52b6737860f2d0756a3bc7b35182802bf8def;hp=62ab5f9fa59c8e3d0c1db59ec47d0da339ae3737;hb=46bef1c09f499c5b34a00b650614bebfa1d6ba4b;hpb=3e39f8485ee4bd1ef6e3e7153ea88e45bfa9218e diff --git a/compiler/utils/Util.lhs b/compiler/utils/Util.lhs index 62ab5f9..3de52b6 100644 --- a/compiler/utils/Util.lhs +++ b/compiler/utils/Util.lhs @@ -42,7 +42,7 @@ module Util ( -- * Comparisons isEqual, eqListBy, - thenCmp, cmpList, maybePrefixMatch, + thenCmp, cmpList, removeSpaces, -- * Transitive closures @@ -664,15 +664,6 @@ cmpList cmp (a:as) (b:bs) \end{code} \begin{code} --- This (with a more general type) is Data.List.stripPrefix from GHC 6.8. --- This definition can be removed once we require at least 6.8 to build. -maybePrefixMatch :: String -> String -> Maybe String -maybePrefixMatch [] rest = Just rest -maybePrefixMatch (_:_) [] = Nothing -maybePrefixMatch (p:pat) (r:rest) - | p == r = maybePrefixMatch pat rest - | otherwise = Nothing - removeSpaces :: String -> String removeSpaces = reverse . dropWhile isSpace . reverse . dropWhile isSpace \end{code}