haskus-binary-1.5: Haskus binary format manipulation

Safe HaskellNone
LanguageHaskell2010

Haskus.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

Instances
Eq WordSize Source # 
Instance details

Defined in Haskus.Binary.Endianness

Show WordSize Source # 
Instance details

Defined in Haskus.Binary.Endianness

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

TODO: use targetByteOrder in GHC.ByteOrder (should be introduced in GHC 8.4)

class ByteReversable w where Source #

Reverse bytes in a word

Minimal complete definition

reverseBytes

newtype AsBigEndian a Source #

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

Constructors

AsBigEndian a 
Instances
Enum a => Enum (AsBigEndian a) Source # 
Instance details

Defined in Haskus.Binary.Endianness

Eq a => Eq (AsBigEndian a) Source # 
Instance details

Defined in Haskus.Binary.Endianness

Integral a => Integral (AsBigEndian a) Source # 
Instance details

Defined in Haskus.Binary.Endianness

Num a => Num (AsBigEndian a) Source # 
Instance details

Defined in Haskus.Binary.Endianness

Ord a => Ord (AsBigEndian a) Source # 
Instance details

Defined in Haskus.Binary.Endianness

Real a => Real (AsBigEndian a) Source # 
Instance details

Defined in Haskus.Binary.Endianness

Show a => Show (AsBigEndian a) Source # 
Instance details

Defined in Haskus.Binary.Endianness

(ByteReversable a, Storable a) => Storable (AsBigEndian a) Source # 
Instance details

Defined in Haskus.Binary.Endianness

(ByteReversable a, StaticStorable a) => StaticStorable (AsBigEndian a) Source # 
Instance details

Defined in Haskus.Binary.Endianness

Associated Types

type SizeOf (AsBigEndian a) :: Nat Source #

type Alignment (AsBigEndian a) :: Nat Source #

ShiftableBits a => ShiftableBits (AsBigEndian a) Source # 
Instance details

Defined in Haskus.Binary.Endianness

FiniteBits a => FiniteBits (AsBigEndian a) Source # 
Instance details

Defined in Haskus.Binary.Endianness

Associated Types

type BitSize (AsBigEndian a) :: Nat Source #

Bitwise a => Bitwise (AsBigEndian a) Source # 
Instance details

Defined in Haskus.Binary.Endianness

RotatableBits a => RotatableBits (AsBigEndian a) Source # 
Instance details

Defined in Haskus.Binary.Endianness

IndexableBits a => IndexableBits (AsBigEndian a) Source # 
Instance details

Defined in Haskus.Binary.Endianness

ReversableBits a => ReversableBits (AsBigEndian a) Source # 
Instance details

Defined in Haskus.Binary.Endianness

Serializable a => Serializable (AsBigEndian a) Source # 
Instance details

Defined in Haskus.Binary.Serialize

Associated Types

type SizeOf (AsBigEndian a) :: Size Source #

type Endian (AsBigEndian a) :: Bool Source #

type SizeOf (AsBigEndian a) Source # 
Instance details

Defined in Haskus.Binary.Endianness

type Alignment (AsBigEndian a) Source # 
Instance details

Defined in Haskus.Binary.Endianness

type BitSize (AsBigEndian a) Source # 
Instance details

Defined in Haskus.Binary.Endianness

type SizeOf (AsBigEndian a) Source # 
Instance details

Defined in Haskus.Binary.Serialize

type Endian (AsBigEndian a) Source # 
Instance details

Defined in Haskus.Binary.Serialize

newtype AsLittleEndian a Source #

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

Constructors

AsLittleEndian a 
Instances
Enum a => Enum (AsLittleEndian a) Source # 
Instance details

Defined in Haskus.Binary.Endianness

Eq a => Eq (AsLittleEndian a) Source # 
Instance details

Defined in Haskus.Binary.Endianness

Integral a => Integral (AsLittleEndian a) Source # 
Instance details

Defined in Haskus.Binary.Endianness

Num a => Num (AsLittleEndian a) Source # 
Instance details

Defined in Haskus.Binary.Endianness

Ord a => Ord (AsLittleEndian a) Source # 
Instance details

Defined in Haskus.Binary.Endianness

Real a => Real (AsLittleEndian a) Source # 
Instance details

Defined in Haskus.Binary.Endianness

Show a => Show (AsLittleEndian a) Source # 
Instance details

Defined in Haskus.Binary.Endianness

(ByteReversable a, Storable a) => Storable (AsLittleEndian a) Source # 
Instance details

Defined in Haskus.Binary.Endianness

(ByteReversable a, StaticStorable a) => StaticStorable (AsLittleEndian a) Source # 
Instance details

Defined in Haskus.Binary.Endianness

Associated Types

type SizeOf (AsLittleEndian a) :: Nat Source #

type Alignment (AsLittleEndian a) :: Nat Source #

ShiftableBits a => ShiftableBits (AsLittleEndian a) Source # 
Instance details

Defined in Haskus.Binary.Endianness

FiniteBits a => FiniteBits (AsLittleEndian a) Source # 
Instance details

Defined in Haskus.Binary.Endianness

Associated Types

type BitSize (AsLittleEndian a) :: Nat Source #

Bitwise a => Bitwise (AsLittleEndian a) Source # 
Instance details

Defined in Haskus.Binary.Endianness

RotatableBits a => RotatableBits (AsLittleEndian a) Source # 
Instance details

Defined in Haskus.Binary.Endianness

IndexableBits a => IndexableBits (AsLittleEndian a) Source # 
Instance details

Defined in Haskus.Binary.Endianness

ReversableBits a => ReversableBits (AsLittleEndian a) Source # 
Instance details

Defined in Haskus.Binary.Endianness

Serializable a => Serializable (AsLittleEndian a) Source # 
Instance details

Defined in Haskus.Binary.Serialize

Associated Types

type SizeOf (AsLittleEndian a) :: Size Source #

type Endian (AsLittleEndian a) :: Bool Source #

type SizeOf (AsLittleEndian a) Source # 
Instance details

Defined in Haskus.Binary.Endianness

type Alignment (AsLittleEndian a) Source # 
Instance details

Defined in Haskus.Binary.Endianness

type BitSize (AsLittleEndian a) Source # 
Instance details

Defined in Haskus.Binary.Endianness

type SizeOf (AsLittleEndian a) Source # 
Instance details

Defined in Haskus.Binary.Serialize

type Endian (AsLittleEndian a) Source # 
Instance details

Defined in Haskus.Binary.Serialize