1 2 3 4 5 6 7 8 9 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