Portability | non-portable (GADTs, MPTCs) |
---|---|

Stability | experimental |

Maintainer | Edward Kmett <ekmett@gmail.com> |

Safe Haskell | Trustworthy |

The density comonad for a functor. aka the comonad generated 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''.

- data Density k a where
- liftDensity :: Comonad w => w a -> Density w a
- densityToAdjunction :: Adjunction f g => Density f a -> f (g a)
- adjunctionToDensity :: Adjunction f g => f (g a) -> Density f a

# Documentation

ComonadTrans Density | |

Functor (Density f) | |

Applicative f => Applicative (Density f) | |

Comonad (Density f) | |

Apply f => Apply (Density f) | |

Extend (Density f) |

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

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

densityToAdjunction :: Adjunction f g => Density f a -> f (g a)Source

adjunctionToDensity :: Adjunction f g => f (g a) -> Density f aSource