tuple, natural number, any
Source: /avail/Avail/Foundation/Bootstrap/Fallible Primitives
Categories: Primitives, Tuples, Transformers
Construct and answer a tuple based on the one provided but such that its
index -th element is
value.
|
Position |
Name |
Type |
Description |
Parameters |
1 |
aTuple |
tuple |
A tuple.
|
2 |
index |
natural number |
The one-based index of the element that should (potentially) differ in the resultant tuple.
|
3 |
value |
any |
The replacement value.
|
Returns |
tuple |
The requested tuple.
|
Raises |
subscript-out-of-bounds exception |
|
tuple meta, natural number's type, any meta
Source: /avail/Avail/Foundation/Tuples
Tuple element replacement affects only those elements whose subscripts are instances of the index's type. If multiple subscripts could be affected, then update the element types via type union with the result type. If only a single subscript could be affected, then simply replace the corresponding element type with the result type. Leverage instance types if possible.