persistent-map-0.0.0: A thread-safe interface for finite map types with optional persistency support.
Source code
Contents
Index
Data.TMap.Backend
Portability
non-portable (requires STM)
Stability
experimental
Maintainer
Peter 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
where
Source
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
Instances
Backend
k a
NoBackend
(
Show
a,
Show
k) =>
Backend
k a
StdoutBackend
Produced by
Haddock
version 2.4.2