Skip to content

Commit fc69fbc

Browse files
committed
chapter 16: functor for Possibly (like maybe)
1 parent fb90a10 commit fc69fbc

File tree

2 files changed

+8
-0
lines changed

2 files changed

+8
-0
lines changed

Diff for: chapter16/Possibly.hs

+8
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,8 @@
1+
data Possibly a =
2+
LolNope
3+
| Yeppers a
4+
deriving (Eq, Show)
5+
6+
instance Functor Possibly where
7+
fmap _ LolNope = LolNope
8+
fmap f (Yeppers a) = Yeppers (f a)

Diff for: chapter16/instances_of_functor/identity_functor.hs

Whitespace-only changes.

0 commit comments

Comments
 (0)