On Sun, Jul 15, 2012 at 1:22 PM, Ross Paterson <span dir="ltr">&lt;<a href="mailto:ross@soi.city.ac.uk" target="_blank">ross@soi.city.ac.uk</a>&gt;</span> wrote: <div class="gmail_quote"><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">
I propose to refactor the Arrow class, so that GHC&#39;s arrow notation can<br>
be a bit more general.  [...]<br>
In detail, the proposal is to change the Arrow class from [...] by introducing a new class<br>
<br>  class PreArrow a where<br>
    premap :: (b -&gt; b&#39;) -&gt; a b&#39; c -&gt; a b c<br></blockquote><div><br></div><div>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.</div>
<div><br></div><div><a href="http://en.wikipedia.org/wiki/Profunctor">http://en.wikipedia.org/wiki/Profunctor</a></div><div><a href="http://ncatlab.org/nlab/show/profunctor">http://ncatlab.org/nlab/show/profunctor</a></div>
<div><br></div><div>which you can find implemented here:</div><div><br></div><div><a href="http://hackage.haskell.org/packages/archive/profunctors/3.0/doc/html/Data-Profunctor.html">http://hackage.haskell.org/packages/archive/profunctors/3.0/doc/html/Data-Profunctor.html</a></div>
<div><br></div><div>with misc. extras here:</div><div><br></div><div><a href="http://hackage.haskell.org/package/profunctor-extras">http://hackage.haskell.org/package/profunctor-extras</a></div><div><a href="http://hackage.haskell.org/package/representable-profunctors">http://hackage.haskell.org/package/representable-profunctors</a></div>
<div><br></div><div>Dan Piponi wrote on the connection between arrows and profunctors at the end of:</div><div><br></div><div><a href="http://blog.sigfpe.com/2011/07/profunctors-in-haskell.html">http://blog.sigfpe.com/2011/07/profunctors-in-haskell.html</a></div>
<div><br></div><div>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. </div>
<div><br></div><div>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).</div><div><br></div>
<div><a href="http://hackage.haskell.org/packages/archive/profunctor-extras/3.0/doc/html/Data-Profunctor-Composition.html">http://hackage.haskell.org/packages/archive/profunctor-extras/3.0/doc/html/Data-Profunctor-Composition.html</a></div>
<div><br></div><div>-Edward Kmett</div></div>