Module

Codensity

An implementation of Codensity.

Codensity is the right Kan-extension of some data type along itself. As suchh, most of the values here are type restricted version of the values in the Ran module.

#Codensity

type Codensity f a = Ran f f a

#apply

apply :: forall a b f. Codensity f (a -> b) -> Codensity f a -> Codensity f b

#bind

bind :: forall a b f. Codensity f a -> (a -> Codensity f b) -> Codensity f b

#lift

lift :: forall f g. Functor g => (forall a. g (f a) -> f a) -> g ~> (Codensity f)

#lift'

lift' :: forall f. Comonad f => f ~> (Codensity f)

#liftAff

liftAff :: forall f. MonadAff f => Aff ~> (Codensity f)

#liftEffect

liftEffect :: forall f. MonadEffect f => Effect ~> (Codensity f)

#lower

lower :: forall a f g. (g ~> (Codensity f)) -> g (f a) -> f a

#lower'

lower' :: forall f. Applicative f => (Codensity f) ~> f

#map

map :: forall a b f. (a -> b) -> Codensity f a -> Codensity f b

#pure

pure :: forall a f. a -> Codensity f a

Modules