
21 Feb
2010
21 Feb
'10
9:21 a.m.
Is there a parser combinator library out there that works on bytestrings and allows using a custom error type?
The HuttonMeijerWallace combinators (distributed with polyparse) have the custom error type, but not the bytestrings.
Or maybe there's some very basic reason why String is so commonly used?
I don't think there is any deep reason. Strings are convenient, that is all. My guesstimate would be that if you take (e.g.) the polyparse combinators, and manually rewrite String everywhere to a parameter e, (only when it represents an error of course), it would take you maybe an hour in total, including fixing up any site you missed that the typechecker catches for you. Regards, Malcolm