[Haskell-cafe] Operator precedence and associativity with Polyparse

Ivan Lazar Miljenovic ivan.miljenovic at gmail.com
Wed Oct 26 01:53:53 CEST 2011

On 26 October 2011 10:49, Tom Hawkins <tomahawkins at gmail.com> wrote:
>>> Can someone provide guidance on how handle operator precedence and
>>> associativity with Polyparse?
>> Do you mean parsing something like "1 + 2 * 3" ?  I don't think
>> there's any real difference in using Polyparse vs Parsec for this,
>> except for doing "p `orElse` q" rather than "try p <|> q".
> Actually, I was looking for something equivalent to
> Text.ParserCombinators.Parsec.Expr.buildExpressionParser.  I suppose I
> should learn how Parsec implements this under the hood.

There's nothing like that for PolyParse: it has a much smaller set of
combinators than Parsec, which I for one prefer because I don't have
to worry about behaviour of existing combinators being different than
what I want/need (as it stands, I already use a custom version of
bracket from polyparse).

Ivan Lazar Miljenovic
Ivan.Miljenovic at gmail.com

More information about the Haskell-Cafe mailing list