diff options
author | Mart Lubbers | 2015-04-24 09:10:46 +0200 |
---|---|---|
committer | Mart Lubbers | 2015-04-24 09:10:46 +0200 |
commit | aebffcc1c786e8cea15fff6f324bf71fc37cbb37 (patch) | |
tree | 0879f685fc1a35361727a203b437c67bb486e981 /files/practicum/StdMaybeMonad.icl | |
parent | started with week2 (diff) |
updated practicum files
Diffstat (limited to 'files/practicum/StdMaybeMonad.icl')
-rw-r--r-- | files/practicum/StdMaybeMonad.icl | 10 |
1 files changed, 10 insertions, 0 deletions
diff --git a/files/practicum/StdMaybeMonad.icl b/files/practicum/StdMaybeMonad.icl new file mode 100644 index 0000000..1c6277d --- /dev/null +++ b/files/practicum/StdMaybeMonad.icl @@ -0,0 +1,10 @@ +implementation module StdMaybeMonad
+
+import StdMonad
+
+:: Maybe a = Nothing | Just a
+
+instance return Maybe where return x = Just x
+instance >>= Maybe where >>= (Just x) f = f x
+ >>= Nothing f = Nothing
+instance fail Maybe where fail = Nothing
|