-- Hoogle documentation, generated by Haddock -- See Hoogle, http://www.haskell.org/hoogle/ -- | A type class for monads with references using functional dependencies. -- -- Contains a MonadRef type class that abstracts over the details -- of manipulating references, allowing one to write code that can -- operate in either the ST monad or the IO monad. @package ref-fd @version 0.1 -- | Mutable references in the (strict) ST monad. module Control.Monad.Ref -- | The MonadRef type class abstracts over the details of -- manipulating references, allowing one to write code that uses -- references and can operate in either the ST monad or the IO monad. class (Monad m) => MonadRef r m | m -> r newRef :: (MonadRef r m) => a -> m (r a) readRef :: (MonadRef r m) => r a -> m a writeRef :: (MonadRef r m) => r a -> a -> m () modifyRef :: (MonadRef r m) => r a -> (a -> a) -> m () instance MonadRef IORef IO instance MonadRef (STRef s) (ST s)