
Stephen,
Thanks much for the pointer to the examples in the sources; found them.
(Its nice to learn from the coding style used by the authors.)
-- Peter
On Sat, Sep 25, 2010 at 12:34 AM, Stephen Tetley
On 25 September 2010 05:30, Evan Laforge
wrote: I thought the parsec source included some example parsers for simple languages? In any case, there is lots of material floating around, [Snip]
The best documentation is Daan Leijen's original manual, plus the original source distribution which has example parsers for Henk, Tiger and Mondrain.
Both are available from here - the original poster was working with the HTML version of the manual - there is also a PDF version:
http://legacy.cs.uu.nl/daan/parsec.html
It would be nice if the Hackage package added the examples back into the distribution.
The parser in the Scheme in 48 hours tutorial isn't a great example of Parsec as it doesn't use the Token module. Not using the Token module means the Scheme parser does hacky things such as parseNumber which uses /read/ - this is double work, Parsec already handles numbers, it doesn't need to call out to another parser (Haskell's builtin read).
http://en.wikibooks.org/wiki/Write_Yourself_a_Scheme_in_48_Hours/Parsing _______________________________________________ Haskell-Cafe mailing list Haskell-Cafe@haskell.org http://www.haskell.org/mailman/listinfo/haskell-cafe