
On Feb 2, 2008 1:34 PM, Adam Langley
I'm pretty sure the cutContinuation is a terrible hack but, apart from having continuations in both directions, it was the best that I could come up with. However, I obvious don't understand Parsec because I made the try operator redundant, and I'm pretty sure that shouldn't have happened.
Well, I still think that it's a pretty big hack, but since I'd worked out how to do choice in an incremental parser I added it to binary-strict in darcs. http://darcs.imperialviolet.org/darcsweb.cgi?r=binary-strict;a=summary specifically: http://darcs.imperialviolet.org/darcsweb.cgi?r=binary-strict;a=headblob;f=/s... And since I had the choice operator, I added some other parsing stuff (many, <|> etc) to IncrementalGet and Get, than abstracted it out with a class http://darcs.imperialviolet.org/darcsweb.cgi?r=binary-strict;a=headblob;f=/s... Now you can write parsers which work in both strict and incremental modes. If you remove the monomorphism restriction, they can do both in the same module. As a test I'm writing an HTTP parser (one which handles all the RFC stuff that no one ever believes is valid - like newlines in lists) and it seems to be working pretty well. AGL -- Adam Langley agl@imperialviolet.org http://www.imperialviolet.org 650-283-9641