category-extras-0.53.5: Various modules and constructs inspired by category theorySource codeContentsIndex
Control.Functor.KanExtension
Portabilitynon-portable (rank-2 polymorphism)
Stabilityexperimental
MaintainerEdward Kmett <ekmett@gmail.com>
Contents
Right Kan Extensions
Left Kan Extensions
Description

Left and right Kan extensions, expressed as higher order functors

See http://comonad.com/reader/2008/kan-extensions/ and http://comonad.com/reader/2008/kan-extensions-ii/ for motivation.

NB: Yoneda, CoYoneda, Density, Codensity have been factored out into separate modules.

Synopsis
newtype Ran g h a = Ran {
runRan :: forall b. (a -> g b) -> h b
}
toRan :: (Composition o, Functor k) => ((k `o` g) :~> h) -> k :~> Ran g h
fromRan :: Composition o => (k :~> Ran g h) -> (k `o` g) :~> h
adjointToRan :: Adjunction f g => f :~> Ran g Identity
ranToAdjoint :: Adjunction f g => Ran g Identity :~> f
ranToComposedAdjoint :: (Composition o, Adjunction f g) => Ran g h :~> (h `o` f)
composedAdjointToRan :: (Functor h, Composition o, Adjunction f g) => (h `o` f) :~> Ran g h
composeRan :: Composition o => Ran f (Ran g h) :~> Ran (f `o` g) h
decomposeRan :: (Functor f, Composition o) => Ran (f `o` g) h :~> Ran f (Ran g h)
data Lan g h a = forall b . Lan (g b -> a) (h b)
toLan :: (Composition o, Functor f) => (h :~> (f `o` g)) -> Lan g h :~> f
fromLan :: Composition o => (Lan g h :~> f) -> h :~> (f `o` g)
adjointToLan :: Adjunction f g => g :~> Lan f Identity
lanToAdjoint :: Adjunction f g => Lan f Identity :~> g
composeLan :: (Functor f, Composition o) => Lan f (Lan g h) :~> Lan (f `o` g) h
decomposeLan :: Composition o => Lan (f `o` g) h :~> Lan f (Lan g h)
lanToComposedAdjoint :: (Functor h, Composition o, Adjunction f g) => Lan f h :~> (h `o` g)
composedAdjointToLan :: (Composition o, Adjunction f g) => (h `o` g) :~> Lan f h
Right Kan Extensions
newtype Ran g h a Source

The right Kan Extension of h along g. An alternative definition in terms of Ends.

newtype RanT g h a b b' { (a -> g b) -> h b' }
type Ran g h a = End (RanT g h a)
Constructors
Ran
runRan :: forall b. (a -> g b) -> h b
show/hide Instances
toRan :: (Composition o, Functor k) => ((k `o` g) :~> h) -> k :~> Ran g hSource
Nat(k o g, h) is isomorphic to Nat(k, Ran g h) (forwards)
fromRan :: Composition o => (k :~> Ran g h) -> (k `o` g) :~> hSource
Nat(k o g, h) is isomorphic to Nat(k, Ran g h) (backwards)
adjointToRan :: Adjunction f g => f :~> Ran g IdentitySource
f -| g iff Ran g Identity exists (forward)
ranToAdjoint :: Adjunction f g => Ran g Identity :~> fSource
f -| g iff Ran g Identity exists (backwards)
ranToComposedAdjoint :: (Composition o, Adjunction f g) => Ran g h :~> (h `o` f)Source
composedAdjointToRan :: (Functor h, Composition o, Adjunction f g) => (h `o` f) :~> Ran g hSource
composeRan :: Composition o => Ran f (Ran g h) :~> Ran (f `o` g) hSource
The natural isomorphism from Ran f (Ran g h) to Ran (f o g) h (forwards)
decomposeRan :: (Functor f, Composition o) => Ran (f `o` g) h :~> Ran f (Ran g h)Source
The natural isomorphism from Ran f (Ran g h) to Ran (f o g) h (backwards)
Left Kan Extensions
data Lan g h a Source

Left Kan Extension

newtype LanT g h a b b' { (g b -> a, h b') }
type Lan g h a = Coend (LanT g h a)
Constructors
forall b . Lan (g b -> a) (h b)
show/hide Instances
toLan :: (Composition o, Functor f) => (h :~> (f `o` g)) -> Lan g h :~> fSource
Nat(h, f.g) is isomorphic to Nat (Lan g h, f) (forwards)
fromLan :: Composition o => (Lan g h :~> f) -> h :~> (f `o` g)Source
Nat(h, f.g) is isomorphic to Nat (Lan g h, f) (backwards)
adjointToLan :: Adjunction f g => g :~> Lan f IdentitySource
f -| g iff Lan f Identity is inhabited (forwards)
lanToAdjoint :: Adjunction f g => Lan f Identity :~> gSource
f -| g iff Lan f Identity is inhabited (backwards)
composeLan :: (Functor f, Composition o) => Lan f (Lan g h) :~> Lan (f `o` g) hSource
the natural isomorphism from Lan f (Lan g h) to Lan (f o g) h (forwards)
decomposeLan :: Composition o => Lan (f `o` g) h :~> Lan f (Lan g h)Source
the natural isomorphism from Lan f (Lan g h) to Lan (f o g) h (backwards)
lanToComposedAdjoint :: (Functor h, Composition o, Adjunction f g) => Lan f h :~> (h `o` g)Source
composedAdjointToLan :: (Composition o, Adjunction f g) => (h `o` g) :~> Lan f hSource
Produced by Haddock version 2.4.2