initialize-0.1.1.0: Initialization and Deinitialization of 'Storable' values.

Safe HaskellNone
LanguageHaskell2010

Initialize

Synopsis

Documentation

class Storable a => Initialize a where Source #

The class for initializing memory at a pointer representing Storable values.

Minimal complete definition

initialize

Methods

initialize :: Ptr a -> IO () Source #

Initialize the memory at a pointer. An implementation of this function may do nothing, or if the data contains more pointers, initialize may allocate additional memory.

initializeElemOff :: Ptr a -> Int -> IO () Source #

Initialize the memory at an offset from the pointer. This has a default implementation but may be overriden for efficiency.

initializeElems :: Ptr a -> Int -> IO () Source #

Initialize a pointer representing an array with a given number of elements. This has a default implementation but may be overriden for efficiency.

Instances
Initialize Char Source # 
Instance details

Defined in Initialize

Initialize Int Source # 
Instance details

Defined in Initialize

Initialize Int8 Source # 
Instance details

Defined in Initialize

Initialize Int16 Source # 
Instance details

Defined in Initialize

Initialize Int32 Source # 
Instance details

Defined in Initialize

Initialize Int64 Source # 
Instance details

Defined in Initialize

Initialize Word Source # 
Instance details

Defined in Initialize

Initialize Word8 Source # 
Instance details

Defined in Initialize

Initialize Word16 Source # 
Instance details

Defined in Initialize

Initialize Word32 Source # 
Instance details

Defined in Initialize

Initialize Word64 Source # 
Instance details

Defined in Initialize

Storable a => Initialize (Uninitialized a) Source # 
Instance details

Defined in Initialize

class Storable a => Deinitialize a where Source #

The class for freeing memory at a pointer representing Storable values.

Minimal complete definition

deinitialize

Methods

deinitialize :: Ptr a -> IO () Source #

Free the memory at a pointer.

deinitializeElemOff :: Ptr a -> Int -> IO () Source #

Free the memory at an offset from the pointer. This has a default implementation but may be overriden for efficiency.

deinitializeElems :: Ptr a -> Int -> IO () Source #

Free any memory pointed to by elements of the array. This has a default implementation but may be overriden for efficiency.

Instances
Deinitialize Char Source # 
Instance details

Defined in Initialize

Deinitialize Int Source # 
Instance details

Defined in Initialize

Deinitialize Int8 Source # 
Instance details

Defined in Initialize

Deinitialize Int16 Source # 
Instance details

Defined in Initialize

Deinitialize Int32 Source # 
Instance details

Defined in Initialize

Deinitialize Int64 Source # 
Instance details

Defined in Initialize

Deinitialize Word Source # 
Instance details

Defined in Initialize

Deinitialize Word8 Source # 
Instance details

Defined in Initialize

Deinitialize Word16 Source # 
Instance details

Defined in Initialize

Deinitialize Word32 Source # 
Instance details

Defined in Initialize

Deinitialize Word64 Source # 
Instance details

Defined in Initialize

Storable a => Deinitialize (Uninitialized a) Source # 
Instance details

Defined in Initialize

newtype Uninitialized a Source #

A type which shares a representation with a, but for which all underlying memory remains uninitialized - i.e., all typeclass methods of Initialize and Deinitialize do nothing.

Constructors

Uninitialized a 
Instances
Eq a => Eq (Uninitialized a) Source # 
Instance details

Defined in Initialize

Storable a => Storable (Uninitialized a) Source # 
Instance details

Defined in Initialize

Storable a => Deinitialize (Uninitialized a) Source # 
Instance details

Defined in Initialize

Storable a => Initialize (Uninitialized a) Source # 
Instance details

Defined in Initialize