| Copyright | (c) Dong Han 2017-2019 | 
|---|---|
| License | BSD | 
| Maintainer | winterland1989@gmail.com | 
| Stability | experimental | 
| Portability | non-portable | 
| Safe Haskell | None | 
| Language | Haskell2010 | 
Std.Data.PrimArray.UnalignedAccess
Description
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 #
Constructors
| UnalignedSize | |
Fields  | |
Instances
| Eq (UnalignedSize a) Source # | |
Defined in Std.Data.PrimArray.UnalignedAccess Methods (==) :: UnalignedSize a -> UnalignedSize a -> Bool # (/=) :: UnalignedSize a -> UnalignedSize a -> Bool #  | |
| Show (UnalignedSize a) Source # | |
Defined in Std.Data.PrimArray.UnalignedAccess Methods 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
Methods
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