File tree 2 files changed +13
-0
lines changed
2 files changed +13
-0
lines changed Original file line number Diff line number Diff line change @@ -21,6 +21,14 @@ instance monadTransFreeT :: (Functor f) => MonadTrans (FreeT f)
21
21
instance monadRecFreeT :: (Functor f, Monad m) => MonadRec (FreeT f m)
22
22
```
23
23
24
+ #### ` freeT `
25
+
26
+ ``` purescript
27
+ freeT :: forall f m a. (Unit -> m (Either a (f (FreeT f m a)))) -> FreeT f m a
28
+ ```
29
+
30
+ Construct a computation of type ` FreeT ` .
31
+
24
32
#### ` resume `
25
33
26
34
``` purescript
Original file line number Diff line number Diff line change 2
2
3
3
module Control.Monad.Free.Trans
4
4
( FreeT ()
5
+ , freeT
5
6
, liftFreeT
6
7
, hoistFreeT
7
8
, interpret
@@ -33,6 +34,10 @@ bound m f = Bind (mkExists (Bound m f))
33
34
-- | The free monad transformer for the functor `f`.
34
35
data FreeT f m a = FreeT (Unit -> m (Either a (f (FreeT f m a )))) | Bind (Exists (Bound f m a ))
35
36
37
+ -- | Construct a computation of type `FreeT`.
38
+ freeT :: forall f m a . (Unit -> m (Either a (f (FreeT f m a )))) -> FreeT f m a
39
+ freeT = FreeT
40
+
36
41
-- | Unpack `FreeT`, exposing the first step of the computation.
37
42
resume :: forall f m a . (Functor f , MonadRec m ) => FreeT f m a -> m (Either a (f (FreeT f m a )))
38
43
resume = tailRecM go
You can’t perform that action at this time.
0 commit comments