Module

Data.Coyoneda

Package
purescript-free
Repository
purescript/purescript-free

#CoyonedaF Source

data CoyonedaF f a i

Coyoneda is encoded as an existential type using Data.Exists.

This type constructor encodes the contents of the existential package.

#Coyoneda Source

newtype Coyoneda f a

The Coyoneda Functor.

Coyoneda f is a Functor for any type constructor f. In fact, it is the free Functor for f.

Constructors

Instances

#coyoneda Source

coyoneda :: forall b a f. (a -> b) -> f a -> Coyoneda f b

Construct a value of type Coyoneda f b from a mapping function and a value of type f a.

#unCoyoneda Source

unCoyoneda :: forall a g f. (forall b. (b -> a) -> f b -> g a) -> Coyoneda f a -> g a

Deconstruct a value of Coyoneda a to retrieve the mapping function and original value.

#liftCoyoneda Source

liftCoyoneda :: forall f. f ~> (Coyoneda f)

Lift a value described by the type constructor f to Coyoneda f.

#lowerCoyoneda Source

lowerCoyoneda :: forall f. Functor f => (Coyoneda f) ~> f

Lower a value of type Coyoneda f a to the Functor f.

#hoistCoyoneda Source

hoistCoyoneda :: forall g f. (f ~> g) -> (Coyoneda f) ~> (Coyoneda g)

Use a natural transformation to change the generating type constructor of a Coyoneda.