Skip to content

Commit c7c4866

Browse files
authored
Merge pull request #15 from natefaubion/eq1-ord1
Add Eq1, Ord1
2 parents 8b4686d + 9e05d0f commit c7c4866

File tree

1 file changed

+8
-0
lines changed

1 file changed

+8
-0
lines changed

src/Data/Identity.purs

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -7,10 +7,12 @@ import Control.Comonad (class Comonad)
77
import Control.Extend (class Extend)
88
import Control.Lazy (class Lazy)
99

10+
import Data.Eq (class Eq1)
1011
import Data.Foldable (class Foldable)
1112
import Data.Functor.Invariant (class Invariant, imapF)
1213
import Data.Monoid (class Monoid)
1314
import Data.Newtype (class Newtype)
15+
import Data.Ord (class Ord1)
1416
import Data.Traversable (class Traversable)
1517

1618
newtype Identity a = Identity a
@@ -46,6 +48,12 @@ derive newtype instance lazyIdentity :: Lazy a => Lazy (Identity a)
4648
instance showIdentity :: Show a => Show (Identity a) where
4749
show (Identity x) = "(Identity " <> show x <> ")"
4850

51+
instance eq1Identity :: Eq1 Identity where
52+
eq1 = eq
53+
54+
instance ord1Identity :: Ord1 Identity where
55+
compare1 = compare
56+
4957
instance functorIdentity :: Functor Identity where
5058
map f (Identity x) = Identity (f x)
5159

0 commit comments

Comments
 (0)