>Ross Paterson wrote:
>>
>> John Hughes has defined a new abstract view of computation, in his
>> (currently draft) paper "Generalising Monads to Arrows", at
>>
>> http://www.cs.chalmers.se/~rjmh/Papers/arrows.ps
>
>Has anyone else read this paper? I'm interested in hearing comments, if
>only to point out some things that I may have missed. I'll admit, I
>haven't read the entire paper. I gave up after the 16th page, because it
>was so conceptually unwieldy. It's not that I had difficulty
>understanding how the system works, it's just that I found it difficult
>to believe that such a complex system would be useful in general
>practice.
I've only skimmed it, but it sure looks useful to me. (Thanks for
making us aware of it, Ross.) I've been wondering for a long time
about how to make the LL parsers fit into the monadic framework, and
now we have not only a way to do that, but a more general method for
making parts of any suitable monadic library static.
I think once we see some more examples using Ross's notation rather
than John's point-free one, the uses of the technique will become more
obvious. The thing to remember is that you can write your library and
application using monads first, then, once you're sure the semantics
are right, you can go back and optimize it with arrows by stratifying
the computation.
Even better, you could write your library in monadic form, but write
the application using arrows. You can use the coercions in the paper
to transform your monad into an arrow type (Kleisli arrows), and if
you use Ross's notation in your application, you could more or less
get away with thinking of it as just the usual monadic stuff. That way
you can go back and optimize the library without needing to change the
application. (Of course, you need to make sure that the application
doesn't use all the inherent power of the monad.)
>(Also, I'm not a mathematician who does a significant amount
>of work in category theory, so that may contribute to its apparent
>awkwardness to me.
--FC