Hoogle Search

Within LTS Haskell 24.35 (ghc-9.10.3)

Note that Stackage only displays results for the latest LTS and Nightly snapshot. Learn more.

  1. atomicModifyMutVar :: PrimMonad m => MutVar (PrimState m) a -> (a -> (a, b)) -> m b

    primitive Data.Primitive.MutVar

    Atomically mutate the contents of a MutVar. This function is useful for using MutVar in a safe way in a multithreaded program. If you only have one MutVar, then using atomicModifyMutVar to access and modify it will prevent race conditions. Extending the atomicity to multiple MutVars is problematic, so if you need to do anything more complicated, using MVar instead is a good idea. atomicModifyMutVar does not apply the function strictly. This means if a program calls atomicModifyMutVar many times, but seldom uses the value, thunks will pile up in memory resulting in a space leak. To avoid this problem, use atomicModifyMutVar' instead.

  2. atomicModifyMutVar' :: PrimMonad m => MutVar (PrimState m) a -> (a -> (a, b)) -> m b

    primitive Data.Primitive.MutVar

    Strict version of atomicModifyMutVar. This forces both the value stored in the MutVar as well as the value returned.

  3. modifyMutVar :: PrimMonad m => MutVar (PrimState m) a -> (a -> a) -> m ()

    primitive Data.Primitive.MutVar

    Mutate the contents of a MutVar. modifyMutVar does not apply the function strictly. This means if a program calls modifyMutVar many times, but seldom uses the value, thunks will pile up in memory resulting in a space leak. To avoid this problem, use modifyMutVar' instead.

  4. modifyMutVar' :: PrimMonad m => MutVar (PrimState m) a -> (a -> a) -> m ()

    primitive Data.Primitive.MutVar

    Strict version of modifyMutVar.

  5. mutVarFromIORef :: IORef a -> MutVar RealWorld a

    primitive Data.Primitive.MutVar

    Convert MutVar to IORef

  6. mutVarFromSTRef :: STRef s a -> MutVar s a

    primitive Data.Primitive.MutVar

    Convert MutVar to STRef

  7. mutVarToIORef :: MutVar RealWorld a -> IORef a

    primitive Data.Primitive.MutVar

    Convert MutVar to IORef

  8. mutVarToSTRef :: MutVar s a -> STRef s a

    primitive Data.Primitive.MutVar

    Convert MutVar to STRef

  9. newMutVar :: PrimMonad m => a -> m (MutVar (PrimState m) a)

    primitive Data.Primitive.MutVar

    Create a new MutVar with the specified initial value.

  10. readMutVar :: PrimMonad m => MutVar (PrimState m) a -> m a

    primitive Data.Primitive.MutVar

    Read the value of a MutVar.

Page 9 of many | Previous | Next