Companion object to the TupleOps type-class, containing the type-class interface and the implementation for the JsonTuple type.
Attributes
Members list
Givens
Givens
The implementation of the TupleOps type-class for the JsonTuple type and its element type, JsonElement.
The implementation of the TupleOps type-class for the JsonTuple type and its element type, JsonElement.
Attributes
Extensions
Extensions
Returns an element which is the result of accumulating all elements of this tuple from left to right, using the given element as a starting point and the given function as the accumulator. Being so, the accumulator will specify how to combine the elements folded so far into a single value with a new element of this tuple. If this tuple is empty the starting element will be returned.
Returns an element which is the result of accumulating all elements of this tuple from left to right, using the given element as a starting point and the given function as the accumulator. Being so, the accumulator will specify how to combine the elements folded so far into a single value with a new element of this tuple. If this tuple is empty the starting element will be returned.
Type parameters
- A
-
the type of the resulting element of this function
Value parameters
- a
-
the accumulation function
- z
-
the starting element of the folding operation
Attributes
- Returns
-
all elements in this tuple folded into one, starting from the given element and combining them once at a time using the given accumulation function
Returns an element which is the result of accumulating all elements of this tuple from right to left, using the given element as a starting point and the given function as the accumulator. Being so, the accumulator will specify how to combine the elements folded so far into a single value with a new element of this tuple. If this tuple is empty the starting element will be returned.
Returns an element which is the result of accumulating all elements of this tuple from right to left, using the given element as a starting point and the given function as the accumulator. Being so, the accumulator will specify how to combine the elements folded so far into a single value with a new element of this tuple. If this tuple is empty the starting element will be returned.
Type parameters
- A
-
the type of the resulting element of this function
Value parameters
- a
-
the accumulation function
- z
-
the starting element of the folding operation
Attributes
- Returns
-
all elements in this tuple folded into one, starting from the given element and combining them once at a time using the given accumulation function
Appends an element to the end of this tuple, making it grow one element from the end. If an empty tuple is used for appending an element, the resulting tuple has only one element which is also its head.
Appends an element to the end of this tuple, making it grow one element from the end. If an empty tuple is used for appending an element, the resulting tuple has only one element which is also its head.
Value parameters
- v
-
the element to be appended
Attributes
- Returns
-
a new tuple with the given element appended to it
Concatenates the given tuple after this one, with the resulting tuple having as arity the sum of both of them. If either of the tuples is an empty tuple, this operation returns the other, as concatenating an empty tuple has no effect.
Concatenates the given tuple after this one, with the resulting tuple having as arity the sum of both of them. If either of the tuples is an empty tuple, this operation returns the other, as concatenating an empty tuple has no effect.
Value parameters
- t
-
the tuple to be concatenated
Attributes
- Returns
-
a new tuple with the given one added to the end of this one
Returns the arity, i.e. the number of elements of this tuple. An empty tuple returns an arity of 0.
Returns the arity, i.e. the number of elements of this tuple. An empty tuple returns an arity of 0.
Attributes
Drops the first elements of this tuple in a given number, returning a tuple with the same elements as this, except the ones at the beginning. If the given value exceeds the arity of the tuple or it is a negative number, no operation is performed and this tuple is returned unchanged.
Drops the first elements of this tuple in a given number, returning a tuple with the same elements as this, except the ones at the beginning. If the given value exceeds the arity of the tuple or it is a negative number, no operation is performed and this tuple is returned unchanged.
Value parameters
- n
-
the number of elements to be dropped from the beginning
Attributes
- Returns
-
this tuple with the first elements at the beginning dropped, if possible, the unchanged tuple otherwise
Returns the element at the n-th position in this tuple, if one exists. If no element exists, either because the position exceeds the arity of the tuple or it is a negative number, a None is returned.
Returns the element at the n-th position in this tuple, if one exists. If no element exists, either because the position exceeds the arity of the tuple or it is a negative number, a None is returned.
Value parameters
- n
-
the position from which extracting an element
Attributes
Returns a copy of this tuple where only the elements passing the given predicate used as filter are kept. If all elements make the predicate return true
, this tuple is returned. If no element make the predicate return true
, an empty tuple is returned.
Returns a copy of this tuple where only the elements passing the given predicate used as filter are kept. If all elements make the predicate return true
, this tuple is returned. If no element make the predicate return true
, an empty tuple is returned.
Value parameters
- p
-
the predicate to be used as filter
Attributes
- Returns
-
a tuple with only the elements from this one passing the predicate used as filter
Returns a tuple where the given function has been applied for every element in this tuple. This operation maps elements of the tuple into tuples, so a flattening operation, or concatenation, is then performed so as to obtain a tuple as a result. The flattening happens only on one level, so if a tuple containing a tuple is returned by the function, the inner tuple will be an element of the resulting tuple.
Returns a tuple where the given function has been applied for every element in this tuple. This operation maps elements of the tuple into tuples, so a flattening operation, or concatenation, is then performed so as to obtain a tuple as a result. The flattening happens only on one level, so if a tuple containing a tuple is returned by the function, the inner tuple will be an element of the resulting tuple.
Value parameters
- f
-
the function to be applied on each element of this tuple
Attributes
- Returns
-
a tuple where each element in it has been transformed according to the given function
Executes the given action for each element of this tuple, allowing for side-effect-ful operations on the tuple. If this tuple is an empty tuple, the action is performed zero times.
Executes the given action for each element of this tuple, allowing for side-effect-ful operations on the tuple. If this tuple is an empty tuple, the action is performed zero times.
Value parameters
- f
-
the action to be performed on each element of this tuple
Attributes
Returns the initial part of the given tuple, so all its elements except its last. If the tuple is empty or contains only one element, its tail is also empty, so an empty tuple is returned.
Returns the initial part of the given tuple, so all its elements except its last. If the tuple is empty or contains only one element, its tail is also empty, so an empty tuple is returned.
Attributes
Returns a tuple where the given function has been applied for every element in this tuple. This operation maps elements of the tuple into elements of the tuple, which means that if the function returns a tuple, this is not concatenated, but inserted into the result as any other element.
Returns a tuple where the given function has been applied for every element in this tuple. This operation maps elements of the tuple into elements of the tuple, which means that if the function returns a tuple, this is not concatenated, but inserted into the result as any other element.
Value parameters
- f
-
the function to be applied on each element of this tuple
Attributes
- Returns
-
a tuple where each element in it has been transformed according to the given function
Splits this tuple into two at the given index, returning a tuple made of two tuples, which concatenated make this tuple. The splitting is always made to include the element at the given index in the second tuple, so an index of 0
will always return a tuple made of an empty tuple followed by this tuple. If the given index is negative, this tuple is returned. If an empty tuple is given to split, a tuple made of two empty tuples is then returned.
Splits this tuple into two at the given index, returning a tuple made of two tuples, which concatenated make this tuple. The splitting is always made to include the element at the given index in the second tuple, so an index of 0
will always return a tuple made of an empty tuple followed by this tuple. If the given index is negative, this tuple is returned. If an empty tuple is given to split, a tuple made of two empty tuples is then returned.
Value parameters
- n
-
the index at which splitting the tuple
Attributes
- Returns
-
a tuple made of two tuples, which concatenated will yield this tuple
Returns the tail of the given tuple, so all elements excluding its first one. If the tuple is empty, its tail is also empty, so an empty tuple is returned.
Returns the tail of the given tuple, so all elements excluding its first one. If the tuple is empty, its tail is also empty, so an empty tuple is returned.
Attributes
Returns this tuple with only the first elements kept in a number which is given, while the ones exceeding the count are dropped. If a value of 0
is supplied, an empty tuple is returned. If a negative value is supplied, this tuple is returned.
Returns this tuple with only the first elements kept in a number which is given, while the ones exceeding the count are dropped. If a value of 0
is supplied, an empty tuple is returned. If a negative value is supplied, this tuple is returned.
Value parameters
- n
-
the number of elements to take
Attributes
- Returns
-
this tuple with only the first given number of elements kept
Returns a tuple which elements are tuples made by an element of this tuple and an element of the given tuple. The elements are coupled one by one by their corresponding positions. This means that, if one tuple has an arity greater than the other, the exceeding elements are dropped and not coupled. This means also that if one of the two tuples is an empty tuple, then the returned tuple is an empty tuple.
Returns a tuple which elements are tuples made by an element of this tuple and an element of the given tuple. The elements are coupled one by one by their corresponding positions. This means that, if one tuple has an arity greater than the other, the exceeding elements are dropped and not coupled. This means also that if one of the two tuples is an empty tuple, then the returned tuple is an empty tuple.
Value parameters
- t
-
the other tuple to be zipped
Attributes
- Returns
-
a tuple which elements are tuples which couple the corresponding elements of this tuple and the given tuple