[Haskell-cafe] Parsec lookahead and |

2009-08-20 Thread Martijn van Steenbergen
Goedemiddag café, Consider the following function, using parsec-3.0.0: la :: Parsec String () (Maybe Char) la = lookAhead (optionMaybe anyChar) *Lookahead parseTest (char 'a' | char 'b') a 'a' *Lookahead parseTest (char 'a' | char 'b') b 'b' *Lookahead parseTest (la * char 'a' | char 'b') a

Re: [Haskell-cafe] Parsec lookahead and |

2009-08-20 Thread Job Vranish
Yeah, that's weird. I played around with la and it seems to only cause problems when the parser passed into lookAhead succeeds, which seem to go directly against it's stated purpose. lookAhead isn't consuming, (hence the unexpected b) but still prevents | from doing it's thing. Seems like a

Re: [Haskell-cafe] Parsec lookahead and |

2009-08-20 Thread Daniel Fischer
Am Donnerstag 20 August 2009 13:44:15 schrieb Martijn van Steenbergen: Goedemiddag café, Consider the following function, using parsec-3.0.0: la :: Parsec String () (Maybe Char) la = lookAhead (optionMaybe anyChar) *Lookahead parseTest (char 'a' | char 'b') a 'a' *Lookahead parseTest