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