lab04b: init
This commit is contained in:
9
lab04/perhaps.hs
Normal file
9
lab04/perhaps.hs
Normal file
@@ -0,0 +1,9 @@
|
||||
data Perhaps a =
|
||||
PerhapsSo a
|
||||
| PerhapsNot
|
||||
deriving Show
|
||||
|
||||
instance Functor Perhaps where
|
||||
fmap f (PerhapsSo x) = PerhapsSo (f x)
|
||||
fmap f PerhapsNot = PerhapsNot
|
||||
|
||||
Reference in New Issue
Block a user