Proposal: refactor Arrow class
Edward Kmett
ekmett at gmail.com
Mon Jul 16 07:10:25 CEST 2012
On Sun, Jul 15, 2012 at 1:22 PM, Ross Paterson <ross at soi.city.ac.uk> 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.
http://en.wikipedia.org/wiki/Profunctor
http://ncatlab.org/nlab/show/profunctor
which you can find implemented here:
http://hackage.haskell.org/packages/archive/profunctors/3.0/doc/html/Data-Profunctor.html
with misc. extras here:
http://hackage.haskell.org/package/profunctor-extras
http://hackage.haskell.org/package/representable-profunctors
Dan Piponi wrote on the connection between arrows and profunctors at the
end of:
http://blog.sigfpe.com/2011/07/profunctors-in-haskell.html
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).
http://hackage.haskell.org/packages/archive/profunctor-extras/3.0/doc/html/Data-Profunctor-Composition.html
-Edward Kmett
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://www.haskell.org/pipermail/libraries/attachments/20120716/5e6c72b5/attachment.htm>
More information about the Libraries
mailing list