You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
12 lines
244 B
12 lines
244 B
7 years ago
|
module Identity where
|
||
|
|
||
|
newtype Identity a = Identity a deriving (Show, Eq, Ord)
|
||
|
|
||
|
instance Functor Identity where
|
||
|
fmap f (Identity a) = Identity (f a)
|
||
|
|
||
|
instance Applicative Identity where
|
||
|
pure = Identity
|
||
|
(<*>) (Identity f) = fmap f
|
||
|
|