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

Portabilitynon-portable
Stabilityexperimental
Maintainersjoerd@w3future.com
Safe HaskellSafe-Infered

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 bSource

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
 

Instances

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

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

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

liftFree :: f a -> HFree c f aSource

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

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