Module

Codensity

Package
purescript-resource
Repository
joneshf/purescript-resource

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 Source

type Codensity f a = Ran f f a

#apply Source

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

#bind Source

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

#lift Source

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

#lift' Source

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

#liftAff Source

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

#liftEffect Source

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

#lower Source

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

#lower' Source

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

#map Source

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

#pure Source

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