primitive-0.6.3.0: Primitive memory-related operations

Copyright(c) Roman Leshchinskiy 2009-2012
LicenseBSD-style
MaintainerRoman Leshchinskiy <rl@cse.unsw.edu.au>
Portabilitynon-portable
Safe HaskellNone
LanguageHaskell2010

Data.Primitive.Types

Description

Basic types and classes for primitive array operations

Synopsis

Documentation

class Prim a where Source #

Class of types supporting primitive array operations

Methods

sizeOf# :: a -> Int# Source #

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
Prim Char Source # 
Instance details

Defined in Data.Primitive.Types

Prim Double Source # 
Instance details

Defined in Data.Primitive.Types

Prim Float Source # 
Instance details

Defined in Data.Primitive.Types

Prim Int Source # 
Instance details

Defined in Data.Primitive.Types

Prim Int8 Source # 
Instance details

Defined in Data.Primitive.Types

Prim Int16 Source # 
Instance details

Defined in Data.Primitive.Types

Prim Int32 Source # 
Instance details

Defined in Data.Primitive.Types

Prim Int64 Source # 
Instance details

Defined in Data.Primitive.Types

Prim Word Source # 
Instance details

Defined in Data.Primitive.Types

Prim Word8 Source # 
Instance details

Defined in Data.Primitive.Types

Prim Word16 Source # 
Instance details

Defined in Data.Primitive.Types

Prim Word32 Source # 
Instance details

Defined in Data.Primitive.Types

Prim Word64 Source # 
Instance details

Defined in Data.Primitive.Types

Prim Addr Source # 
Instance details

Defined in Data.Primitive.Types

Prim (Ptr a) Source # 
Instance details

Defined in Data.Primitive.Types

Prim (FunPtr a) Source # 
Instance details

Defined in Data.Primitive.Types

sizeOf :: Prim a => a -> Int Source #

Size of values of type a. The argument is not used.

alignment :: Prim a => a -> Int Source #

Alignment of values of type a. The argument is not used.

data Addr Source #

A machine address

Constructors

Addr Addr# 
Instances
Eq Addr Source # 
Instance details

Defined in Data.Primitive.Types

Methods

(==) :: Addr -> Addr -> Bool Source #

(/=) :: Addr -> Addr -> Bool Source #

Data Addr Source # 
Instance details

Defined in Data.Primitive.Types

Methods

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

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

toConstr :: Addr -> Constr Source #

dataTypeOf :: Addr -> DataType Source #

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

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

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

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

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

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

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

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

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

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

Ord Addr Source # 
Instance details

Defined in Data.Primitive.Types

Prim Addr Source # 
Instance details

Defined in Data.Primitive.Types