Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 8 additions & 0 deletions src/Data/Identity.purs
Original file line number Diff line number Diff line change
Expand Up @@ -7,10 +7,12 @@ import Control.Comonad (class Comonad)
import Control.Extend (class Extend)
import Control.Lazy (class Lazy)

import Data.Eq (class Eq1)
import Data.Foldable (class Foldable)
import Data.Functor.Invariant (class Invariant, imapF)
import Data.Monoid (class Monoid)
import Data.Newtype (class Newtype)
import Data.Ord (class Ord1)
import Data.Traversable (class Traversable)

newtype Identity a = Identity a
Expand Down Expand Up @@ -46,6 +48,12 @@ derive newtype instance lazyIdentity :: Lazy a => Lazy (Identity a)
instance showIdentity :: Show a => Show (Identity a) where
show (Identity x) = "(Identity " <> show x <> ")"

instance eq1Identity :: Eq1 Identity where
eq1 = eq

instance ord1Identity :: Ord1 Identity where
compare1 = compare

instance functorIdentity :: Functor Identity where
map f (Identity x) = Identity (f x)

Expand Down