kan-extensions-3.4: Kan extensions, Kan lifts, the Yoneda lemma, and (co)density (co)monads

Portabilityrank 2 types
MaintainerEdward Kmett <ekmett@gmail.com>
Safe HaskellTrustworthy






newtype Ran g h a Source




runRan :: forall b. (a -> g b) -> h b


Functor (Ran g h) 

toRan :: Functor k => (forall a. k (g a) -> h a) -> k b -> Ran g h bSource

toRan and fromRan witness a higher kinded adjunction. from (`'Compose'` g) to Ran g

fromRan :: (forall a. k a -> Ran g h a) -> k (g b) -> h bSource

composeRan :: Composition compose => Ran f (Ran g h) a -> Ran (compose f g) h aSource

decomposeRan :: (Composition compose, Functor f) => Ran (compose f g) h a -> Ran f (Ran g h) aSource

ranToComposedAdjoint :: Adjunction f g => Ran g h a -> h (f a)Source

composedAdjointToRan :: (Adjunction f g, Functor h) => h (f a) -> Ran g h aSource

data Lan g h a whereSource


Lan :: (g b -> a) -> h b -> Lan g h a 


Functor (Lan f g) 
(Functor g, Applicative h) => Applicative (Lan g h) 
(Functor g, Apply h) => Apply (Lan g h) 

toLan :: Functor f => (forall a. h a -> f (g a)) -> Lan g h b -> f bSource

fromLan :: (forall a. Lan g h a -> f a) -> h b -> f (g b)Source

lanToComposedAdjoint :: (Functor h, Adjunction f g) => Lan f h a -> h (g a)Source

lanToComposedAdjoint and composedAdjointToLan witness the natural isomorphism between Lan f h and Compose h g given f -| g

composedAdjointToLan :: Adjunction f g => h (g a) -> Lan f h aSource

composeLan :: (Composition compose, Functor f) => Lan f (Lan g h) a -> Lan (compose f g) h aSource

composeLan and decomposeLan witness the natural isomorphism from Lan f (Lan g h) and Lan (f o g) h

decomposeLan :: Composition compose => Lan (compose f g) h a -> Lan f (Lan g h) aSource