byte-order-0.1.0.0: Portable big-endian and little-endian conversions

Safe HaskellNone
LanguageHaskell2010

System.ByteOrder.Unsafe

Synopsis

Documentation

newtype Fixed :: ByteOrder -> Type -> Type where Source #

A word whose byte order is specified (not platform dependent) when working with Prim and Storable.

Constructors

Fixed 

Fields

Instances
(FixedOrdering b, Prim a, Bytes a) => Prim (Fixed b a) Source # 
Instance details

Defined in System.ByteOrder.Unsafe

Methods

sizeOf# :: Fixed b a -> Int# #

alignment# :: Fixed b a -> Int# #

indexByteArray# :: ByteArray# -> Int# -> Fixed b a #

readByteArray# :: MutableByteArray# s -> Int# -> State# s -> (#State# s, Fixed b a#) #

writeByteArray# :: MutableByteArray# s -> Int# -> Fixed b a -> State# s -> State# s #

setByteArray# :: MutableByteArray# s -> Int# -> Int# -> Fixed b a -> State# s -> State# s #

indexOffAddr# :: Addr# -> Int# -> Fixed b a #

readOffAddr# :: Addr# -> Int# -> State# s -> (#State# s, Fixed b a#) #

writeOffAddr# :: Addr# -> Int# -> Fixed b a -> State# s -> State# s #

setOffAddr# :: Addr# -> Int# -> Int# -> Fixed b a -> State# s -> State# s #

class FixedOrdering (b :: ByteOrder) where Source #

A byte order that can be interpreted as a conversion function. This class is effectively closed. The only instances are for BigEndian and LittleEndian. It is not possible to write more instances since there are no other inhabitants of ByteOrder.

Methods

toFixedEndian :: Bytes a => a -> a Source #

Instances
FixedOrdering LittleEndian Source # 
Instance details

Defined in System.ByteOrder.Unsafe

Methods

toFixedEndian :: Bytes a => a -> a Source #

FixedOrdering BigEndian Source # 
Instance details

Defined in System.ByteOrder.Unsafe

Methods

toFixedEndian :: Bytes a => a -> a Source #