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
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