[Haskell-cafe] Parsing workflow

Nils Schweinsberg ml at n-sch.de
Sun Oct 31 12:15:01 EDT 2010


Am 31.10.2010 16:53, schrieb Vo Minh Thu:
> I can't really tell from your description, but maybe this is because
> of the way Parsec works when it deals with alternatives. When you
> combine several parsers with e.g. '<|>' or 'choice', an alternative
> that can consume some input but fails will make the whole combined
> parser fail too. So you have to either factorize you parsers or use
> the 'try'. See the documentation for 'try' at
> http://hackage.haskell.org/packages/archive/parsec/3.1.0/doc/html/Text-Parsec-Prim.html
> .
>

This is exactly what gives me headaches. It's hard to tell where you 
need try/lookAhead and where you don't need them. And I don't really 
feel comfortable wrapping everything into try blocks...


More information about the Haskell-Cafe mailing list