MaybeErr(..),
allMaybes,
- catMaybes,
firstJust,
expectJust,
maybeToBool,
returnMaybe,
thenMaB
-#if ! defined(COMPILING_GHC)
+#if defined(COMPILING_GHC)
+ , catMaybes
+#else
, findJust
, foldlMaybeErrs
, listMaybeErrs
import Unique (Unique) -- only for specialising
+#else
+import Maybe -- renamer will tell us if there are any conflicts
#endif
\end{code}
are any @Nothings@.
\begin{code}
+#ifdef COMPILING_GHC
catMaybes :: [Maybe a] -> [a]
catMaybes [] = []
catMaybes (Nothing : xs) = catMaybes xs
catMaybes (Just x : xs) = (x : catMaybes xs)
+#endif
allMaybes :: [Maybe a] -> Maybe [a]
allMaybes [] = Just []