HORIZON HASKELLDocslts/ghc-9.10.xc74966e2026-09-27Search names, modules, packages, or :: a typeCtrl K

GHC 9.10.3 · lts/ghc-9.10.x · c74966e · 2026-09-27

Modulelrucache-1.2.0.1Haskell98

Data.Cache.LRU.IO.Internal

This module contains a mutable wrapping of an LRU in the IO monad, providing atomic access in a concurrent environment. All calls preserve the same semantics as those in Data.Cache.LRU, but perform updates in place.

This module contains the internal implementation details. It's possible to put an AtomicLRU into a bad state with this module. It is highly recommended that the external interface, Data.Cache.LRU.IO, be used instead.

  • 1 type
  • 13 values
  • Packagelrucache-1.2.0.1
  • Exports14
  • LanguageHaskell98
  • LicenceBSD-3-Clause
  • SourceInternal.hs
newtypenewtype AtomicLRU key val
#

The opaque wrapper type

Constructors

valuetoList :: Ord key => AtomicLRU key val -> IO [(key, val)]
#

Retrieve a list view of an AtomicLRU. See toList for the semantics.

valueinsert :: Ord key => key -> val -> AtomicLRU key val -> IO ()
#

Insert a key/value pair into an AtomicLRU. See insert for the semantics.

valuedelete :: Ord key => key -> AtomicLRU key val -> IO (Maybe val)
#

Remove an item from an AtomicLRU. Returns the value for the removed key, if it was present

valuepop :: Ord key => AtomicLRU key val -> IO (Maybe (key, val))
#

Remove the least-recently accessed item from an AtomicLRU. Returns the (key, val) pair removed, if one was present.

valuesize :: AtomicLRU key val -> IO Int
#

Returns the number of elements the AtomicLRU currently contains.

valuemodifyAtomicLRU
  1. :: LRU key val -> LRU key val
  2. -> AtomicLRU key val
  3. -> IO ()
#

Given a function that takes an LRU and returns one of the same type, use it to modify the contents of this AtomicLRU.

valuemodifyAtomicLRU'
  1. :: LRU key val -> IO (LRU key val)
  2. -> AtomicLRU key val
  3. -> IO ()
#

Given a function that takes an LRU and returns an IO action producting one of the same type, use it to modify the contents of this AtomicLRU.