Files
cs-252/lab04/perhaps.hs
2026-02-11 11:27:00 -08:00

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