summaryrefslogtreecommitdiff
path: root/progs/lib/hbc/Maybe.hs
diff options
context:
space:
mode:
Diffstat (limited to 'progs/lib/hbc/Maybe.hs')
-rw-r--r--progs/lib/hbc/Maybe.hs6
1 files changed, 6 insertions, 0 deletions
diff --git a/progs/lib/hbc/Maybe.hs b/progs/lib/hbc/Maybe.hs
new file mode 100644
index 0000000..f0ada70
--- /dev/null
+++ b/progs/lib/hbc/Maybe.hs
@@ -0,0 +1,6 @@
+module Maybe(Maybe(..), thenM) where
+-- Maybe together with Just and thenM forms a monad, but is more
+-- by accident than by design.
+data Maybe a = Nothing | Just a deriving (Eq, Ord, Text, Binary)
+Nothing `thenM` _ = Nothing
+Just a `thenM` f = f a