lab04b: init

This commit is contained in:
2026-02-11 11:27:00 -08:00
parent 9a8d2abfdb
commit 2943b49182
6 changed files with 182 additions and 0 deletions

9
lab04/perhaps.hs Normal file
View 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