File tree 1 file changed +8
-0
lines changed
1 file changed +8
-0
lines changed Original file line number Diff line number Diff line change @@ -16,7 +16,9 @@ import Prelude
16
16
import Data.Bifunctor (bimap )
17
17
import Data.Either (Either (..))
18
18
import Data.Exists (Exists , mkExists , runExists )
19
+ import Data.Monoid (class Monoid , mempty )
19
20
21
+ import Control.Apply (lift2 )
20
22
import Control.Monad.Rec.Class (class MonadRec , Step (..), tailRecM )
21
23
import Control.Monad.Trans.Class (class MonadTrans )
22
24
@@ -76,6 +78,12 @@ instance monadRecFreeT :: (Functor f, Monad m) => MonadRec (FreeT f m) where
76
78
Loop s1 -> go s1
77
79
Done a -> pure a
78
80
81
+ instance semigroupFreeT :: (Functor f , Monad m , Semigroup w ) => Semigroup (FreeT f m w ) where
82
+ append = lift2 append
83
+
84
+ instance monoidFreeT :: (Functor f , Monad m , Monoid w ) => Monoid (FreeT f m w ) where
85
+ mempty = pure mempty
86
+
79
87
-- | Lift an action from the functor `f` to a `FreeT` action.
80
88
liftFreeT :: forall f m a . (Functor f , Monad m ) => f a -> FreeT f m a
81
89
liftFreeT fa = FreeT \_ -> pure (Right (map pure fa))
You can’t perform that action at this time.
0 commit comments