Who is afraid of arrows, was Re: [Haskell-cafe] ANNOUNCE: Haskell XML Toolbox Version 9.0.0

Dan Doel dan.doel at gmail.com
Tue Oct 12 16:22:26 EDT 2010


On Tuesday 12 October 2010 4:02:06 pm Gregory Crosswhite wrote:

> Hughes himself said that when your arrow is an instance of ArrowApply,
> you are better off just sticking with monads.

Well, this is not necessarily good advice. It is true that ArrowApply will 
preclude some sort of static analysis. But, this does not mean that you cannot 
do the static analysis on the pieces of code that *can* be written using less 
powerful arrow combinators.

The same can be said about Applicative, Monad, etc. The combinators in the 
former could be implemented in ways that allow some extra analysis to be done, 
while those in the latter are still available when absolutely necessary. I 
believe the Utrecht parsing library does this, and encourages parsers to be 
written in applicative style as much as possible for this reason.

If you have nothing like that to gain, though, it may make sense to jettison 
arrows due merely to syntactic considerations and the like, though.

-- Dan


More information about the Haskell-Cafe mailing list