Idris2Doc : Data.LRUCache1

Data.LRUCache1

(source)
Linear Least Recently Used (LRU) Cache

Reexports

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

Definitions

empty : Nat -> F1 s (LRUCache1 s k v)
  Create an empty LRUCache1 of the given size.

Totality: total
Visibility: export
insert : Hashable k => Ord k => k -> v -> LRUCache1 s k v -> F1 s (LRUCache1 s k v)
  Insert an element into the LRUCache1.

Totality: total
Visibility: export
insertView : Hashable k => Ord k => k -> v -> LRUCache1 s k v -> F1 s (Maybe (k, v), LRUCache1 s k v)
  Insert an element into the LRUCache1 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 -> LRUCache1 s k v -> F1 s (Maybe (v, LRUCache1 s k v))
  Lookup an element in an LRUCache1 and mark it as the least recently accessed.

Totality: total
Visibility: export
toList : Hashable k => Ord k => LRUCache1 s k v -> F1 s (List (k, v))
  Convert an LRUCache1 to a list of (key, value) pairs.

Totality: total
Visibility: export