[Haskell-cafe] Re: Optimizing Parsec 3 -- was: Wiki software?

Derek Elkins derek.a.elkins at gmail.com
Sat Dec 5 00:46:37 EST 2009

On Fri, Dec 4, 2009 at 11:01 PM, Evan Laforge <qdunkan at gmail.com> wrote:
> On Fri, Dec 4, 2009 at 1:09 PM, John MacFarlane <jgm at berkeley.edu> wrote:
>>> On Mon, Nov 23, 2009 at 12:29 PM, Antoine Latter <aslatter at gmail.com> wrote:
>>> I finally had some time to test it.  After running it multiple times
>>> (of course, it would be nice to use criterion here), I'm getting
>>> numbers in this neighborhood:
>> I used criterion to compare pandoc compiled with parsec2 to
>> pandoc compiled with your version of parsec3.  (The benchmark
>> is converting testsuite.txt from markdown to HTML.) The difference was
>> minor:
> Very nice, I was interested in parsec 3 but scared off by the reports
> of slowness, as I'm sure many others were.
> Is there any document out there describing the differences between 2
> and 3?  I gathered 3 allows more flexibility wrt the input, so you can
> more easily use ByteString or Text, but it would be nice to have a doc
> saying what the new features are and why we should be interested in
> upgrading.

Basically, the main (only) significant changes are that Parsec 3
provides a monad transformer rather than just a monad and the input
has been generalized to take arbitrary "Streams" rather than lists of

> The old parsec docs were out of date even for parsec 2, and looks like
> they haven't been updated.  The new ones look like they use haddock
> which is great, that was a gripe I had about the old doc.  However,
> the haddock docs are less friendly than the old doc.  So my suggestion
> is to paste the old introduction (with Daan permission, of course) or
> something similar into the Text.Parsec description field, along with
> links to more detailed descriptions and tutorial in the style of v2 on
> haskell.org along with a 2 vs. 3 doc, even if they're sketchy and
> brief.

The Parsec Letter applies to Parsec 3 readily.  The only thing that
needs changing is the module names and possibly one or two function
names which the haddock documentation should readily point out.  The
letter obviously does not cover the new features of Parsec 3; for that
there is only the haddock at this point.

It would be nice to update the Parsec letter but that would ideally
require the document source and necessarily require Daan's permission.
 Unfortunately, no one has been able to get in touch with Daan on this
issue to my knowledge.

> Or if it's ok I could just send some darcs patches :)

You can certainly email me patches and I'll likely apply them if there
are no copyright or licensing issues.

More information about the Haskell-Cafe mailing list