Hoogle Search
Within LTS Haskell 24.4 (ghc-9.10.2)
Note that Stackage only displays results for the latest LTS and Nightly snapshot. Learn more.
-
base GHC.Conc.Sync Return the current value stored in a TVar. This is equivalent to
readTVarIO = atomically . readTVar
but works much faster, because it doesn't perform a complete transaction, it just reads the current value of the TVar. writeTVar :: TVar a -> a -> STM ()base GHC.Conc.Sync Write the supplied value into a TVar.
data
MutVar# a (b :: TYPE 'BoxedRep l)base GHC.Exts A MutVar# behaves like a single-element mutable array.
atomicModifyMutVar# :: MutVar# s a -> (a -> b) -> State# s -> (# State# s, c #)base GHC.Exts An implementation of the old atomicModifyMutVar# primop in terms of the new atomicModifyMutVar2# primop, for backwards compatibility. The type of this function is a bit bogus. It's best to think of it as having type
atomicModifyMutVar# :: MutVar# s a -> (a -> (a, b)) -> State# s -> (# State# s, b #)
but there may be code that uses this with other two-field record types.atomicModifyMutVar2# :: MutVar# d a -> (a -> c) -> State# d -> (# State# d, a, c #)base GHC.Exts Modify the contents of a MutVar#, returning the previous contents x :: a and the result of applying the given function to the previous contents f x :: c. The data type c (not a newtype!) must be a record whose first field is of lifted type a :: Type and is not unpacked. For example, product types c ~ Solo a or c ~ (a, b) work well. If the record type is both monomorphic and strict in its first field, it's recommended to mark the latter {-# NOUNPACK #-} explicitly. Under the hood atomicModifyMutVar2# atomically replaces a pointer to an old x :: a with a pointer to a selector thunk fst r, where fst is a selector for the first field of the record and r is a function application thunk r = f x. atomicModifyIORef2Native from atomic-modify-general package makes an effort to reflect restrictions on c faithfully, providing a well-typed high-level wrapper.
atomicModifyMutVar_# :: MutVar# d a -> (a -> a) -> State# d -> (# State# d, a, a #)base GHC.Exts Modify the contents of a MutVar#, returning the previous contents and the result of applying the given function to the previous contents.
mkWeakTVar :: TVar a -> IO () -> IO (Weak (TVar a))stm Control.Concurrent.STM.TVar Make a Weak pointer to a TVar, using the second argument as a finalizer to run when TVar is garbage-collected
modifyTVar :: TVar a -> (a -> a) -> STM ()stm Control.Concurrent.STM.TVar Mutate the contents of a TVar. N.B., this version is non-strict.
modifyTVar' :: TVar a -> (a -> a) -> STM ()stm Control.Concurrent.STM.TVar Strict version of modifyTVar.
-
stm Control.Concurrent.STM.TVar No documentation available.