projects
/
ghc-hetmet.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
[project @ 2000-10-24 08:40:09 by simonpj]
[ghc-hetmet.git]
/
ghc
/
compiler
/
utils
/
Maybes.lhs
diff --git
a/ghc/compiler/utils/Maybes.lhs
b/ghc/compiler/utils/Maybes.lhs
index
abaf1c1
..
3f94d34
100644
(file)
--- a/
ghc/compiler/utils/Maybes.lhs
+++ b/
ghc/compiler/utils/Maybes.lhs
@@
-15,13
+15,10
@@
module Maybes (
expectJust,
maybeToBool,
expectJust,
maybeToBool,
- failMaB,
- failMaybe,
- seqMaybe,
- returnMaB,
- returnMaybe,
- thenMaB,
- catMaybes
+ thenMaybe, seqMaybe, returnMaybe, failMaybe, catMaybes,
+
+ thenMaB, returnMaB, failMaB
+
) where
#include "HsVersions.h"
) where
#include "HsVersions.h"
@@
-104,6
+101,11
@@
seqMaybe :: Maybe a -> Maybe a -> Maybe a
seqMaybe (Just x) _ = Just x
seqMaybe Nothing my = my
seqMaybe (Just x) _ = Just x
seqMaybe Nothing my = my
+thenMaybe :: Maybe a -> (a -> Maybe b) -> Maybe b
+thenMaybe ma mb = case ma of
+ Just x -> mb x
+ Nothing -> Nothing
+
returnMaybe :: a -> Maybe a
returnMaybe = Just
returnMaybe :: a -> Maybe a
returnMaybe = Just