free-functors-0.6.3.3: 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-Inferred
LanguageHaskell2010

Data.Functor.HFree

Description

A free functor is left adjoint to a forgetful functor. In this package the forgetful functor forgets class constraints.

Compared to Data.Functor.Free 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.

newtype HFree c f a Source

The higher order free functor for constraint c.

Constructors

HFree 

Fields

runHFree :: forall g. (c g, Functor g) => (f :~> g) -> g a
 

unit :: f :~> HFree c f Source

rightAdjunct :: (c g, Functor g) => (f :~> g) -> HFree c f :~> g Source

counit :: (c f, Functor f) => HFree c f :~> f Source

counit = rightAdjunct id

leftAdjunct :: (HFree c f :~> g) -> f :~> g Source

leftAdjunct f = f . unit

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

liftFree :: f a -> HFree c f a Source

lowerFree :: (c f, Functor f) => HFree c f a -> f a Source

convert :: (c (t f), Functor (t f), Monad f, MonadTrans t) => HFree c f a -> t f a Source

iter :: c Identity => (forall b. f b -> b) -> HFree c f a -> a Source

wrap :: f (HFree Monad f a) -> HFree Monad f a Source