Previously attoparsec was suggested to me for parsing complex binary file formats. While I can find examples of attoparsec parsing HTTP, which is essentially text based, I cannot find an example parsing actual binary, for example, a TCP packet, or image file, or mp3. Can someone post some code or pointer to some code which does this using attoparsec?
There are few or no examples of attoparsec for parsing binary formats, as parsec-style combinator parsing is mostly for text formats, not binary formats (though there's no good reason for this).
For straight binary parsing, see Data.Binary, examples include:
and the examples in Real World Haskell.
The main example for attoparsec at the moment is an RFC2616 parser (HTTP).
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With