category-extras-0.50.3: Various modules and constructs inspired by category theoryContentsIndex
Control.Monad.Free
Portabilityportable
Stabilityexperimental
MaintainerEdward Kmett <ekmett@gmail.com>
Contents
Improving asymptotic performance with right Kan extensions
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
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
class (Functor f, Monad m) => FreeLike f m where
wrap :: f (m a) -> m a
improve :: Functor f => (forall m. FreeLike f m => m a) -> Free f a
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
Methods
wrap :: f (m a) -> m a
show/hide Instances
Functor f => FreeLike f (Free f)
FreeLike f m => FreeLike f (Ran m m)
improve :: Functor f => (forall m. FreeLike f m => m a) -> Free f a
Produced by Haddock version 2.1.0