Safe Haskell | Safe-Inferred |
---|---|
Language | Haskell2010 |
Synopsis
- class PrimUnaligned a where
- indexUnalignedByteArray# :: ByteArray# -> Int# -> a
- readUnalignedByteArray# :: MutableByteArray# s -> Int# -> State# s -> (# State# s, a #)
- writeUnalignedByteArray# :: MutableByteArray# s -> Int# -> a -> State# s -> State# s
- indexUnalignedByteArray :: PrimUnaligned a => ByteArray -> Int -> a
- readUnalignedByteArray :: (PrimMonad m, PrimUnaligned a) => MutableByteArray (PrimState m) -> Int -> m a
- writeUnalignedByteArray :: (PrimMonad m, PrimUnaligned a) => MutableByteArray (PrimState m) -> Int -> a -> m ()
Class
class PrimUnaligned a where Source #
Class of types supporting primitive array operations that are not necessarily aligned. The offsets for all of the typeclass methods are interpreted as bytes, not elements.
indexUnalignedByteArray# :: ByteArray# -> Int# -> a Source #
readUnalignedByteArray# :: MutableByteArray# s -> Int# -> State# s -> (# State# s, a #) Source #
writeUnalignedByteArray# :: MutableByteArray# s -> Int# -> a -> State# s -> State# s Source #
Instances
Array access
indexUnalignedByteArray Source #
:: PrimUnaligned a | |
=> ByteArray | Immutable array |
-> Int | Offset in bytes |
-> a |
Read a primitive value from the byte array.
The offset is given in bytes rather than in elements
of type a
.
readUnalignedByteArray Source #
:: (PrimMonad m, PrimUnaligned a) | |
=> MutableByteArray (PrimState m) | Mutable array |
-> Int | Offset in bytes |
-> m a |
Read a primitive value from the byte array.
The offset is given in bytes rather than in elements
of type a
.
writeUnalignedByteArray Source #
:: (PrimMonad m, PrimUnaligned a) | |
=> MutableByteArray (PrimState m) | Mutable array |
-> Int | Offset in bytes |
-> a | Element |
-> m () |
Write a primitive value to the byte array.
The offset is given in bytes rather than in elements
of type a
.