[Haskell-cafe] Partial instance of a class

Tom Ellis tom-lists-haskell-cafe-2013 at jaguarpaw.co.uk
Tue Feb 27 17:25:25 UTC 2018


On Tue, Feb 27, 2018 at 10:15:04AM -0500, Daniel Peebles wrote:
> Not sure if everyone just missed my earlier link, but this talk of "Arrow
> without arr is useless" seems odd in the face of significant academic work
> (with Coq proofs, GHC extension, real-world use case for heterogeneous
> metaprogramming, etc.) going into exactly that abstraction.
> 
> Here it is again, if you did miss it:
> http://www.megacz.com/berkeley/garrows/

I didn't say that "Arrow without arr is useless" I said it would be "as
useless as Applicative without fmap".  99% of Haskell programmers would
never consider complaining about Applicative because it requires fmap and
the same ought to be true about Arrow and arr.

The page you link to documents research which I'm sure has great merit. 
Unfortunately it also promotes the myth that I was trying to dispel.  It
claims

    Haskell Arrows support metaprogramming only when the guest language is a
    superset of Haskell, because every Haskell function can be promoted to a
    guest language expression using arr.

but as both my Postgres library Opaleye and the paper I linked demonstrate
this is not correct.  Arrow can target languages that have no connection to
Haskell.

For the two concrete examples that have appeared on this list since my first
message GArrow is not the appropriate solution.  I invite readers to submit
their own examples where it is.

Tom


More information about the Haskell-Cafe mailing list