[Haskell-cafe] Re: Parsec lookahead and <|>

Martijn van Steenbergen martijn at van.steenbergen.nl
Fri Aug 21 08:40:25 EDT 2009


Thanks for your replies.

Job Vranish wrote:
> Martijn, how did you encounter this problem?

My list of input symbols contains some extra information and I was using 
lookahead to query for that information before doing the actual parsing. 
I was using it in various places, including a list of choices separated 
by <|>. I was assuming it wouldn't affect the choice but it turned out 
that Parsec was always going for the first one because I used a 
lookahead (see la) that always succeeds.

Martijn.


More information about the Haskell-Cafe mailing list