[Haskell-cafe] Parsing binary data.

Donald Bruce Stewart dons at cse.unsw.edu.au
Sat Aug 18 22:24:56 EDT 2007


marco-oweber:
> >    As I am a newbie to Haskell, I am not sure how to handle this problem
> >    with less work.  Do you have any ideas about this problem?
> >    Thanks in advance!
> 
> Have a look at 
> http://haskell.org/haskellwiki/Applications_and_libraries/Data_structures
> section 3 (IO) -> http://haskell.org/haskellwiki/Binary_IO
> 
> Of course you can just use most different parser libraries as well, because most
> are not tight to one token type.. So you shouldn't have any trouble
> parsing a ByeSttring which is a char (8bit word) buffer.
> 
> I'd recommend having a look at ParseP or happy/ alex .. if the binary
> libraries aren't suited for your task..
> 
> But to get the fastest/ whatsoever solution you should wait for
> different replies as I haven't used all those yet to parse binary data..

I'd also recommend Data.Binary for this -- parsing C-friendly protocols
off the wire, at high speed, is the main purpose for Data.Binary.

-- Don


More information about the Haskell-Cafe mailing list