byte-order-0.1.0.0: Portable big-endian and little-endian conversions

Safe HaskellSafe
LanguageHaskell2010

System.ByteOrder.Class

Synopsis

Documentation

class Bytes a where Source #

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.

Methods

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.