exp-cache-0.1.0.2

Safe HaskellSafe
LanguageHaskell2010

Data.Cache.Eviction.RR

Synopsis

Documentation

data RR k Source #

Random Replacement cache. The seed is fixed to an StdGen since its both easily accessible & good enough for this purpose. Random replacement means exactly what it sounds like: when the cache fills up a random element is selected and evicted.

Instances
EvictionStrategy RR Source # 
Instance details

Defined in Data.Cache.Eviction.RR

Methods

recordLookup :: (Eq k, Hashable k, Ord k) => k -> RR k -> RR k Source #

evict :: (Eq k, Hashable k, Ord k) => RR k -> (RR k, Maybe k) Source #

Eq k => Eq (RR k) Source # 
Instance details

Defined in Data.Cache.Eviction.RR

Methods

(==) :: RR k -> RR k -> Bool #

(/=) :: RR k -> RR k -> Bool #

Show k => Show (RR k) Source # 
Instance details

Defined in Data.Cache.Eviction.RR

Methods

showsPrec :: Int -> RR k -> ShowS #

show :: RR k -> String #

showList :: [RR k] -> ShowS #

newRR :: StdGen -> Int -> RR k Source #

Generate a new Random Replacement cache using the provided seed & size.