@@ -22,7 +22,7 @@ sealed trait Tuple extends Product:
22
22
runtime.Tuples .toIArray(this )
23
23
24
24
/** Return a copy of `this` tuple with an element appended */
25
- inline def :* [This >: this .type <: Tuple , L ](x : L ): Append [ This , L ] =
25
+ inline def :* [This >: this .type <: Tuple , L ](x : L ): This :* L =
26
26
runtime.Tuples .append(x, this ).asInstanceOf [Append [This , L ]]
27
27
28
28
/** Return a new tuple by prepending the element to `this` tuple.
@@ -34,7 +34,7 @@ sealed trait Tuple extends Product:
34
34
/** Return a new tuple by concatenating `this` tuple with `that` tuple.
35
35
* This operation is O(this.size + that.size)
36
36
*/
37
- inline def ++ [This >: this .type <: Tuple ](that : Tuple ): Concat [ This , that.type ] =
37
+ inline def ++ [This >: this .type <: Tuple ](that : Tuple ): This ++ that.type =
38
38
runtime.Tuples .concat(this , that).asInstanceOf [Concat [This , that.type ]]
39
39
40
40
/** Return the size (or arity) of the tuple */
@@ -161,6 +161,9 @@ object Tuple:
161
161
case EmptyTuple => Y *: EmptyTuple
162
162
case x *: xs => x *: Append [xs, Y ]
163
163
164
+ /** An infix shorthand for `Append[X, Y]` */
165
+ infix type :* [X <: Tuple , Y ] = Append [X , Y ]
166
+
164
167
/** Type of the concatenation of two tuples `X` and `Y` */
165
168
type Concat [X <: Tuple , + Y <: Tuple ] <: Tuple = X match
166
169
case EmptyTuple => Y
0 commit comments