Copyright | (c) Dong Han 2017-2019 |
---|---|
License | BSD |
Maintainer | winterland1989@gmail.com |
Stability | experimental |
Portability | non-portable |
Safe Haskell | None |
Language | Haskell2010 |
This module implements unaligned element access with ghc primitives (> 8.6).
Synopsis
- newtype UnalignedSize a = UnalignedSize {}
- class UnalignedAccess a where
- unalignedSize :: UnalignedSize a
- writeWord8ArrayAs :: MutableByteArray# s -> Int# -> a -> State# s -> State# s
- readWord8ArrayAs :: MutableByteArray# s -> Int# -> State# s -> (#State# s, a#)
- indexWord8ArrayAs :: ByteArray# -> Int# -> a
- newtype LE a = LE {
- getLE :: a
- newtype BE a = BE {
- getBE :: a
Documentation
newtype UnalignedSize a Source #
Instances
Eq (UnalignedSize a) Source # | |
Defined in Std.Data.PrimArray.UnalignedAccess (==) :: UnalignedSize a -> UnalignedSize a -> Bool # (/=) :: UnalignedSize a -> UnalignedSize a -> Bool # | |
Show (UnalignedSize a) Source # | |
Defined in Std.Data.PrimArray.UnalignedAccess showsPrec :: Int -> UnalignedSize a -> ShowS # show :: UnalignedSize a -> String # showList :: [UnalignedSize a] -> ShowS # |
class UnalignedAccess a where Source #
Primitive types which can be unaligned accessed
unalignedSize :: UnalignedSize a Source #
writeWord8ArrayAs :: MutableByteArray# s -> Int# -> a -> State# s -> State# s Source #
readWord8ArrayAs :: MutableByteArray# s -> Int# -> State# s -> (#State# s, a#) Source #
indexWord8ArrayAs :: ByteArray# -> Int# -> a Source #
Instances
little endianess wrapper
Instances
big endianess wrapper