Skip to content

Commit 891f3c7

Browse files
committed
Add applicative instance
1 parent 09a8f0e commit 891f3c7

File tree

1 file changed

+4
-0
lines changed

1 file changed

+4
-0
lines changed

src/Control/Monad/Free.purs.hs

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,10 @@ instance functorFree :: (Functor f) => Functor (Free f) where
1212
(<$>) f = go where
1313
go (Pure a) = Pure (f a)
1414
go (Free fa) = Free (go <$> fa)
15+
16+
instance applicativeFree :: (Functor f) => Applicative (Free f) where
17+
pure = return
18+
(<*>) = ap
1519

1620
instance monadFree :: (Functor f) => Monad (Free f) where
1721
return = Pure

0 commit comments

Comments
 (0)