[Haskell-cafe] Techniques for ensuring parser correctness?

Jason Dagit dagit at codersbase.com
Mon Jul 26 13:40:50 EDT 2010

On Mon, Jul 26, 2010 at 4:14 AM, S. Doaitse Swierstra <doaitse at swierstra.net
> wrote:

> I took a quick look at this file. To me it seems a mixture of a lexer and a
> parser built on top of a home brewn parser library. I see function like
> maybeWork which
> (if I interpret correctly) test whether specific conditions hold for the
> input, etc.

The one Eric linked to is the current parser, but it's not the one I had in
mind when I mentioned the "parsec-like" API.

I have modified the API exported by the home brewed parser to be more
parsec-like, but my changes are still in review.  You can see them here:

I have also included the PatchInfo parser on that page as it is defined in a
different module than the one Eric linked.

> Indeed it would be nice to have a grammatical description of the input
> format. An important question is whether you can be assured that all input
> is indeed correct, or whether any checking has to be done.

Most of the time darcs just consumes its own output.  Sometimes humans edit
their patches, for example to rewrite history, but this is discouraged.
Also, darcs stores hashes of files and checks them so editing patches will
fail unless those hashes are updated too.  When patches are mailed the
mailer might munge them so that's another time when it's good to do some
input validation.

-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://www.haskell.org/pipermail/haskell-cafe/attachments/20100726/f3337bbb/attachment.html

More information about the Haskell-Cafe mailing list