[Haskell-cafe] Token parsers in parsec consume trailing whitespace

Edward Z. Yang ezyang at MIT.EDU
Tue Dec 15 17:15:10 EST 2009

Excerpts from Greg Fitzgerald's message of Mon Dec 14 18:44:37 -0500 2009:
> It's too bad that the 'nat' function in Token is not defined in
> Parsec's Char module, and because of that, you need to copy-paste that
> code or roll your own.

"Maybe I should write a patch for that."

> That's correct.  Sounds to me like you shouldn't bother creating a
> tokenizer.  You might even be able to get away with using the regex
> library instead of Parsec.

I think, even in a situation when I could use strictly regexes, I would
still opt to use Parsec.  Composability and maintainability man!

Maybe I should add semicolons to the syntax to demarcate records, and
then convert everything to token-style parsing.


More information about the Haskell-Cafe mailing list