License | BSD-style |
---|---|
Maintainer | Vincent Hanquez <vincent@snarc.org> |
Stability | stable |
Portability | good |
Safe Haskell | None |
Language | Haskell2010 |
Data.Memory.Endian
Description
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.
Constructors
LittleEndian | |
BigEndian |
Instances
Show Endianness Source # | |
Defined in Data.Memory.Endian Methods showsPrec :: Int -> Endianness -> ShowS show :: Endianness -> String showList :: [Endianness] -> ShowS | |
Eq Endianness Source # | |
Defined in Data.Memory.Endian |
getSystemEndianness :: Endianness Source #
Return the system endianness
Big Endian value
Instances
Storable a => Storable (BE a) Source # | |
Defined in Data.Memory.Endian Methods peekElemOff :: Ptr (BE a) -> Int -> IO (BE a) pokeElemOff :: Ptr (BE a) -> Int -> BE a -> IO () peekByteOff :: Ptr b -> Int -> IO (BE a) pokeByteOff :: Ptr b -> Int -> BE a -> IO () | |
Show a => Show (BE a) Source # | |
Eq a => Eq (BE a) Source # | |
Little Endian value
Instances
Storable a => Storable (LE a) Source # | |
Defined in Data.Memory.Endian Methods peekElemOff :: Ptr (LE a) -> Int -> IO (LE a) pokeElemOff :: Ptr (LE a) -> Int -> LE a -> IO () peekByteOff :: Ptr b -> Int -> IO (LE a) pokeByteOff :: Ptr b -> Int -> LE a -> IO () | |
Show a => Show (LE a) Source # | |
Eq a => Eq (LE a) Source # | |
class Storable a => ByteSwap a Source #
Class of types that can be byte-swapped.
e.g. Word16, Word32, Word64
Minimal complete definition
byteSwap
Instances
ByteSwap Word16 Source # | |
Defined in Data.Memory.Endian Methods byteSwap :: Word16 -> Word16 | |
ByteSwap Word32 Source # | |
Defined in Data.Memory.Endian Methods byteSwap :: Word32 -> Word32 | |
ByteSwap Word64 Source # | |
Defined in Data.Memory.Endian Methods byteSwap :: Word64 -> Word64 |