| |||||||||||||||||||
| |||||||||||||||||||
| |||||||||||||||||||
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 | |||||||||||||||||||
Synopsis | |||||||||||||||||||
| |||||||||||||||||||
Documentation | |||||||||||||||||||
module Control.Monad.Parameterized | |||||||||||||||||||
type PFree = PAp Either | |||||||||||||||||||
type Free f = Fix (PFree f) | |||||||||||||||||||
inFree :: f (Free f a) -> Free f a | |||||||||||||||||||
runFree :: Free f a -> Either a (f (Free f a)) | |||||||||||||||||||
cataFree :: Functor f => (c -> a) -> (f a -> a) -> Free f c -> a | |||||||||||||||||||
free :: Either a (f (Free f a)) -> Free f a | |||||||||||||||||||
Improving asymptotic performance with right Kan extensions | |||||||||||||||||||
class (Functor f, Monad m) => FreeLike f m where | |||||||||||||||||||
| |||||||||||||||||||
improve :: Functor f => (forall m. FreeLike f m => m a) -> Free f a | |||||||||||||||||||
Produced by Haddock version 2.1.0 |