Type class for for monad transformers stack with pirimitive base monad and mutable references whic could use both ST and IO monads.