1c6277d58f6a9379c63ba294cab5d0e58dfd26bc
[fp1415.git] / fp2 / week2 / mart / oldold / old / StdMaybeMonad.icl
1 implementation module StdMaybeMonad
2
3 import StdMonad
4
5 :: Maybe a = Nothing | Just a
6
7 instance return Maybe where return x = Just x
8 instance >>= Maybe where >>= (Just x) f = f x
9 >>= Nothing f = Nothing
10 instance fail Maybe where fail = Nothing