Copyright | (c) Roman Leshchinskiy 2009-2012 |
---|---|
License | BSD-style |
Maintainer | Roman Leshchinskiy <rl@cse.unsw.edu.au> |
Portability | non-portable |
Safe Haskell | None |
Language | Haskell2010 |
Basic types and classes for primitive array operations
Synopsis
- class Prim a where
- sizeOf# :: a -> Int#
- alignment# :: a -> Int#
- indexByteArray# :: ByteArray# -> Int# -> a
- readByteArray# :: MutableByteArray# s -> Int# -> State# s -> (#State# s, a#)
- writeByteArray# :: MutableByteArray# s -> Int# -> a -> State# s -> State# s
- setByteArray# :: MutableByteArray# s -> Int# -> Int# -> a -> State# s -> State# s
- indexOffAddr# :: Addr# -> Int# -> a
- readOffAddr# :: Addr# -> Int# -> State# s -> (#State# s, a#)
- writeOffAddr# :: Addr# -> Int# -> a -> State# s -> State# s
- setOffAddr# :: Addr# -> Int# -> Int# -> a -> State# s -> State# s
- data Addr = Addr Addr#
Documentation
Class of types supporting primitive array operations
Size of values of type a
. The argument is not used.
alignment# :: a -> Int# Source #
Alignment of values of type a
. The argument is not used.
indexByteArray# :: ByteArray# -> Int# -> a Source #
Read a value from the array. The offset is in elements of type
a
rather than in bytes.
readByteArray# :: MutableByteArray# s -> Int# -> State# s -> (#State# s, a#) Source #
Read a value from the mutable array. The offset is in elements of type
a
rather than in bytes.
writeByteArray# :: MutableByteArray# s -> Int# -> a -> State# s -> State# s Source #
Write a value to the mutable array. The offset is in elements of type
a
rather than in bytes.
setByteArray# :: MutableByteArray# s -> Int# -> Int# -> a -> State# s -> State# s Source #
Fill a slice of the mutable array with a value. The offset and length
of the chunk are in elements of type a
rather than in bytes.
indexOffAddr# :: Addr# -> Int# -> a Source #
Read a value from a memory position given by an address and an offset.
The memory block the address refers to must be immutable. The offset is in
elements of type a
rather than in bytes.
readOffAddr# :: Addr# -> Int# -> State# s -> (#State# s, a#) Source #
Read a value from a memory position given by an address and an offset.
The offset is in elements of type a
rather than in bytes.
writeOffAddr# :: Addr# -> Int# -> a -> State# s -> State# s Source #
Write a value to a memory position given by an address and an offset.
The offset is in elements of type a
rather than in bytes.
setOffAddr# :: Addr# -> Int# -> Int# -> a -> State# s -> State# s Source #
Fill a memory block given by an address, an offset and a length.
The offset and length are in elements of type a
rather than in bytes.
Instances
A machine address
Instances
Eq Addr Source # | |
Data Addr Source # | |
Defined in Data.Primitive.Types gfoldl :: (forall d b. Data d => c (d -> b) -> d -> c b) -> (forall g. g -> c g) -> Addr -> c Addr # gunfold :: (forall b r. Data b => c (b -> r) -> c r) -> (forall r. r -> c r) -> Constr -> c Addr # dataTypeOf :: Addr -> DataType # dataCast1 :: Typeable t => (forall d. Data d => c (t d)) -> Maybe (c Addr) # dataCast2 :: Typeable t => (forall d e. (Data d, Data e) => c (t d e)) -> Maybe (c Addr) # gmapT :: (forall b. Data b => b -> b) -> Addr -> Addr # gmapQl :: (r -> r' -> r) -> r -> (forall d. Data d => d -> r') -> Addr -> r # gmapQr :: (r' -> r -> r) -> r -> (forall d. Data d => d -> r') -> Addr -> r # gmapQ :: (forall d. Data d => d -> u) -> Addr -> [u] # gmapQi :: Int -> (forall d. Data d => d -> u) -> Addr -> u # gmapM :: Monad m => (forall d. Data d => d -> m d) -> Addr -> m Addr # gmapMp :: MonadPlus m => (forall d. Data d => d -> m d) -> Addr -> m Addr # gmapMo :: MonadPlus m => (forall d. Data d => d -> m d) -> Addr -> m Addr # | |
Ord Addr Source # | |
Prim Addr Source # | |
Defined in Data.Primitive.Types sizeOf# :: Addr -> Int# Source # alignment# :: Addr -> Int# Source # indexByteArray# :: ByteArray# -> Int# -> Addr Source # readByteArray# :: MutableByteArray# s -> Int# -> State# s -> (#State# s, Addr#) Source # writeByteArray# :: MutableByteArray# s -> Int# -> Addr -> State# s -> State# s Source # setByteArray# :: MutableByteArray# s -> Int# -> Int# -> Addr -> State# s -> State# s Source # indexOffAddr# :: Addr# -> Int# -> Addr Source # readOffAddr# :: Addr# -> Int# -> State# s -> (#State# s, Addr#) Source # writeOffAddr# :: Addr# -> Int# -> Addr -> State# s -> State# s Source # setOffAddr# :: Addr# -> Int# -> Int# -> Addr -> State# s -> State# s Source # |