File tree Expand file tree Collapse file tree 1 file changed +5
-6
lines changed Expand file tree Collapse file tree 1 file changed +5
-6
lines changed Original file line number Diff line number Diff line change @@ -10,8 +10,7 @@ module Control.Comonad.Cofree
10
10
import Prelude
11
11
12
12
import Control.Comonad (class Comonad )
13
- import Control.Alt ((<|>))
14
- import Control.MonadPlus (class MonadPlus )
13
+ import Control.Alternative (class Alternative , (<|>), empty )
15
14
import Control.Extend (class Extend )
16
15
import Control.Monad.Trampoline (Trampoline , runTrampoline )
17
16
@@ -82,12 +81,12 @@ instance applyCofree :: (Apply f) => Apply (Cofree f) where
82
81
h = (head f) (head x)
83
82
t = (<*>) <$> (tail f) <*> (tail x)
84
83
85
- instance applicativeCofree :: (Applicative f ) => Applicative (Cofree f ) where
86
- pure a = mkCofree a (pure $ pure a)
84
+ instance applicativeCofree :: (Alternative f ) => Applicative (Cofree f ) where
85
+ pure a = mkCofree a empty
87
86
88
- instance bindCofree :: (MonadPlus f ) => Bind (Cofree f ) where
87
+ instance bindCofree :: (Alternative f ) => Bind (Cofree f ) where
89
88
bind fa f = loop fa where
90
89
loop fa = let fh = f (head fa)
91
90
in mkCofree (head fh) ((tail fh) <|> (loop <$> tail fa))
92
91
93
- instance monadCofree :: (MonadPlus f ) => Monad (Cofree f )
92
+ instance monadCofree :: (Alternative f ) => Monad (Cofree f )
You can’t perform that action at this time.
0 commit comments