10 lines
175 B
Haskell
10 lines
175 B
Haskell
data Perhaps a =
|
|
PerhapsSo a
|
|
| PerhapsNot
|
|
deriving Show
|
|
|
|
instance Functor Perhaps where
|
|
fmap f (PerhapsSo x) = PerhapsSo (f x)
|
|
fmap f PerhapsNot = PerhapsNot
|
|
|