Safe Haskell | Safe |
---|---|
Language | Haskell98 |
- type LookupTable k v = MVar (Map k v)
- newLookupTable :: (Ord k, MonadIO m) => m (LookupTable k v)
- lookupTable :: (Ord k, MonadIO m) => k -> v -> LookupTable k v -> m v
- lookupTableM :: (Ord k, MonadIO m) => k -> m v -> LookupTable k v -> m v
- cacheInTableM :: (Ord k, MonadIO m) => LookupTable k v -> k -> m v -> m v
- hasLookupTable :: (Ord k, MonadIO m) => k -> LookupTable k v -> m (Maybe v)
- cachedInTable :: (Ord k, MonadIO m) => LookupTable k v -> (k -> m v) -> k -> m v
- insertTable :: (Ord k, MonadIO m) => k -> v -> LookupTable k v -> m v
- insertTableM :: (Ord k, MonadIO m) => k -> m v -> LookupTable k v -> m v
- storeInTable :: (Ord k, MonadIO m) => LookupTable k v -> k -> v -> m v
- storeInTableM :: (Ord k, MonadIO m) => LookupTable k v -> k -> m v -> m v
Documentation
type LookupTable k v = MVar (Map k v) Source #
k-v table
newLookupTable :: (Ord k, MonadIO m) => m (LookupTable k v) Source #
lookupTable :: (Ord k, MonadIO m) => k -> v -> LookupTable k v -> m v Source #
Lookup, or insert if not exists
lookupTableM :: (Ord k, MonadIO m) => k -> m v -> LookupTable k v -> m v Source #
Lookup, or insert if not exists
cacheInTableM :: (Ord k, MonadIO m) => LookupTable k v -> k -> m v -> m v Source #
lookupTableM
with swapped args
hasLookupTable :: (Ord k, MonadIO m) => k -> LookupTable k v -> m (Maybe v) Source #
Just check existable
cachedInTable :: (Ord k, MonadIO m) => LookupTable k v -> (k -> m v) -> k -> m v Source #
Make function caching results in LookupTable
insertTable :: (Ord k, MonadIO m) => k -> v -> LookupTable k v -> m v Source #
Insert value into table and return it
insertTableM :: (Ord k, MonadIO m) => k -> m v -> LookupTable k v -> m v Source #
Insert value into table and return it
storeInTable :: (Ord k, MonadIO m) => LookupTable k v -> k -> v -> m v Source #
insertTable
with flipped args
storeInTableM :: (Ord k, MonadIO m) => LookupTable k v -> k -> m v -> m v Source #
insertTable
with flipped args