A typeclass for byte operations?

Henning Thielemann lemming at henning-thielemann.de
Thu Feb 19 19:01:18 EST 2009


Don Stewart schrieb:
> 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.

In contrast to Data.Bits it should use the proper parameter order, e.g.
  rotateBytes :: Int -> a -> a


More information about the Libraries mailing list