hsdev-0.3.1.0: Haskell development library

Safe HaskellSafe
LanguageHaskell98

Data.LookupTable

Synopsis

Documentation

type LookupTable k v = MVar (Map k v) Source #

k-v table

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