Safe Haskell | Safe |
---|---|
Language | Haskell2010 |
Synopsis
- class Bytes a where
- toBigEndian :: a -> a
- toLittleEndian :: a -> a
Documentation
Types that are represented as a fixed-sized word. For these types, the bytes can be swapped. The instances of this class use byteswapping primitives and compile-time knowledge of native endianness to provide portable endianness conversion functions.
toBigEndian :: a -> a Source #
Convert from a native-endian word to a big-endian word.
toLittleEndian :: a -> a Source #
Convert from a native-endian word to a little-endian word.