Typesafe MRef with a regular monad