Modulestrict-checked-vars-0.2.1.0Haskell2010
Control.Concurrent.Class.MonadSTM.Strict.TVar.Checked
This module corresponds to Control.Concurrent.STM.TVar in the stm package.
This module can be used as a drop-in replacement for
Control.Concurrent.Class.MonadSTM.Strict.TVar, but not the other way
around.
- 2 types
- 19 values
- Packagestrict-checked-vars-0.2.1.0
- Exports21
- LanguageHaskell2010
- LicenceApache-2.0
- SourceChecked.hs
StrictTVar
16 declarationsCreate a StrictMVar from a LazyMVar
It is not guaranteed that the LazyTVar contains a value that is in WHNF, so there is no guarantee that the resulting StrictTVar contains a value that is in WHNF. This should be used with caution.
The resulting StrictTVar has a trivial invariant.
Get the underlying TVar
Since we obviously cannot guarantee that updates to this LazyTVar will be strict, this should be used with caution.
Similarly, we can not guarantee that updates to this LazyTVar do not break the original invariant that the StrictTVar held.
Create an unchecked reference to the given checked StrictTVar.
Note that the invariant is only guaranteed when modifying the checked TVar. Any modification to the unchecked reference might break the invariants.
MonadLabelSTM
2 declarationsMonadTraceSTM
2 declarationsInvariant
1 declarationCheck invariant (if enabled) before continuing
checkInvariant mErr x is equal to x if mErr == Nothing, and throws
an error err if mErr == Just err.
This is exported so that other code that wants to conditionally check invariants can reuse the same logic, rather than having to introduce new per-package flags.