Previous sections show how to add and remove an element from a given
set. The function
Set.update can do both depending on a boolean
value: if true, then the given value will be added to the set,
otherwise it will be removed (if present).
Set.update implements a one-value update. Sometime we
would like to provide a function that is applied in turn to all the
elements of the set, and specifies whether the element at hand has to
be discarded or replaced by a computed value. This is what
As an example, let us consider a function that removes all the even numbers from a set.
Note: See the predefined namespace Set