[Haskell-cafe] ANNOUNCE: arrow-list. List arrows for Haskell.
haskell at fvisser.nl
Sun Nov 7 04:31:42 EST 2010
On Nov 7, 2010, at 1:40 AM, Sebastian Fischer wrote:
> On Nov 6, 2010, at 10:00 PM, Sebastiaan Visser wrote:
>> List arrows are a powerful tool when processing XML, building query languages and lots of other domains that build on functions that might return more than one value as their output.
> Interesting. Do you plan to write some examples that show
> * how to use ListArrows,
Yes, I certainly am. Although, time is currently not on my side. I'm planning to write up a blog post about using list arrows for XML processing.
> * differences to using the list monad, and
> * when using ListArrow is preferrable?
> I'm interested to see something like this worked out although I have some rough ideas like "monads are more powerful and arrows may allow stronger reasoning and more efficient implementations". Can you substantiate these general points for the concrete case of ListArrow vs list monad?
Beside the fact that, after playing with them for while, I find arrows more convenient to use than monads, the ability to inspect their structure can help you to optimize them.
> I assume your implementation is *not* more efficient than the list monad as it builds on ListT.
That is entirely true.
But this is only implementation, different implementations may be possible that are more efficient. As long as ArrowApply is not involved static optimization might be possible that fuses intermediate lists, as far as the compiler is not already doing so.
I'm also planning to investigate whether it is possible (useful) to perform the list computations (the map in concatMap) in parallel. I'm not sure if someone has already tried this for list monads.
More information about the Haskell-Cafe