Module

Control.Applicative.Free

Package
purescript-freeap
Repository
ethul/purescript-freeap

#FreeAp Source

data FreeAp :: (Type -> Type) -> Type -> Typedata FreeAp f a

The free applicative functor for a type constructor f.

Instances

#liftFreeAp Source

liftFreeAp :: forall f a. f a -> FreeAp f a

Lift a value described by the type constructor f into the free applicative functor.

#retractFreeAp Source

retractFreeAp :: forall f a. Applicative f => FreeAp f a -> f a

Run a free applicative functor using the applicative instance for the type constructor f.

#foldFreeAp Source

foldFreeAp :: forall f g a. Applicative g => (f ~> g) -> FreeAp f a -> g a

Run a free applicative functor with a natural transformation from the type constructor f to the applicative functor g.

#hoistFreeAp Source

hoistFreeAp :: forall f g a. (f ~> g) -> FreeAp f a -> FreeAp g a

Natural transformation from FreeAp f a to FreeAp g a given a natural transformation from f to g.

#analyzeFreeAp Source

analyzeFreeAp :: forall f m a. Monoid m => (forall b. f b -> m) -> FreeAp f a -> m

Perform monoidal analysis over the free applicative functor f.