When a type is used to represent a mathematical object, then immutability is desirable, in order to make the strict equality operator work on it. For example, a module M is a type, with its elements are its instances, but we would like to be able to compare two modules quickly, and form sets of modules. This is possible, because we have implemented modules as immutable types, and we have put the methods for adding and subtracting elements of M into the class Vector.










The object ImmutableType is a type, with ancestor classes HashTable < Thing.