[Haskell-cafe] Parsing of bytestrings with non-String errors?

Malcolm Wallace malcolm.wallace at cs.york.ac.uk
Sun Feb 21 09:21:56 EST 2010


> 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



More information about the Haskell-Cafe mailing list