Add a type signature
[ghc-hetmet.git] / compiler / utils / Util.lhs
index 39fd64b..0a77e4d 100644 (file)
@@ -39,7 +39,7 @@ module Util (
 
        -- comparisons
        isEqual, eqListBy, 
-       thenCmp, cmpList, prefixMatch, suffixMatch, maybePrefixMatch,
+       thenCmp, cmpList, maybePrefixMatch,
        removeSpaces,
 
        -- strictness
@@ -688,12 +688,6 @@ cmpList cmp (a:as) (b:bs)
 \end{code}
 
 \begin{code}
-prefixMatch :: Eq a => [a] -> [a] -> Bool
-prefixMatch [] _str = True
-prefixMatch _pat [] = False
-prefixMatch (p:ps) (s:ss) | p == s    = prefixMatch ps ss
-                         | otherwise = False
-
 maybePrefixMatch :: String -> String -> Maybe String
 maybePrefixMatch []    rest = Just rest
 maybePrefixMatch (_:_) []   = Nothing
@@ -701,9 +695,6 @@ maybePrefixMatch (p:pat) (r:rest)
   | p == r    = maybePrefixMatch pat rest
   | otherwise = Nothing
 
-suffixMatch :: Eq a => [a] -> [a] -> Bool
-suffixMatch pat str = prefixMatch (reverse pat) (reverse str)
-
 removeSpaces :: String -> String
 removeSpaces = reverse . dropWhile isSpace . reverse . dropWhile isSpace
 \end{code}
@@ -714,31 +705,6 @@ removeSpaces = reverse . dropWhile isSpace . reverse . dropWhile isSpace
 %*                                                                     *
 %************************************************************************
 
-The following are curried versions of @fst@ and @snd@.
-
-\begin{code}
-#if NOT_USED
-cfst :: a -> b -> a    -- stranal-sem only (Note)
-cfst x y = x
-#endif
-\end{code}
-
-The following provide us higher order functions that, when applied
-to a function, operate on pairs.
-
-\begin{code}
-#if NOT_USED
-applyToPair :: ((a -> c),(b -> d)) -> (a,b) -> (c,d)
-applyToPair (f,g) (x,y) = (f x, g y)
-
-applyToFst :: (a -> c) -> (a,b)-> (c,b)
-applyToFst f (x,y) = (f x,y)
-
-applyToSnd :: (b -> d) -> (a,b) -> (a,d)
-applyToSnd f (x,y) = (x,f y)
-#endif
-\end{code}
-
 \begin{code}
 unzipWith :: (a -> b -> c) -> [(a, b)] -> [c]
 unzipWith f pairs = map ( \ (a, b) -> f a b ) pairs
@@ -767,6 +733,7 @@ consIORef var x = do
 Module names:
 
 \begin{code}
+looksLikeModuleName :: String -> Bool
 looksLikeModuleName [] = False
 looksLikeModuleName (c:cs) = isUpper c && go cs
   where go [] = True