flat-0.4.4.0.0.0.0.2: Principled and efficient bit-oriented binary serialization.
Safe Haskell None
Language Haskell2010

Flat.Memory

Description

Memory access primitives.

Includes code from the store-core package.

Synopsis

Documentation

data ByteArray Source #

Byte arrays.

Instances

Instances details
IsList ByteArray

Since: primitive-0.6.3.0

Instance details

Defined in Data.Primitive.ByteArray

Associated Types

type Item ByteArray Source #

Eq ByteArray

Since: primitive-0.6.3.0

Instance details

Defined in Data.Primitive.ByteArray

Data ByteArray
Instance details

Defined in Data.Primitive.ByteArray

Methods

gfoldl :: ( forall d b. Data d => c (d -> b) -> d -> c b) -> ( forall g. g -> c g) -> ByteArray -> c ByteArray Source #

gunfold :: ( forall b r. Data b => c (b -> r) -> c r) -> ( forall r. r -> c r) -> Constr -> c ByteArray Source #

toConstr :: ByteArray -> Constr Source #

dataTypeOf :: ByteArray -> DataType Source #

dataCast1 :: Typeable t => ( forall d. Data d => c (t d)) -> Maybe (c ByteArray ) Source #

dataCast2 :: Typeable t => ( forall d e. ( Data d, Data e) => c (t d e)) -> Maybe (c ByteArray ) Source #

gmapT :: ( forall b. Data b => b -> b) -> ByteArray -> ByteArray Source #

gmapQl :: (r -> r' -> r) -> r -> ( forall d. Data d => d -> r') -> ByteArray -> r Source #

gmapQr :: forall r r'. (r' -> r -> r) -> r -> ( forall d. Data d => d -> r') -> ByteArray -> r Source #

gmapQ :: ( forall d. Data d => d -> u) -> ByteArray -> [u] Source #

gmapQi :: Int -> ( forall d. Data d => d -> u) -> ByteArray -> u Source #

gmapM :: Monad m => ( forall d. Data d => d -> m d) -> ByteArray -> m ByteArray Source #

gmapMp :: MonadPlus m => ( forall d. Data d => d -> m d) -> ByteArray -> m ByteArray Source #

gmapMo :: MonadPlus m => ( forall d. Data d => d -> m d) -> ByteArray -> m ByteArray Source #

Ord ByteArray

Non-lexicographic ordering. This compares the lengths of the byte arrays first and uses a lexicographic ordering if the lengths are equal. Subject to change between major versions.

Since: primitive-0.6.3.0

Instance details

Defined in Data.Primitive.ByteArray

Show ByteArray

Behavior changed in 0.7.2.0. Before 0.7.2.0, this instance rendered 8-bit words less than 16 as a single hexadecimal digit (e.g. 13 was 0xD ). Starting with 0.7.2.0, all 8-bit words are represented as two digits (e.g. 13 is 0x0D ).

Since: primitive-0.6.3.0

Instance details

Defined in Data.Primitive.ByteArray

Semigroup ByteArray
Instance details

Defined in Data.Primitive.ByteArray

Monoid ByteArray
Instance details

Defined in Data.Primitive.ByteArray

NFData ByteArray
Instance details

Defined in Data.Primitive.ByteArray

Lift ByteArray

Respects array pinnedness for GHC >= 8.2

Instance details

Defined in Data.Primitive.ByteArray

type Item ByteArray
Instance details

Defined in Data.Primitive.ByteArray

pokeByteArray :: ByteArray# -> Int -> Int -> Ptr Word8 -> IO ( Ptr Word8 ) Source #

Create a new bytestring, copying from sourcePtr sourceLength number of bytes peekByteString :: Ptr Word8 -> Int -> BS.ByteString peekByteString sourcePtr sourceLength = BS.unsafeCreate sourceLength $ destPointer -> BS.memcpy destPointer sourcePtr sourceLength

pokeByteString :: ByteString -> Ptr Word8 -> IO ( Ptr Word8 ) Source #

Copy bytestring to given pointer, returns new pointer

minusPtr :: Ptr a -> Ptr b -> Int Source #

Computes the offset required to get from the second to the first argument. We have

p2 == p1 `plusPtr` (p2 `minusPtr` p1)