kan-extensions-4.0.1: Kan extensions, Kan lifts, various forms of the Yoneda lemma, and (co)density (co)monads

Portability rank N types experimental Edward Kmett Trustworthy

Data.Functor.Kan.Lift

Contents

Description

Left Kan lifts for functors over Hask, wherever they exist.

Synopsis

# Left Kan lifts

newtype Lift g f a Source

f => g . Lift g f
(forall z. f => g . z) -> Lift g f => z -- couniversal

Here we use the universal property directly as how we extract from our definition of Lift.

Constructors

 Lift FieldsrunLift :: forall z. Functor z => (forall x. f x -> g (z x)) -> z a

Instances

 Functor (Lift g h) (Functor g, ~ (* -> *) g h) => Copointed (Lift g h)

toLift :: Functor z => (forall a. f a -> g (z a)) -> Lift g f b -> z bSource

The universal property of Lift

fromLift :: Adjunction l u => (forall a. Lift u f a -> z a) -> f b -> u (z b)Source

fromLift . toLiftid
toLift . fromLiftid

glift :: Adjunction l g => k a -> g (Lift g k a)Source

f => g (Lift g f a)

composeLift :: (Composition compose, Functor f, Functor g) => Lift f (Lift g h) a -> Lift (compose g f) h aSource

decomposeLift :: (Composition compose, Adjunction l g) => Lift (compose g f) h a -> Lift f (Lift g h) aSource

adjointToLift :: Adjunction f u => f a -> Lift u Identity aSource

Lift u Identity a is isomorphic to the left adjoint to u if one exists.

liftToAdjoint :: Adjunction f u => Lift u Identity a -> f aSource

Lift u Identity a is isomorphic to the left adjoint to u if one exists.

liftToComposedAdjoint :: (Adjunction f u, Functor h) => Lift u h a -> f (h a)Source

Lift u h a is isomorphic to the post-composition of the left adjoint of u onto h if such a left adjoint exists.