Module

Data.Yoneda

#Yoneda

newtype Yoneda f a

The Yoneda Functor

Yoneda f is a Functor for any type constructor f.

Constructors

  • Yoneda (forall b. (a -> b) -> f b)

Instances

#runYoneda

runYoneda :: forall f a b. Yoneda f a -> (a -> b) -> f b

Run a computation of type Yoneda f a.

#liftYoneda

liftYoneda :: forall f a. Functor f => f a -> Yoneda f a

Lift a value described by the Functor f to the Functor Yoneda f.

#lowerYoneda

lowerYoneda :: forall f a. Yoneda f a -> f a

Lower a value of type Yoneda f a to the type constructor f.

#hoistYoneda

hoistYoneda :: forall f g a. (f ~> g) -> Yoneda f a -> Yoneda g a

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

Modules