[project @ 2003-01-29 07:54:46 by panne]
[ghc-base.git] / Data / Maybe.hs
index 32101b7..195daab 100644 (file)
@@ -35,6 +35,22 @@ import {-# SOURCE #-} GHC.Err ( error )
 import GHC.Base
 #endif
 
+#ifdef __NHC__
+import Prelude
+import Prelude (Maybe(..), maybe)
+import Maybe
+    ( isJust
+    , isNothing
+    , fromJust
+    , fromMaybe
+    , listToMaybe
+    , maybeToList 
+    , catMaybes
+    , mapMaybe
+    )
+#else
+
+#ifndef __HUGS__
 -- ---------------------------------------------------------------------------
 -- The Maybe type, and instances
 
@@ -71,6 +87,7 @@ instance  Monad Maybe  where
 maybe :: b -> (a -> b) -> Maybe a -> b
 maybe n _ Nothing  = n
 maybe _ f (Just x) = f x
+#endif  /* __HUGS__ */
 
 isJust         :: Maybe a -> Bool
 isJust Nothing = False
@@ -106,3 +123,4 @@ mapMaybe f (x:xs) =
   Nothing -> rs
   Just r  -> r:rs
 
+#endif /* else not __NHC__ */