[Haskell-cafe] Data.Binary and little endian encoding

Don Stewart dons at galois.com
Thu May 14 23:54:37 EDT 2009

> I'm speaking specifically of the encode/decode functions.  I have no idea how
> they're implemented.
> Are you saying that encode is doing something really simple and the default
> encodings for things just happen to be big endian?  If so, then I understand
> the pain.... but it still means I have to roll my own :-)  I guess if one must
> choose, big endian kind of makes sense, except that the whole world is little
> endian now, except for networks :-)  (No one *really* cares about anything but
> x86 anyway these days right?)

Oh, 'encode' has type:

    encode :: Binary a => a -> ByteString

it just encodes with the default instances, which are all network order:

-- Don

More information about the Haskell-Cafe mailing list