-- Hoogle documentation, generated by Haddock -- See Hoogle, http://www.haskell.org/hoogle/ -- | Initialization and Deinitialization of 'Storable' values. -- -- This package provides two typeclasses, Initialize and -- Deinitialize, which provide a common interface for initializing -- and deinitializing data backed by a Ptr. @package initialize @version 0.1.0.0 module Initialize -- | The class for initializing memory at a pointer representing -- Storable values. class Storable a => Initialize a -- | 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. initialize :: Initialize a => Ptr a -> IO () -- | Initialize the memory at an offset from the pointer. This has a -- default implementation but may be overriden for efficiency. initializeElemOff :: Initialize a => Ptr a -> Int -> IO () -- | Initialize a pointer representing an array with a given number of -- elements. This has a default implementation but may be overriden for -- efficiency. initializeElems :: Initialize a => Ptr a -> Int -> IO () -- | The class for freeing memory at a pointer representing Storable -- values. class Storable a => Deinitialize a -- | Free the memory at a pointer. deinitialize :: Deinitialize a => Ptr a -> IO () -- | Free the memory at an offset from the pointer. This has a default -- implementation but may be overriden for efficiency. deinitializeElemOff :: Deinitialize a => Ptr a -> Int -> IO () -- | Free any memory pointed to by elements of the array. This has a -- default implementation but may be overriden for efficiency. deinitializeElems :: Deinitialize a => Ptr a -> Int -> IO () -- | 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. newtype Uninitialized a Uninitialized :: a -> Uninitialized a instance Foreign.Storable.Storable a => Foreign.Storable.Storable (Initialize.Uninitialized a) instance GHC.Classes.Eq a => GHC.Classes.Eq (Initialize.Uninitialized a) instance Foreign.Storable.Storable a => Initialize.Initialize (Initialize.Uninitialized a) instance Foreign.Storable.Storable a => Initialize.Deinitialize (Initialize.Uninitialized a) instance Initialize.Initialize GHC.Types.Word instance Initialize.Initialize GHC.Word.Word8 instance Initialize.Initialize GHC.Word.Word16 instance Initialize.Initialize GHC.Word.Word32 instance Initialize.Initialize GHC.Word.Word64 instance Initialize.Initialize GHC.Types.Int instance Initialize.Initialize GHC.Int.Int8 instance Initialize.Initialize GHC.Int.Int16 instance Initialize.Initialize GHC.Int.Int32 instance Initialize.Initialize GHC.Int.Int64 instance Initialize.Initialize GHC.Types.Char