category-extras-0.51.3: Various modules and constructs inspired by category theory

Portabilityportable
Stabilityexperimental
MaintainerEdward Kmett <ekmett@gmail.com>

Control.Monad.Free

Description

See http://wwwtcs.inf.tu-dresden.de/%7Evoigt/mpc08.pdf for the background on rep, abs and improve and their use. NB: the C type in that paper is just the right Kan extension of a monad along itself, also known as the monad generated by a functor: http://www.tac.mta.ca/tac/volumes/10/19/10-19.ps

Documentation

type Free f = Fix (PFree f)Source

runFree :: Free f a -> Either a (f (Free f a))Source

cataFree :: Functor f => (c -> a) -> (f a -> a) -> Free f c -> aSource

free :: Either a (f (Free f a)) -> Free f aSource

class (Functor f, Monad m) => MonadFree f m | m -> f whereSource

Methods

inFree :: f (m a) -> m aSource

Instances

Functor f => MonadFree f (Free f) 
MonadFree f m => MonadFree f (ReaderT e m) 
MonadFree f m => MonadFree f (Ran m m)