Safe Haskell | None |
---|---|
Language | Haskell2010 |
Byte order ("endianness")
Indicate in which order bytes are stored in memory for multi-bytes types. Big-endian means that most-significant bytes come first. Little-endian means that least-significant bytes come first.
- data Endianness
- data WordGetters = WordGetters {}
- data WordPutters = WordPutters {
- wordPutter8 :: Word8 -> Put
- wordPutter16 :: Word16 -> Put
- wordPutter32 :: Word32 -> Put
- wordPutter64 :: Word64 -> Put
- getWordGetters :: Endianness -> WordGetters
- getWordPutters :: Endianness -> WordPutters
- data WordSize
- data ExtendedWordGetters = ExtendedWordGetters {}
- data ExtendedWordPutters = ExtendedWordPutters {
- extwordPutter8 :: Word8 -> Put
- extwordPutter16 :: Word16 -> Put
- extwordPutter32 :: Word32 -> Put
- extwordPutter64 :: Word64 -> Put
- extwordPutterN :: Word64 -> Put
- getExtendedWordGetters :: Endianness -> WordSize -> ExtendedWordGetters
- getExtendedWordPutters :: Endianness -> WordSize -> ExtendedWordPutters
- getHostEndianness :: IO Endianness
- hostEndianness :: Endianness
- class ByteReversable w where
- newtype AsBigEndian a = AsBigEndian a
- newtype AsLittleEndian a = AsLittleEndian a
Documentation
data Endianness Source #
Endianness
LittleEndian | Less significant bytes first |
BigEndian | Most significant bytes first |
data WordGetters Source #
Word getter
WordGetters | |
|
data WordPutters Source #
Word putters
WordPutters | |
|
getWordGetters :: Endianness -> WordGetters Source #
Get getters for the given endianness
getWordPutters :: Endianness -> WordPutters Source #
Get putters for the given endianness
Size of a machine word
WordSize32 | 32-bit |
WordSize64 | 64-bit |
data ExtendedWordGetters Source #
Extended word getters
ExtendedWordGetters | |
|
data ExtendedWordPutters Source #
Extended word putters
ExtendedWordPutters | |
|
getExtendedWordGetters :: Endianness -> WordSize -> ExtendedWordGetters Source #
Return extended getters
getExtendedWordPutters :: Endianness -> WordSize -> ExtendedWordPutters Source #
Return extended putters
getHostEndianness :: IO Endianness Source #
Detect the endianness of the host memory
hostEndianness :: Endianness Source #
Detected host endianness
class ByteReversable w where Source #
Reverse bytes in a word
reverseBytes :: w -> w Source #
hostToBigEndian :: w -> w Source #
bigEndianToHost :: w -> w Source #
hostToLittleEndian :: w -> w Source #
littleEndianToHost :: w -> w Source #
newtype AsBigEndian a Source #
Force a data to be read/stored as big-endian
Enum a => Enum (AsBigEndian a) Source # | |
Eq a => Eq (AsBigEndian a) Source # | |
Integral a => Integral (AsBigEndian a) Source # | |
Num a => Num (AsBigEndian a) Source # | |
Ord a => Ord (AsBigEndian a) Source # | |
Real a => Real (AsBigEndian a) Source # | |
Show a => Show (AsBigEndian a) Source # | |
(ByteReversable a, Storable a) => Storable (AsBigEndian a) Source # | |
(ByteReversable a, StaticStorable a) => StaticStorable (AsBigEndian a) Source # | |
type SizeOf (AsBigEndian a) Source # | |
type Alignment (AsBigEndian a) Source # | |
newtype AsLittleEndian a Source #
Force a data to be read/stored as little-endian
Enum a => Enum (AsLittleEndian a) Source # | |
Eq a => Eq (AsLittleEndian a) Source # | |
Integral a => Integral (AsLittleEndian a) Source # | |
Num a => Num (AsLittleEndian a) Source # | |
Ord a => Ord (AsLittleEndian a) Source # | |
Real a => Real (AsLittleEndian a) Source # | |
Show a => Show (AsLittleEndian a) Source # | |
(ByteReversable a, Storable a) => Storable (AsLittleEndian a) Source # | |
(ByteReversable a, StaticStorable a) => StaticStorable (AsLittleEndian a) Source # | |
type SizeOf (AsLittleEndian a) Source # | |
type Alignment (AsLittleEndian a) Source # | |