-- Hoogle documentation, generated by Haddock -- See Hoogle, http://www.haskell.org/hoogle/ -- | Unify STRef and IORef in plain Haskell 98 -- -- This package provides a unique interface to both STRef and IORef. The -- advantage is that it is plain Haskell 98, the disadvantage is that we -- cannot use STRef and IORef as they are. -- -- Our approach works with Haskell 98 single parameter type classes -- because we use an explicit dictionary, and we do not pass the -- references around but their accessors. -- -- Similar packages: reference, ref-mtl, -- ref-fd, ref-tf. @package data-ref @version 0.0 module Data.Ref data T m a Cons :: (a -> m ()) -> m a -> T m a write :: T m a -> a -> m () read :: T m a -> m a modify :: C m => T m a -> (a -> a) -> m () newCons :: C m => (a -> m ref) -> (ref -> a -> m ()) -> (ref -> m a) -> a -> m (T m a) class Monad m => C m new :: C m => a -> m (T m a) lift :: (Monad m, MonadTrans t) => T m a -> T (t m) a liftIO :: MonadIO m => T IO a -> T m a newLifted :: (C m, MonadTrans t) => a -> t m (T (t m) a) instance (Monoid w, C m) => C (RWST r w s m) instance (Monoid w, C m) => C (RWST r w s m) instance (Monoid w, C m) => C (WriterT w m) instance (Monoid w, C m) => C (WriterT w m) instance C m => C (StateT s m) instance C m => C (StateT s m) instance C m => C (ReaderT r m) instance C m => C (ContT r m) instance (Error e, C m) => C (ErrorT e m) instance C m => C (MaybeT m) instance C m => C (IdentityT m) instance C STM instance C (ST s) instance C IO