Proposal: refactor Arrow class

Edward Kmett ekmett at
Mon Jul 16 07:10:25 CEST 2012

On Sun, Jul 15, 2012 at 1:22 PM, Ross Paterson <ross at> wrote:

> I propose to refactor the Arrow class, so that GHC's arrow notation can
> be a bit more general.  [...]
> In detail, the proposal is to change the Arrow class from [...] by
> introducing a new class
>   class PreArrow a where
>     premap :: (b -> b') -> a b' c -> a b c

There is a slightly more principled notion that offers up this operation,
paired with an fmap-like operation on the second argument that is satisfied
by all arrows -- a profunctor.

which you can find implemented here:

with misc. extras here:

Dan Piponi wrote on the connection between arrows and profunctors at the
end of:

If we are going to introduce another superclass, I would much rather
introduce that one, as it has a better theoretical motivation and the
additional laws regarding dinatural transformations and the extra structure
that follows.

For instance, profunctor composition is both well defined and useful (as
are profunctor collages and traces, and there is also a useful notion of
representability for profunctors).

-Edward Kmett
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <>

More information about the Libraries mailing list