HORIZON HASKELLDocslts/ghc-9.14.x7a6c33e2026-10-12Search packagesCtrl K
Theme: |

GHC 9.14.1 · lts/ghc-9.14.x · 7a6c33e · 2026-10-12

Modulelvar-0.2.0.0Haskell2010

Data.LVar

LVar is like Control.Concurrent.STM.TMVar but with a capability for listening to its changes.

Contents
  1. Types
  2. Creating a LVar
  3. Modifying a LVar
  4. Listening to a LVar
Synopsis
  • Packagelvar-0.2.0.0
  • Exports7
  • LanguageHaskell2010
  • LicenceBSD-3-Clause
  • SourceLVar.hs

Types

Creating a LVar

valueempty :: MonadIO m => m (LVar a)

Like new, but there is no initial value. A get will block until an initial value is set using set or modify

Modifying a LVar

valueset :: MonadIO m => LVar a -> a -> m ()

Set the LVar value; active listeners are automatically notifed.

valuemodify :: MonadIO m => LVar a -> (a -> a) -> m ()

Modify the LVar value; active listeners are automatically notified.

Listening to a LVar