category-extras-0.53.5: Various modules and constructs inspired by category theory

Portabilitynon-portable (rank-2 polymorphism)
Stabilityexperimental
MaintainerEdward Kmett <ekmett@gmail.com>

Control.Comonad.Density

Description

The density comonad for a functor. aka the comonad cogenerated by a functor The ''density'' term dates back to Dubuc''s 1974 thesis. The term ''monad genererated by a functor'' dates back to 1972 in Street''s ''Formal Theory of Monads''.

Synopsis

Documentation

data Density k a Source

Constructors

forall b . Density (k b -> a) (k b) 

toDensity :: Functor s => (forall a. k a -> s (k a)) -> Density k :~> sSource

Nat(k, s.k) is isomorphic to Nat (Density k, s) (forwards)

fromDensity :: (Density k :~> s) -> k a -> s (k a)Source

Nat(k, s.k) is isomorphic to Nat (Density k, s) (backwards)

liftDensity :: Comonad w => w a -> Density w aSource

The natural isomorphism between a comonad w and the comonad generated by w (forwards).

lowerDensity :: Comonad w => Density w a -> w aSource

The natural isomorphism between a comonad w and the comonad generated by w (backwards).

improveCofree :: Functor f => (forall w. ComonadCofree f w => w a) -> Cofree f aSource