[Haskell-cafe] Data.Binary Endianness

Don Stewart dons at galois.com
Tue Sep 11 02:14:52 EDT 2007


sven.panne:
> On Monday 10 September 2007 19:50, Thomas Schilling wrote:
> > [...]
> > instance Binary MP3 where
> >   get = MP3 <$> getHeader <*> getData -- [*]
> >     where getHeader = do magic <- getWord32le
> > 	                 case magic of
> >                            ...
> 
> Of course this works in the sense that "it compiles", but Binary is 
> conceptually the wrong class to use.

I wouldn't go as far as saying `wrong', for protocol-specific data types it 
seems reasonable for the Haskell serialisation to use an agreed-upon external
format, via a Binary instance.

It's cute, anyway.

-- Don


More information about the Haskell-Cafe mailing list