hsdev-0.3.1.3: 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

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