Saving a module in a reference

The problem is similar to the one given in the discussion “The shape problem”.

I like the solution given by Kantian here: creating a new type associating the data and the behavior, using the OCaml type system for beiing sure to always have the right type with the right module.