Safe Haskell | None |
---|---|
Language | Haskell2010 |
Synopsis
- newtype Fixed :: ByteOrder -> Type -> Type where
- class FixedOrdering (b :: ByteOrder) where
- toFixedEndian :: Bytes a => a -> a
Documentation
newtype Fixed :: ByteOrder -> Type -> Type where Source #
A word whose byte order is specified (not platform dependent)
when working with Prim
and Storable
.
Instances
(FixedOrdering b, Prim a, Bytes a) => Prim (Fixed b a) Source # | |
Defined in System.ByteOrder.Unsafe 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
.
toFixedEndian :: Bytes a => a -> a Source #
Instances
FixedOrdering LittleEndian Source # | |
Defined in System.ByteOrder.Unsafe toFixedEndian :: Bytes a => a -> a Source # | |
FixedOrdering BigEndian Source # | |
Defined in System.ByteOrder.Unsafe toFixedEndian :: Bytes a => a -> a Source # |