HORIZON HASKELLDocslts/ghc-10.0.x8fef28d2026-11-02Search packagesCtrl K
Theme: |

GHC 10.0.0.20260917 · lts/ghc-10.0.x · 8fef28d · 2026-11-02

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