split_before_

Definitions:

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.

Semantic restrictions:

tuple meta, natural number's type
Source: /avail/Avail/Foundation/Tuples
Construct the strongest possible 2-tuple type for the given arguments. The first element type is a tuple type whose elements are drawn from the original tuple type. The second element type is a tuple type whose element type are smears (i.e., type unions) of the trailing element types of the original tuple type. The pivot is used to determine the cardinality ranges of the these element types.
Type Description
Parameter Types
tuple meta
natural number's type
tuple meta, [⊥]→boolean's type
Source: /avail/Avail/Foundation/Tuples
Construct the strongest possible 2-tuple type for the given arguments. The first element type is a tuple type whose elements are drawn from the original tuple type. The second element type is a tuple type whose element type are smears (i.e., type unions) of the trailing element types of the original tuple type. The cardinality of each tuple varies from 0 to the upper bound of tupleType 's cardinality range.
Type Description
Parameter Types
tuple meta
[⊥]→boolean's type