exp-cache-0.1.0.2

Safe HaskellNone
LanguageHaskell2010

Data.Cache.Eviction.LRU

Synopsis

Documentation

data SeqLRU k Source #

This is a naive and terribly slow version of an LRU cache

Instances
EvictionStrategy SeqLRU Source # 
Instance details

Defined in Data.Cache.Eviction.LRU

Methods

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

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

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

Defined in Data.Cache.Eviction.LRU

Methods

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

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

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

Defined in Data.Cache.Eviction.LRU

Methods

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

show :: SeqLRU k -> String #

showList :: [SeqLRU k] -> ShowS #

data LRU k Source #

An optimized version of an LRU cache. The least recently used element in the cache is evicted once the cache fills up.

Instances
EvictionStrategy LRU Source # 
Instance details

Defined in Data.Cache.Eviction.LRU

Methods

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

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

(Hashable k, Ord k) => Eq (LRU k) Source # 
Instance details

Defined in Data.Cache.Eviction.LRU

Methods

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

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

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

Defined in Data.Cache.Eviction.LRU

Methods

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

show :: LRU k -> String #

showList :: [LRU k] -> ShowS #