import public Data.IORef
import public Control.Monad.ST
interface Ref : (Type -> Type) -> (Type -> Type) -> Type
newRef : a -> m (r a)
readRef : r a -> m a
writeRef : r a -> a -> m ()
modifyRef : (a -> a) -> r a -> m a
Updates a value and returns the previous value
newRef : Ref m r => a -> m (r a)
readRef : Ref m r => r a -> m a
writeRef : Ref m r => r a -> a -> m ()
modifyRef : Ref m r => (a -> a) -> r a -> m a
Updates a value and returns the previous value
modifyRef_ : Ref m r => (a -> a) -> r a -> m ()
ForRef : Ref m r => Monad m => r a -> MonadState a m