[Haskell-cafe] Parsing workflow
ozgurakgun at gmail.com
Mon Nov 1 18:46:23 EDT 2010
On 1 November 2010 22:18, Andrew Coppin <andrewcoppin at btinternet.com> wrote:
> I vaguely recall somebody mentioning a parser library on Hackage where
> "try" is the default behaviour and you turn it off explicitly, rather than
> turning it on explicitly. Apparently this is much more intuitive. But
> unfortunately I can't remember what the hell the library was...
polyparse, is it?
> If you have only ever used the parsec combinators before, then you might be
pleasantly surprised by polyparse: all of the same functionality is
but it removes the confusion that all too commonly arises from a failure to
use parsec's try combinator correctly. Ambiguous grammars often fail to be
compositional in parsec, and it can be a black art guessing where to
a try to fix it. In contrast, polyparsers are by default fully
It is possible to improve their efficiency (and the accuracy of error
messages) by inserting commits (which are the dual of try), but it is not
necessary for writing a correct parser, and furthermore, it is usually
where it can be beneficial to add a commit.
-------------- next part --------------
An HTML attachment was scrubbed...
More information about the Haskell-Cafe