Module

# Control.Monad.Free

- Package
- purescript-free
- Repository
- purescript/purescript-free

### #FreeSource

`data Free f a`

The free monad for a type constructor `f`

.

Implemented in the spirit of Relection without Remorse, the free monad is represented using a sequential data structure in order to overcome the quadratic complexity of left-associated binds and traversal through the free monad structure.

#### Instances

### #suspendFSource

`suspendF :: forall f. Applicative f => (Free f) ~> (Free f)`

Suspend a value given the applicative functor `f`

into the free monad.

### #injFSource

`injF :: forall f g. Inject f g => (Free f) ~> (Free g)`

Embed computations in one `Free`

monad as computations in the `Free`

monad
for a coproduct type constructor.

This construction allows us to write computations which are polymorphic in
the particular `Free`

monad we use, allowing us to extend the functionality
of our monad later.