-- Hoogle documentation, generated by Haddock -- See Hoogle, http://www.haskell.org/hoogle/ -- | Mutable references -- -- This package defines the class Ref of references mutable within -- appropriate monads, as well as some instances of this class. @package ref @version 0.1.0.0 module Data.Ref.Class class Monad m => Ref ref a m where newRef = lift . newRef readRef = lift . readRef writeRef ref = lift . writeRef ref modifyRef ref f = readRef ref >>= writeRef ref . f modifyRef' ref f = readRef ref >>= \ a -> writeRef ref $! f a newRef :: Ref ref a m => a -> m (ref a) readRef :: Ref ref a m => ref a -> m a writeRef :: Ref ref a m => ref a -> a -> m () modifyRef :: Ref ref a m => ref a -> (a -> a) -> m () modifyRef' :: Ref ref a m => ref a -> (a -> a) -> m () instance (Ref ref a m, Monoid w) => Ref ref a (WriterT w m) instance (Ref ref a m, Monoid w) => Ref ref a (WriterT w m) instance Ref ref a m => Ref ref a (StateT s m) instance Ref ref a m => Ref ref a (StateT s m) instance Ref ref a m => Ref ref a (ReaderT r m) instance (Ref ref a m, Monoid w) => Ref ref a (RWST r w s m) instance (Ref ref a m, Monoid w) => Ref ref a (RWST r w s m) instance Ref ref a m => Ref ref a (MaybeT m) instance Ref ref a m => Ref ref a (ListT m) instance Ref ref a m => Ref ref a (IdentityT m) instance (Ref ref a m, Error e) => Ref ref a (ErrorT e m) instance Ref ref a m => Ref ref a (ContT r m) instance Ref (STRef s) a (ST s) instance Ref (STRef s) a (ST s) instance Ref IORef a IO module Data.Ref.IO -- | A mutable variable in the IO monad data IORef a :: * -> * -- | A mutable variable containing an unboxed value of type a in -- the IO monad data IOURef a instance Typeable1 IOURef instance Eq (IOURef a) instance Ref IOURef Word64 IO instance Ref IOURef Word32 IO instance Ref IOURef Word16 IO instance Ref IOURef Word8 IO instance Ref IOURef Int64 IO instance Ref IOURef Int32 IO instance Ref IOURef Int16 IO instance Ref IOURef Int8 IO instance Ref IOURef (StablePtr a) IO instance Ref IOURef Double IO instance Ref IOURef Float IO instance Ref IOURef (FunPtr a) IO instance Ref IOURef (Ptr a) IO instance Ref IOURef Word IO instance Ref IOURef Int IO instance Ref IOURef Char IO instance Ref IOURef Bool IO module Data.Ref.ST -- | a value of type STRef s a is a mutable variable in state -- thread s, containing a value of type a data STRef s a :: * -> * -> * -- | a value of type STURef s a is a mutable variable in -- state thread s, containing an unboxed value of type -- a data STURef s a instance Typeable2 STURef instance Eq (STURef s a) instance Ref (STURef s) Word64 (ST s) instance Ref (STURef s) Word32 (ST s) instance Ref (STURef s) Word16 (ST s) instance Ref (STURef s) Word8 (ST s) instance Ref (STURef s) Int64 (ST s) instance Ref (STURef s) Int32 (ST s) instance Ref (STURef s) Int16 (ST s) instance Ref (STURef s) Int8 (ST s) instance Ref (STURef s) (StablePtr a) (ST s) instance Ref (STURef s) Double (ST s) instance Ref (STURef s) Float (ST s) instance Ref (STURef s) (FunPtr a) (ST s) instance Ref (STURef s) (Ptr a) (ST s) instance Ref (STURef s) Word (ST s) instance Ref (STURef s) Int (ST s) instance Ref (STURef s) Char (ST s) instance Ref (STURef s) Bool (ST s) instance Ref (STURef s) Word64 (ST s) instance Ref (STURef s) Word32 (ST s) instance Ref (STURef s) Word16 (ST s) instance Ref (STURef s) Word8 (ST s) instance Ref (STURef s) Int64 (ST s) instance Ref (STURef s) Int32 (ST s) instance Ref (STURef s) Int16 (ST s) instance Ref (STURef s) Int8 (ST s) instance Ref (STURef s) (StablePtr a) (ST s) instance Ref (STURef s) Double (ST s) instance Ref (STURef s) Float (ST s) instance Ref (STURef s) (FunPtr a) (ST s) instance Ref (STURef s) (Ptr a) (ST s) instance Ref (STURef s) Word (ST s) instance Ref (STURef s) Int (ST s) instance Ref (STURef s) Char (ST s) instance Ref (STURef s) Bool (ST s) module Data.Ref.Storable data StorableRef a instance Typeable1 StorableRef instance Show (StorableRef a) instance Eq (StorableRef a) instance Ord (StorableRef a) instance Storable a => Ref StorableRef a IO instance Typeable a => Data (StorableRef a) module Data.Ref