[Haskell-cafe] Parsing workflow

Ozgur Akgun 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?

from http://code.haskell.org/~malcolm/polyparse/docs/index.html#what

> If you have only ever used the parsec combinators before, then you might be

pleasantly surprised by polyparse: all of the same functionality is
> available,

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
> introduce

a try to fix it. In contrast, polyparsers are by default fully
> compositional.

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
> obvious

where it can be beneficial to add a commit.


Ozgur
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://www.haskell.org/pipermail/haskell-cafe/attachments/20101101/e24426ea/attachment-0001.html


More information about the Haskell-Cafe mailing list