[Haskell-cafe] blaze-builder and FlexibleInstances in code that aims to become part of the Haskell platform
iridcode at gmail.com
Fri May 20 09:54:23 CEST 2011
2011/5/20 Henning Thielemann <schlepptop at henning-thielemann.de>:
> Simon Meier schrieb:
>> There are many providers of Writes. Each bounded-length-encoding of a
>> standard Haskell value is likely to have a corresponding Write. For
>> example, encoding an Int32 as a big-endian, little-endian, and
>> host-endian byte-sequence is currently achieved with the following
>> three functions.
>> writeInt32BE :: Write Int32
>> writeInt32LE :: Write Int32
>> writeInt32HE :: Write Int32
>> I would like to avoid naming all these encodings individually.
> Maybe this one helps:
Thanks. I didn't know of that package. It for sure provides some
valuable input. Moreover, it pointed me to Antoine Latter's byteorder
package (http://hackage.haskell.org/package/byteorder). I might use
it, although I would rather have the ByteOrder determined at compile
time. Shouldn't GHC provide some means to determine this, as it's
compiling for a fixed architecture anyway? What experience have you
made Antoine when you implemented this package?
More information about the Haskell-Cafe