[project @ 1996-07-19 18:36:04 by partain]
[ghc-hetmet.git] / ghc / compiler / utils / Maybes.lhs
index 1c6a863..5ed4ac3 100644 (file)
@@ -24,11 +24,9 @@ module Maybes (
        failMaB,
        failMaybe,
        seqMaybe,
-       mapMaybe,
        returnMaB,
        returnMaybe,
-       thenMaB,
-       thenMaybe
+       thenMaB
 
 #if ! defined(COMPILING_GHC)
        , findJust
@@ -41,6 +39,8 @@ module Maybes (
 
 CHK_Ubiq() -- debugging consistency check
 
+import Unique (Unique) -- only for specialising
+
 #endif
 \end{code}
 
@@ -113,12 +113,6 @@ returnMaybe = Just
 
 failMaybe :: Maybe a
 failMaybe = Nothing
-
-mapMaybe :: (a -> Maybe b) -> [a] -> Maybe [b]
-mapMaybe f []    = returnMaybe []
-mapMaybe f (x:xs) = f x                        `thenMaybe` \ x' ->
-                   mapMaybe f xs       `thenMaybe` \ xs' ->
-                   returnMaybe (x':xs')
 \end{code}
 
 Lookup functions
@@ -137,14 +131,11 @@ assocMaybe alist key
     lookup ((tv,ty):rest) = if key == tv then Just ty else lookup rest
 
 #if defined(COMPILING_GHC)
-{-? SPECIALIZE assocMaybe
-       :: [(String,        b)] -> String        -> Maybe b,
-          [(Id,            b)] -> Id            -> Maybe b,
-          [(Class,         b)] -> Class         -> Maybe b,
-          [(Int,           b)] -> Int           -> Maybe b,
-          [(Name,          b)] -> Name          -> Maybe b,
-          [(TyVar,         b)] -> TyVar         -> Maybe b,
-          [(TyVarTemplate, b)] -> TyVarTemplate -> Maybe b
+{-# SPECIALIZE assocMaybe
+       :: [(FAST_STRING,   b)] -> FAST_STRING -> Maybe b
+        , [(Int,           b)] -> Int         -> Maybe b
+        , [(Unique,        b)] -> Unique      -> Maybe b
+        , [(RdrName,       b)] -> RdrName     -> Maybe b
   #-}
 #endif
 \end{code}