Safe Haskell | None |
---|---|
Language | GHC2021 |
Raehik.Compat.Data.Primitive.Types.Endian
Description
I think this should be in primitive.
Synopsis
- class ByteSwap a where
- byteSwap :: a -> a
- newtype ByteOrdered (end :: ByteOrder) a = ByteOrdered {
- unByteOrdered :: a
- newtype PrimByteSwapped a = PrimByteSwapped {
- unPrimByteSwapped :: a
Documentation
class ByteSwap a where Source #
Boxed types which permit reversing byte order ("byte swapping").
newtype ByteOrdered (end :: ByteOrder) a Source #
Constructors
ByteOrdered | |
Fields
|
Instances
newtype PrimByteSwapped a Source #
Newtype for easier instance derivation.
Constructors
PrimByteSwapped | |
Fields
|
Instances
(Prim' a, ByteSwap a) => Prim' (PrimByteSwapped a) Source # | |||||
Defined in Raehik.Compat.Data.Primitive.Types.Endian Associated Types
Methods indexWord8ByteArrayAs# :: ByteArray# -> Int# -> PrimByteSwapped a Source # readWord8ByteArrayAs# :: MutableByteArray# s -> Int# -> State# s -> (# State# s, PrimByteSwapped a #) Source # writeWord8ByteArrayAs# :: MutableByteArray# s -> Int# -> PrimByteSwapped a -> State# s -> State# s Source # indexWord8OffAddrAs# :: Addr# -> Int# -> PrimByteSwapped a Source # readWord8OffAddrAs# :: Addr# -> Int# -> State# s -> (# State# s, PrimByteSwapped a #) Source # writeWord8OffAddrAs# :: Addr# -> Int# -> PrimByteSwapped a -> State# s -> State# s Source # | |||||
(Prim a, ByteSwap a) => Prim (PrimByteSwapped a) Source # | Prim instance where we byte swap at accesses. | ||||
Defined in Raehik.Compat.Data.Primitive.Types.Endian Methods sizeOf# :: PrimByteSwapped a -> Int# # alignment# :: PrimByteSwapped a -> Int# # indexByteArray# :: ByteArray# -> Int# -> PrimByteSwapped a # readByteArray# :: MutableByteArray# s -> Int# -> State# s -> (# State# s, PrimByteSwapped a #) # writeByteArray# :: MutableByteArray# s -> Int# -> PrimByteSwapped a -> State# s -> State# s # setByteArray# :: MutableByteArray# s -> Int# -> Int# -> PrimByteSwapped a -> State# s -> State# s # indexOffAddr# :: Addr# -> Int# -> PrimByteSwapped a # readOffAddr# :: Addr# -> Int# -> State# s -> (# State# s, PrimByteSwapped a #) # writeOffAddr# :: Addr# -> Int# -> PrimByteSwapped a -> State# s -> State# s # setOffAddr# :: Addr# -> Int# -> Int# -> PrimByteSwapped a -> State# s -> State# s # | |||||
type SizeOf (PrimByteSwapped a) Source # | |||||
Defined in Raehik.Compat.Data.Primitive.Types.Endian |