summaryrefslogtreecommitdiff
path: root/monad/h21.hs
diff options
context:
space:
mode:
Diffstat (limited to 'monad/h21.hs')
-rw-r--r--monad/h21.hs3
1 files changed, 3 insertions, 0 deletions
diff --git a/monad/h21.hs b/monad/h21.hs
new file mode 100644
index 0000000..c843dcb
--- /dev/null
+++ b/monad/h21.hs
@@ -0,0 +1,3 @@
+(>>=) m f = join $ fmap f m
+join x = x >>= id
+fmap f x = x >>= (return . f)