summaryrefslogtreecommitdiff
path: root/Haskell-book/16/Possibly.hs
blob: bf925402a8775b5cd42af5d7c25b762cf0d4135d (plain)
1
2
3
4
5
6
7
8
9
10
module Possibly where

data Possibly a =
    LolNope
  | Yeppers a
  deriving (Eq, Show)

instance Functor Possibly where
    fmap f LolNope = LolNope
    fmap f (Yeppers x) = Yeppers $ f x