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

Portabilityrank-2 types
Stabilityexperimental
MaintainerEdward Kmett <ekmett@gmail.com>

Control.Comonad.Cofree

Description

Examples: type LV = Cofree Maybe type Stream = Cofree Identity

Documentation

type Cofree f = Fix (PCofree f)Source

runCofree :: Cofree f a -> (a, f (Cofree f a))Source

cofree :: a -> f (Cofree f a) -> Cofree f aSource

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

Methods

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

class ComonadCofree f w => RunComonadCofree f w | w -> f whereSource

Methods

anaCofree :: Functor f => (a -> c) -> (a -> f a) -> a -> w cSource