free-functors-0.6.4: Provides free functors that are adjoint to functors that forget class constraints.

LicenseBSD-style (see the file LICENSE)
Maintainersjoerd@w3future.com
Stabilityexperimental
Portabilitynon-portable
Safe HaskellSafe
LanguageHaskell2010

Data.Functor.HCofree

Description

A cofree functor is right adjoint to a forgetful functor. In this package the forgetful functor forgets class constraints.

Compared to Data.Functor.Cofree we're going up a level. These free functors go between categories of functors and the natural transformations between them.

Synopsis

Documentation

type (:~>) f g = forall b. f b -> g b Source

Natural transformations.

data HCofree c g a where Source

The higher order cofree functor for constraint c.

Constructors

HCofree :: (c f, Functor f) => (f :~> g) -> f a -> HCofree c g a 

leftAdjunct :: (c f, Functor f) => (f :~> g) -> f :~> HCofree c g Source

unit :: (c g, Functor g) => g :~> HCofree c g Source

unit = leftAdjunct id

rightAdjunct :: (f :~> HCofree c g) -> f :~> g Source

rightAdjunct f = counit . f

hfmap :: (f :~> g) -> HCofree c f :~> HCofree c g Source

liftCofree :: (c f, Functor f) => f a -> HCofree c f a Source

lowerCofree :: HCofree c f a -> f a Source

convert :: (c (t f), Functor (t f), Comonad f, ComonadTrans t) => t f a -> HCofree c f a Source

coiter :: c Identity => (forall b. b -> f b) -> a -> HCofree c f a Source