HORIZON HASKELLDocslts/ghc-10.0.x2b276322026-10-31Search packagesCtrl K
Theme: |

GHC 10.0.0.20260917 · lts/ghc-10.0.x · 2b27632 · 2026-10-31

Moduleref-tf-0.5.0.1Haskell2010

Control.Monad.Ref

Synopsis
  • 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, …