newtype Yoneda :: (Type -> Type) -> Type -> Typenewtype Yoneda f a

The Yoneda Functor

Yoneda f is a Functor for any type constructor f.


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



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

Run a computation of type Yoneda f a.


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 :: forall f a. Yoneda f a -> f a

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


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.