summaryrefslogtreecommitdiff
path: root/files/practicum/StdMaybeMonad.icl
blob: 1c6277d58f6a9379c63ba294cab5d0e58dfd26bc (plain) (blame)
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