Idris2Doc : Data.LRUCache

Data.LRUCache

(source)
Least Recently Used (LRU) Cache

Reexports

import public Data.HashPSQ
import public Data.LRUCache.Internal

Definitions

empty : Nat -> LRUCache k v
  Create an empty LRUCache of the given size.

Totality: total
Visibility: export
insert : Hashable k => Ord k => k -> v -> LRUCache k v -> LRUCache k v
  Insert an element into the LRUCache.

Totality: total
Visibility: export
insertView : Hashable k => Ord k => k -> v -> LRUCache k v -> (Maybe (k, v), LRUCache k v)
  Insert an element into the LRUCache returning the evicted element if any.
When the logical clock reaches its maximum value and all values are
evicted Nothing is returned.

Totality: total
Visibility: export
lookup : Hashable k => Ord k => k -> LRUCache k v -> Maybe (v, LRUCache k v)
  Lookup an element in an LRUCache and mark it as the least recently accessed.

Totality: total
Visibility: export