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

GHC 10.0.0.20260917 · lts/ghc-10.0.x · c62e4de · 2026-10-19

Moduleconcurrency-1.11.0.3Haskell2010

Control.Concurrent.Classy.STM.TMVar

Transactional MVars, for use with MonadSTM.

Deviations: TMVar as defined here does not have an Eq instance, this is because the MonadSTM TVar type does not have an Eq constraint. Furthermore, the newTMVarIO, newEmptyTMVarIO, and mkWeakTMVar functions are not provided.

  • 1 type
  • 12 values

TMVars

13 declarations
newtypenewtype TMVar (stm :: Type -> Type) a
#

A TMVar is like an MVar or a mVar, but using transactional memory. As transactions are atomic, this makes dealing with multiple TMVars easier than wrangling multiple mVars.

valuenewTMVarN :: MonadSTM stm => String -> a -> stm (TMVar stm a)
#

Create a TMVar containing the given value, with the given name.

Name conflicts are handled as usual for TVars. The name is prefixed with "ctmvar-".