[Haskell-cafe] Data.Binary Endianness

Sven Panne sven.panne at aedion.de
Tue Sep 11 02:08:38 EDT 2007


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.

> to read a (IEEE) double you use
>
>   do x <- (get :: Double); ...

:Where is "IEEE" mentioned in the docs? Does it use LE/BE/host order? Plain 
get/put on Float/Double are useless for reading IEEE floating numbers.

Cheers,
   S.


More information about the Haskell-Cafe mailing list