A typeclass for byte operations?

Lennart Augustsson lennart at augustsson.net
Thu Feb 19 19:21:20 EST 2009

You might want to make it more general than byte and byte-vector (or
whatever it is you imagine rotating).
The endian problem occurs anytime a sequence of smaller units are
aggregated to a larger unit.
So it could be bits in a word, 8-bit bytes in a vector, nybbles in a byte, etc.

On Thu, Feb 19, 2009 at 7:12 PM, Don Stewart <dons at galois.com> wrote:
> Hey guys,
> At work we have many and varied needs to do bytewise operations on
> Haskell data. Things like:
>    toBigEndian
>    rotateBytes
> etc.
> Has anyone thought about:
>    * A "Bytes" class, like the Bits class? Providing standard
>    operations on values treated as bytes?
>    * An Endian class, a la fromIntegral, for flipping bytes into a
>    particular endianness.
> -- Don
> _______________________________________________
> Libraries mailing list
> Libraries at haskell.org
> http://www.haskell.org/mailman/listinfo/libraries

More information about the Libraries mailing list