HORIZON HASKELLDocslts/ghc-10.0.xfc4e5982026-10-11Search names, modules, packages, or :: a typeCtrl K

GHC 10.0.0.20260917 · lts/ghc-10.0.x · fc4e598 · 2026-10-11

Modulelvar-0.2.0.0Haskell2010

Data.LVar

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

  • 1 type
  • 6 values
  • Packagelvar-0.2.0.0
  • Exports7
  • LanguageHaskell2010
  • LicenceBSD-3-Clause
  • SourceLVar.hs

Types

1 declaration

Creating a LVar

2 declarations
valuenew :: MonadIO m => a -> m (LVar a)
#

Create a new LVar with the given initial value

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

3 declarations
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

1 declaration
valuelistenNext :: MonadIO m => LVar a -> m a
#

Listen for the next value update (since the last listenNext or addListener).