Skip to content

Commit 454fc4d

Browse files
paluhgaryb
authored andcommitted
Add Alt instance (#8)
1 parent a692e85 commit 454fc4d

File tree

1 file changed

+4
-0
lines changed

1 file changed

+4
-0
lines changed

src/Data/Identity.purs

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,6 @@
11
module Data.Identity where
22

3+
import Control.Alt (class Alt)
34
import Control.Applicative (class Applicative)
45
import Control.Apply (class Apply)
56
import Control.Bind (class Bind)
@@ -83,6 +84,9 @@ instance functorIdentity :: Functor Identity where
8384
instance invariantIdentity :: Invariant Identity where
8485
imap = imapF
8586

87+
instance altIdentity :: Alt Identity where
88+
alt x _ = x
89+
8690
instance applyIdentity :: Apply Identity where
8791
apply (Identity f) (Identity x) = Identity (f x)
8892

0 commit comments

Comments
 (0)