tuple, natural number
Source: /avail/Avail/Foundation/Tuples
Categories: Tuples, Transformers
Split a aTuple into two tuples between pivot
- 1
and pivot and answer a 2-tuple containing the results.
Position | Name | Type | Description | |
---|---|---|---|---|
Parameters | ||||
1 | aTuple | tuple | ||
2 | pivot | natural number | The index (exclusive) at which to split aTuple. | |
Returns | <tuple…|2> |
A 2-tuple. The first tuple contains the first pivot - 1 elements of aTuple. The second tuple contains the remaining elements of aTuple.
|
tuple, [⊥]→boolean
Source: /avail/Avail/Foundation/Tuples
Categories: Tuples, Transformers
Split a aTuple into two tuples.
Position | Name | Type | Description | |
---|---|---|---|---|
Parameters | ||||
1 | aTuple | tuple | ||
2 | predicate | [⊥]→boolean | A function that accepts each element of the tuple. It must answer true when the pivot position has been reached. The function will not be applied again after it has answered true. | |
Returns | <tuple…|2> | A 2-tuple. The first tuple contains the elements of aTuple to which predicate was applied without a true result. The second tuple contains the element for which a true result was obtained along with the remaining, untested, elements of aTuple. |