regional-pointers-0.1.0.2: Regional memory pointers

MaintainerBas van Dijk <v.dijk.bas@gmail.com>

Foreign.Marshal.Utils.Region

Contents

Description

 

Synopsis

General marshalling utilities

Combined allocation and marshalling

with :: (Storable α, MonadCatchIO pr) => α -> (forall s. RegionalPtr α (RegionT s pr) -> RegionT s pr β) -> pr βSource

new :: (Storable α, MonadCatchIO pr) => α -> RegionT s pr (RegionalPtr α (RegionT s pr))Source

Marshalling of Boolean values (non-zero corresponds to True)

fromBool :: Num a => Bool -> a

Convert a Haskell Bool to its numeric representation

toBool :: Num a => a -> Bool

Convert a Boolean in numeric representation to a Haskell value

Marshalling of Maybe values

TODO: Define and export: maybeNew, maybeWith and maybePeek.

Marshalling lists of storable objects

TODO: Define and export: withMany.

Haskellish interface to memcpy and memmove

(argument order: destination, source)

copyBytesSource

Arguments

:: (ParentOf pr1 cr, ParentOf pr2 cr, MonadIO cr) 
=> RegionalPtr α pr1

Destination

-> RegionalPtr α pr2

Source

-> Int 
-> cr () 

moveBytesSource

Arguments

:: (ParentOf pr1 cr, ParentOf pr2 cr, MonadIO cr) 
=> RegionalPtr α pr1

Destination

-> RegionalPtr α pr2

Source

-> Int 
-> cr ()