haskus-system-0.6.0.0: Haskus system programming framework

Safe HaskellNone
LanguageHaskell2010

Haskus.Format.Binary.Endianness

Description

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.

Synopsis

Documentation

data WordGetters Source #

Word getter

Constructors

WordGetters 

Fields

data WordPutters Source #

Word putters

Constructors

WordPutters 

Fields

getWordGetters :: Endianness -> WordGetters Source #

Get getters for the given endianness

getWordPutters :: Endianness -> WordPutters Source #

Get putters for the given endianness

data WordSize Source #

Size of a machine word

Constructors

WordSize32

32-bit

WordSize64

64-bit

data ExtendedWordGetters Source #

Extended word getters

Constructors

ExtendedWordGetters 

Fields

data ExtendedWordPutters Source #

Extended word putters

Constructors

ExtendedWordPutters 

Fields

getHostEndianness :: IO Endianness Source #

Detect the endianness of the host memory

hostEndianness :: Endianness Source #

Detected host endianness

newtype AsBigEndian a Source #

Force a data to be read/stored as big-endian

Constructors

AsBigEndian a 

Instances

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 # 

Associated Types

type SizeOf (AsBigEndian a) :: Nat Source #

type Alignment (AsBigEndian a) :: Nat 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

Constructors

AsLittleEndian a 

Instances

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 #