free-4.2: Monads for free

PortabilityMPTCs, fundeps
Stabilityprovisional
MaintainerEdward Kmett <ekmett@gmail.com>
Safe HaskellNone

Control.Comonad.Trans.Coiter

Description

The iterative comonad generated by a comonad

Synopsis

Documentation

newtype CoiterT w a Source

This is the (co?)iterative comonad generated by a comonad

Constructors

CoiterT 

Fields

runCoiterT :: w (a, CoiterT w a)
 

Instances

ComonadTrans CoiterT 
Comonad w => ComonadCofree Identity (CoiterT w) 
Functor w => Functor (CoiterT w) 
Typeable1 w => Typeable1 (CoiterT w) 
Foldable w => Foldable (CoiterT w) 
Traversable w => Traversable (CoiterT w) 
Comonad w => Comonad (CoiterT w) 
Eq (w (a, CoiterT w a)) => Eq (CoiterT w a) 
(Typeable1 w, Typeable a, Data (w (a, CoiterT w a)), Data a) => Data (CoiterT w a) 
Ord (w (a, CoiterT w a)) => Ord (CoiterT w a) 
Read (w (a, CoiterT w a)) => Read (CoiterT w a) 
Show (w (a, CoiterT w a)) => Show (CoiterT w a) 

class (Functor f, Comonad w) => ComonadCofree f w | w -> f whereSource

Allows you to peel a layer off a cofree comonad.

Methods

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

Remove a layer.

coiterT :: Comonad w => (w a -> a) -> w a -> CoiterT w aSource

Unfold a CoiterT comonad transformer from a cokleisli arrow and an initial comonadic seed.