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

Moduleref-tf-0.5.0.1Haskell2010

Control.Monad.Ref

  • 2 classes
  • Packageref-tf-0.5.0.1
  • Exports2
  • LanguageHaskell2010
  • LicenceBSD-3-Clause
  • SourceRef.hs
classclass Monad m => MonadRef (m :: Type -> Type) where
#

The MonadRef type class abstracts over the details of manipulating references, allowing one to write code that uses references and can operate in any monad that supports reference operations.

Associated types

Methods

Instances12MonadRef, …
classclass MonadRef m => MonadAtomicRef (m :: Type -> Type) where
#

Methods

  • atomicModifyRef :: Ref m a -> (a -> (a, b)) -> m b

    Atomically mutate the contents of a reference

  • atomicModifyRef' :: Ref m a -> (a -> (a, b)) -> m b

    Strict version of atomicModifyRef. This forces both the value stored in the reference as well as the value returned.

Instances11MonadAtomicRef, …