[Haskell-cafe] Re: Parsec, updateState, and failure

Achim Schneider barsoap at web.de
Sat May 31 13:12:26 EDT 2008


"Dimitry Golubovsky" <golubovsky at gmail.com> wrote:

> If a parser which updated user state fails, will such update be
> reverted?
> 
I have no idea, I gave up before investigating that far.

You want to avoid state at any cost, even more so if the state would
influence parsing: spaghetti and headaches lay ahead. In the end I did
three passes: two times parsec and one time something similar to
accumMap.

Now that I'm thinking of it, it would be nice if parsec supported
spans in source positions, so that you can report errors like

XYZ at foo.bar line 3 column 2 in ZYX spanning line 2-4 column
34-20.

-- 
(c) this sig last receiving data processing entity. Inspect headers for
past copyright information. All rights reserved. Unauthorised copying,
hiring, renting, public performance and/or broadcasting of this
signature prohibited. 



More information about the Haskell-Cafe mailing list