data-ref-0.0.1.1: Unify STRef and IORef in plain Haskell 98

Safe HaskellSafe
LanguageHaskell98

Data.Ref

Documentation

data T m a Source

Constructors

Cons 

Fields

write :: a -> m ()
 
read :: m a
 

modify :: C m => T m a -> (a -> a) -> m () Source

newCons :: C m => (a -> m ref) -> (ref -> a -> m ()) -> (ref -> m a) -> a -> m (T m a) Source

class Monad m => C m where Source

Methods

new :: a -> m (T m a) Source

Instances

C IO Source 
C STM Source 
C (ST s) Source 
C m => C (MaybeT m) Source 
C m => C (IdentityT m) Source 
(Monoid w, C m) => C (WriterT w m) Source 
(Monoid w, C m) => C (WriterT w m) Source 
(Error e, C m) => C (ErrorT e m) Source 
C m => C (ExceptT e m) Source 
C m => C (StateT s m) Source 
C m => C (StateT s m) Source 
C m => C (ReaderT r m) Source 
C m => C (ContT r m) Source 
(Monoid w, C m) => C (RWST r w s m) Source 
(Monoid w, C m) => C (RWST r w s m) Source 

lift :: (Monad m, MonadTrans t) => T m a -> T (t m) a Source

liftIO :: MonadIO m => T IO a -> T m a Source

newLifted :: (C m, MonadTrans t) => a -> t m (T (t m) a) Source