Skip to content

Commit 09237cc

Browse files
committed
fix pure implementation
1 parent 7318626 commit 09237cc

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed

src/Control/Comonad/Cofree.purs

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@ module Control.Comonad.Cofree
1010
import Prelude
1111

1212
import Control.Comonad (class Comonad)
13-
import Control.Alternative (class Alternative, (<|>))
13+
import Control.Alternative (class Alternative, (<|>), empty)
1414
import Control.Extend (class Extend)
1515
import Control.Monad.Trampoline (Trampoline, runTrampoline)
1616

@@ -81,8 +81,8 @@ instance applyCofree :: (Apply f) => Apply (Cofree f) where
8181
h = (head f) (head x)
8282
t = (<*>) <$> (tail f) <*> (tail x)
8383

84-
instance applicativeCofree :: (Applicative f) => Applicative (Cofree f) where
85-
pure a = mkCofree a (pure $ pure a)
84+
instance applicativeCofree :: (Alternative f) => Applicative (Cofree f) where
85+
pure a = mkCofree a empty
8686

8787
instance bindCofree :: (Alternative f) => Bind (Cofree f) where
8888
bind fa f = loop fa where

0 commit comments

Comments
 (0)