persistent-map-0.0.0: A thread-safe interface for finite map types with optional persistency support.Source codeContentsIndex
Data.TMap.Backend
Portabilitynon-portable (requires STM)
Stabilityexperimental
MaintainerPeter Robinson <thaldyron@gmail.com>
Description
Provides a type class for backend instantiations. To avoid data inconsistencies, these functions should not be used directly but only by means of the TMap interface.
Synopsis
class Backend k a b | a -> k where
insert :: MonadIO m => b k a -> k -> a -> m ()
adjust :: MonadIO m => b k a -> (a -> a) -> k -> m ()
delete :: MonadIO m => b k a -> k -> m ()
lookup :: MonadIO m => b k a -> k -> m (Maybe a)
flush :: MonadIO m => b k a -> m ()
initialize :: MonadIO m => b k a -> m ()
Documentation
class Backend k a b | a -> k whereSource
This class needs to be instantiated when developing a new backend. The backend is expected to be able to handle concurrent (non-conflicting) requests.
Methods
insert :: MonadIO m => b k a -> k -> a -> m ()Source
Called when a new element was inserted.
adjust :: MonadIO m => b k a -> (a -> a) -> k -> m ()Source
Called when an element was updated.
delete :: MonadIO m => b k a -> k -> m ()Source
Called when an element was deleted from the map.
lookup :: MonadIO m => b k a -> k -> m (Maybe a)Source
Called when an element is not found in the map.
flush :: MonadIO m => b k a -> m ()Source
Called by flushBackend and purgeTMap.
initialize :: MonadIO m => b k a -> m ()Source
Called in newTMapIO
show/hide Instances
Produced by Haddock version 2.4.2