[Haskell-cafe] multiple computations, same input

Neil Mitchell ndmitchell at gmail.com
Mon Mar 27 20:03:44 EST 2006


> Thanks Neil.  How do I add in another ~10 computations, or map a list of a
> 100 computations to the same input?
>
> Isn't there a way to do this without one computation having to be aware of
> the other?

I guess they have to be aware at some level, perhaps arrows generalise
the awareness they need, to perhaps you'd need something else.


> This feels like a situation Parsec users would find themselves in all the
> time.  When you have a bunch of parsers in a 'choice', does the start of the
> input stream linger until the last parser is executed?

No, as soon as one token is accepted from any parser, that input is
decided upon, and it will never go back. If you want that behaviour
you have to wrap the particular parser in try, which does give the
backtracking (and space leak)

Thanks

Neil


More information about the Haskell-Cafe mailing list