Search code examples
haskellparsecbytestring

Using Haskell's Parsec to parse a ByteString


I've managed to use Parsec to parse a String, but cannot manage to do the same with a ByteString.

How can I make Parsec work with ByteStrings without manually converting them to Strings?

I get the feeling this isn't hard to accomplish. Am I wrong? (I'm new to Haskell. ^^)

Thanks!


Solution

  • Just import the Parser type from Text.Parsec.ByteString or Text.Parsec.ByteString.Lazy, instead of from Text.Parsec.String.