lrucaching-haxl-0.1.0.0: Combine lrucaching and haxl.

Safe HaskellNone
LanguageHaskell2010

Data.LruCache.Haxl

Synopsis

Documentation

newtype LruHandle k v #

Store a LRU cache in an 'IORef to be able to conveniently update it.

Constructors

LruHandle (IORef (LruCache k v)) 

newLruHandle :: Int -> IO (LruHandle k v) #

Create a new LRU cache of the given size.

cached' :: (Hashable k, Ord k) => (u -> Maybe (LruHandle k v)) -> k -> GenHaxl u w v -> GenHaxl u w v Source #

cached :: (Hashable k, Ord k) => (u -> Maybe (LruHandle k v)) -> k -> GenHaxl u w (Maybe v) -> GenHaxl u w (Maybe v) Source #

Return the cached result of the action or, in the case of a cache miss, execute the action and insert it in the cache.

remove :: (Hashable k, Ord k) => (u -> Maybe (LruHandle k v)) -> k -> GenHaxl u w () Source #

updateLruHandle :: (Hashable k, Ord k) => LruHandle k v -> Int -> IO () Source #