File tree Expand file tree Collapse file tree 1 file changed +7
-0
lines changed Expand file tree Collapse file tree 1 file changed +7
-0
lines changed Original file line number Diff line number Diff line change @@ -14,6 +14,7 @@ module Control.Monad.Free
14
14
15
15
import Prelude
16
16
17
+ import Control.Apply (lift2 )
17
18
import Control.Monad.Rec.Class (class MonadRec , Step (..), tailRecM )
18
19
import Control.Monad.Trans.Class (class MonadTrans )
19
20
@@ -111,6 +112,12 @@ instance traversableFree :: Traversable f => Traversable (Free f) where
111
112
Right a -> pure <$> f a
112
113
sequence tma = traverse identity tma
113
114
115
+ instance semigroupFree :: Semigroup a => Semigroup (Free f a ) where
116
+ append = lift2 append
117
+
118
+ instance monoidFree :: Monoid a => Monoid (Free f a ) where
119
+ mempty = pure mempty
120
+
114
121
-- | Lift an impure value described by the generating type constructor `f` into
115
122
-- | the free monad.
116
123
liftF :: forall f . f ~> Free f
You can’t perform that action at this time.
0 commit comments