free-3.0: Monads for free

PortabilityMPTCs, fundeps
Stabilityprovisional
MaintainerEdward Kmett <ekmett@gmail.com>
Safe HaskellSafe-Infered

Control.Comonad.Cofree

Contents

Description

Cofree comonads

Synopsis

Documentation

data Cofree f a Source

Constructors

a :< (f (Cofree f a)) 

Instances

ComonadTrans Cofree 
ComonadEnv e w => ComonadEnv e (Cofree w) 
ComonadStore s w => ComonadStore s (Cofree w) 
ComonadTraced m w => ComonadTraced m (Cofree w) 
Functor f => ComonadCofree f (Cofree f) 
Functor f => Functor (Cofree f) 
Typeable1 f => Typeable1 (Cofree f) 
Applicative f => Applicative (Cofree f) 
Foldable f => Foldable (Cofree f) 
Traversable f => Traversable (Cofree f) 
Functor f => Comonad (Cofree f) 
ComonadApply f => ComonadApply (Cofree f) 
Distributive f => Distributive (Cofree f) 
Traversable1 f => Traversable1 (Cofree f) 
Foldable1 f => Foldable1 (Cofree f) 
Apply f => Apply (Cofree f) 
Functor f => Extend (Cofree f) 
(Eq (f (Cofree f a)), Eq a) => Eq (Cofree f a) 
(Typeable1 f, Data (f (Cofree f a)), Data a) => Data (Cofree f a) 
(Ord (f (Cofree f a)), Ord a) => Ord (Cofree f a) 
(Read (f (Cofree f a)), Read a) => Read (Cofree f a) 
(Show (f (Cofree f a)), Show a) => Show (Cofree f a) 
(Typeable1 f, Typeable a) => Typeable (Cofree f a) 

section :: Comonad f => f a -> Cofree f aSource

lower . section = id

unwrap :: ComonadCofree f w => w a -> f (w a)Source

coiter :: Functor f => (a -> f a) -> a -> Cofree f aSource

unfold :: Functor f => (b -> (a, f b)) -> b -> Cofree f aSource

Lenses into cofree comonads

extracting :: Functor f => (a -> f a) -> Cofree g a -> f (Cofree g a)Source

unwrapping :: Functor f => (g (Cofree g a) -> f (g (Cofree g a))) -> Cofree g a -> f (Cofree g a)Source

telescoping :: (Functor f, Functor g) => [(Cofree g a -> f (Cofree g a)) -> g (Cofree g a) -> f (g (Cofree g a))] -> (a -> f a) -> Cofree g a -> f (Cofree g a)Source