memory-0.18.0: memory and related abstraction stuff
License BSD-style
Maintainer Vincent Hanquez <vincent@snarc.org>
Stability stable
Portability good
Safe Haskell None
Language Haskell2010

Data.Memory.Endian

Description

Synopsis

Documentation

data Endianness Source #

represent the CPU endianness

Big endian system stores bytes with the MSB as the first byte. Little endian system stores bytes with the LSB as the first byte.

middle endian is purposely avoided.

fromBE :: ByteSwap a => BE a -> a Source #

Convert from a big endian value to the cpu endianness

toBE :: ByteSwap a => a -> BE a Source #

Convert a value in cpu endianess to big endian

fromLE :: ByteSwap a => LE a -> a Source #

Convert from a little endian value to the cpu endianness

toLE :: ByteSwap a => a -> LE a Source #

Convert a value in cpu endianess to little endian

class Storable a => ByteSwap a Source #

Class of types that can be byte-swapped.

e.g. Word16, Word32, Word64

Minimal complete definition

byteSwap