Description

subtypes.weaktuple

the weaktuple is a tuple with weakened immutability.

the main difference between the two is that the weaktuple’s
immutability is only concerned with the size and the underlying type
of each component.

in other words, tuple’s immutability property can be viewed as a set of three
constraints C = (tupleSize, tupleComponentValue, tupleComponentType) (the
third may be somehow implicit).
The weaktuple’s set of constraints has only two components:
C = (tupleSize,tupleComponentType), equivalent to “tuple has a product type” if you like.

the values of weaktuple’s component can be updated as long as the
component’s type and tuple’s size constraints are verified.

applicability: storing the arguments to a function as a tuple for a
later function call: while computing a set of conditions, the
arguments may be needing updates. It’s easier, clearer and
hopefully faster to do an
inplace tuple member update: