Copyright | (c) Moritz Kiefer 2016 (c) Jasper Van der Jeugt 2015 |
---|---|
License | BSD3 |
Maintainer | moritz.kiefer@purelyfunctional.org |
Safe Haskell | None |
Language | Haskell2010 |
Pure API to an LRU cache.
- data LruCache k v
- type Priority = Int64
- empty :: Int -> LruCache k v
- insert :: (Hashable k, Ord k) => k -> v -> LruCache k v -> LruCache k v
- insertView :: (Hashable k, Ord k) => k -> v -> LruCache k v -> (Maybe (k, v), LruCache k v)
- lookup :: (Hashable k, Ord k) => k -> LruCache k v -> Maybe (v, LruCache k v)