failMaB,
failMaybe,
seqMaybe,
- mapMaybe,
returnMaB,
returnMaybe,
- thenMaB,
- thenMaybe
+ thenMaB
#if ! defined(COMPILING_GHC)
, findJust
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