[!WARNING]
BREAKING-CHANGE
2-tuples (a, b)
are now treated the same as 3+ tuples -- which directly impacts the way that Aiken now deserialise those, especially when nested inside a List
.
To deserialize into a list of 2-tuple (List<(a, b)>
), one is now expected to provide a CBOR array of arrays (of 2 elements). Previously, this would require to provide a CBOR map! The downside of the latter is that CBOR serialization libraries do not necessarily preserve the order of keys in a map which could cause issues down the line, in particular with Aiken's dictionnaries.
To recover the old behavior when desired, Aiken introduces a new type Pair<a, b>
to the language. So any existing program can be migrated by switching any occurences of (a, b)
to Pair<a, b>
.
However, it is often preferable to use 2-tuples where possible. The main place you will see usage of Pair
is in the script context because its form is imposed by the ledger.