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

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

Control.Monad.Codensity

Description

 

Synopsis

Documentation

newtype Codensity m a Source

Constructors

Codensity 

Fields

runCodensity :: forall b. (a -> m b) -> m b
 

improve :: Functor f => (forall m. MonadFree f m => m a) -> Free f aSource

Right associate all binds in a computation that generates a free monad This can improve the asymptotic efficiency of the result, while preserving semantics.