Functorial Application and Monadic Lenses

Functorial application combines a functor with a container by applying the functor to the the “response” part of the container.

Definition

Functor application of containers, read “app”.

() : (f : Type -> Type) -> Container -> Container
() f c = (x : c.req) !> f (c.res x)

The first thing to notice about this operator is that it flips the arrows between the functor category in and the functor category in . Formally this is described as a functor from the opposite category of endofunctors to the category of morphisms in . Or equivalently: