Safe Haskell | Safe-Infered |
---|
Utility functions for working with IORefs.
- atomicModifyWithLens :: MonadBase IO m => IORef a -> Lens a a b c -> (b -> (r, c)) -> m r
- atomicModifyIORefErr :: MonadBase IO m => IORef a -> (a -> GenericResult e (a, b)) -> ResultT e m b
- atomicModifyIORefErrLog :: (MonadBase IO m, MonadLog m) => IORef a -> (a -> ResultT e WriterLog (a, b)) -> ResultT e m b
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.