Safe Haskell | None |
---|---|
Language | Haskell2010 |
Synopsis
- data BTree k v
- class Storable a => Initialize a where
- initialize :: Ptr a -> IO ()
- initializeElemOff :: Ptr a -> Int -> IO ()
- initializeElems :: Ptr a -> Int -> IO ()
- class Storable a => Deinitialize a where
- deinitialize :: Ptr a -> IO ()
- deinitializeElemOff :: Ptr a -> Int -> IO ()
- deinitializeElems :: Ptr a -> Int -> IO ()
- data Decision
- new :: forall k v. (Storable k, Storable v) => IO (BTree k v)
- free :: forall k v. (Storable k, Deinitialize v) => BTree k v -> IO ()
- with :: (Storable k, Initialize v, Deinitialize v) => (BTree k v -> IO (a, BTree k v)) -> IO a
- with_ :: (Storable k, Initialize v, Deinitialize v) => (BTree k v -> IO (BTree k v)) -> IO ()
- lookup :: forall k v. (Ord k, Storable k, Storable v) => BTree k v -> k -> IO (Maybe v)
- insert :: (Ord k, Storable k, Initialize v) => BTree k v -> k -> v -> IO (BTree k v)
- modifyWithM_ :: forall k v. (Ord k, Storable k, Initialize v) => BTree k v -> k -> (v -> IO v) -> IO (BTree k v)
- modifyWithM :: forall k v a. (Ord k, Storable k, Initialize v) => BTree k v -> k -> (v -> IO (a, v)) -> IO (a, BTree k v)
- modifyWithPtr :: forall k v r. (Ord k, Storable k, Initialize v) => BTree k v -> k -> Either r (Ptr v -> Int -> IO r) -> (Ptr v -> Int -> IO (r, Decision)) -> IO (r, BTree k v)
- foldrWithKey :: forall k v b. (Ord k, Storable k, Storable v) => (k -> v -> b -> IO b) -> b -> BTree k v -> IO b
- toAscList :: forall k v. (Ord k, Storable k, Storable v) => BTree k v -> IO [(k, v)]
- index :: forall k v. (Storable k, Storable v) => BTree k v -> (Int -> Int) -> Int -> IO v
- indexNode :: forall k v. (Storable k, Storable v) => BTree k v -> (Int -> Int) -> Int -> IO (Ptr v, Int)
- inlineModifyWithPtr :: forall k v r. (Ord k, Storable k, Initialize v) => BTree k v -> k -> Either r (Ptr v -> Int -> IO r) -> (Ptr v -> Int -> IO (r, Decision)) -> IO (r, BTree k v)
- inlineModifyWithM :: forall k v a. (Ord k, Storable k, Initialize v) => BTree k v -> k -> (v -> IO (a, v)) -> IO (a, BTree k v)
Documentation
Instances
Storable (BTree k v) Source # | |
Defined in BTree.Store | |
Initialize (BTree k v) Source # | |
Defined in BTree.Store | |
(Storable k, Deinitialize v) => Deinitialize (BTree k v) Source # | |
Defined in BTree.Store |
class Storable a => Initialize a where #
The class for initializing memory at a pointer
representing Storable
values.
initialize :: Ptr a -> IO () #
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 () #
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 () #
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 | |
Defined in Initialize | |
Initialize Int | |
Defined in Initialize | |
Initialize Int8 | |
Defined in Initialize | |
Initialize Int16 | |
Defined in Initialize | |
Initialize Int32 | |
Defined in Initialize | |
Initialize Int64 | |
Defined in Initialize | |
Initialize Word | |
Defined in Initialize | |
Initialize Word8 | |
Defined in Initialize | |
Initialize Word16 | |
Defined in Initialize | |
Initialize Word32 | |
Defined in Initialize | |
Initialize Word64 | |
Defined in Initialize | |
Storable a => Initialize (Uninitialized a) | |
Defined in Initialize initialize :: Ptr (Uninitialized a) -> IO () # initializeElemOff :: Ptr (Uninitialized a) -> Int -> IO () # initializeElems :: Ptr (Uninitialized a) -> Int -> IO () # | |
Initialize (BTree k v) Source # | |
Defined in BTree.Store |
class Storable a => Deinitialize a where #
The class for freeing memory at a pointer
representing Storable
values.
deinitialize :: Ptr a -> IO () #
Free the memory at a pointer.
deinitializeElemOff :: Ptr a -> Int -> IO () #
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 () #
Free any memory pointed to by elements of the array. This has a default implementation but may be overriden for efficiency.
Instances
Deinitialize Char | |
Defined in Initialize | |
Deinitialize Int | |
Defined in Initialize | |
Deinitialize Int8 | |
Defined in Initialize | |
Deinitialize Int16 | |
Defined in Initialize | |
Deinitialize Int32 | |
Defined in Initialize | |
Deinitialize Int64 | |
Defined in Initialize | |
Deinitialize Word | |
Defined in Initialize | |
Deinitialize Word8 | |
Defined in Initialize | |
Deinitialize Word16 | |
Defined in Initialize | |
Deinitialize Word32 | |
Defined in Initialize | |
Deinitialize Word64 | |
Defined in Initialize | |
Storable a => Deinitialize (Uninitialized a) | |
Defined in Initialize deinitialize :: Ptr (Uninitialized a) -> IO () # deinitializeElemOff :: Ptr (Uninitialized a) -> Int -> IO () # deinitializeElems :: Ptr (Uninitialized a) -> Int -> IO () # | |
(Storable k, Deinitialize v) => Deinitialize (BTree k v) Source # | |
Defined in BTree.Store |
free :: forall k v. (Storable k, Deinitialize v) => BTree k v -> IO () Source #
Release all memory allocated by the b-tree. Do not attempt to use the b-tree after calling this.
with :: (Storable k, Initialize v, Deinitialize v) => (BTree k v -> IO (a, BTree k v)) -> IO a Source #
with_ :: (Storable k, Initialize v, Deinitialize v) => (BTree k v -> IO (BTree k v)) -> IO () Source #
foldrWithKey :: forall k v b. (Ord k, Storable k, Storable v) => (k -> v -> b -> IO b) -> b -> BTree k v -> IO b Source #
toAscList :: forall k v. (Ord k, Storable k, Storable v) => BTree k v -> IO [(k, v)] Source #
This is provided for convenience but is not something typically useful in production code.
Weird Operations
indexNode :: forall k v. (Storable k, Storable v) => BTree k v -> (Int -> Int) -> Int -> IO (Ptr v, Int) Source #