module MemMonads where class Monad m => MemMonad m a w | m ->a w where rd :: a -> m w wr :: a -> w -> m ()