ganeti

Safe HaskellSafe-Infered

Ganeti.Utils.IORef

Description

Utility functions for working with IORefs.

Synopsis

Documentation

atomicModifyWithLens :: MonadBase IO m => IORef a -> Lens a a b c -> (b -> (r, c)) -> m rSource

Atomically modifies an IORef using a lens

atomicModifyIORefErr :: MonadBase IO m => IORef a -> (a -> GenericResult e (a, b)) -> ResultT e m bSource

Atomically modifies an IORef using a function that can possibly fail. If it fails, the value of the IORef is preserved.

atomicModifyIORefErrLog :: (MonadBase IO m, MonadLog m) => IORef a -> (a -> ResultT e WriterLog (a, b)) -> ResultT e m bSource

Atomically modifies an IORef using a function that can possibly fail and log errors. If it fails, the value of the IORef is preserved. Any log messages are passed to the outer monad.