@@ -22,8 +22,8 @@ sealed trait Tuple extends Product {
2222 runtime.Tuples .toIArray(this )
2323
2424 /** Return a copy of `this` tuple with an element appended */
25- inline def :* [This >: this .type <: Tuple , L ] (x : L ): Append [ This , L ] =
26- runtime.Tuples .append(x, this ).asInstanceOf [Append [ This , L ] ]
25+ inline def :* [This >: this .type <: Tuple , L ] (x : L ): This :* L =
26+ runtime.Tuples .append(x, this ).asInstanceOf [This :* L ]
2727
2828 /** Return a new tuple by prepending the element to `this` tuple.
2929 * This operation is O(this.size)
@@ -58,8 +58,8 @@ sealed trait Tuple extends Product {
5858 /** Return a new tuple by concatenating `this` tuple with `that` tuple.
5959 * This operation is O(this.size + that.size)
6060 */
61- inline def ++ [This >: this .type <: Tuple ](that : Tuple ): Concat [ This , that.type ] =
62- runtime.Tuples .concat(this , that).asInstanceOf [Concat [ This , that.type ] ]
61+ inline def ++ [This >: this .type <: Tuple ](that : Tuple ): This ++ that.type =
62+ runtime.Tuples .concat(this , that).asInstanceOf [This ++ that.type ]
6363
6464 /** Return the size (or arity) of the tuple */
6565 inline def size [This >: this .type <: Tuple ]: Size [This ] =
@@ -118,6 +118,9 @@ object Tuple {
118118 case x *: xs => x *: Append [xs, Y ]
119119 }
120120
121+ /** An infix shorthand for `Append[X, Y]` */
122+ infix type :* [X <: Tuple , Y ] = Append [X , Y ]
123+
121124 /** Type of the head of a tuple */
122125 type Head [X <: Tuple ] = X match {
123126 case x *: _ => x
@@ -147,6 +150,9 @@ object Tuple {
147150 case x1 *: xs1 => x1 *: Concat [xs1, Y ]
148151 }
149152
153+ /** An infix shorthand for `Concat[X, Y]` */
154+ infix type ++ [X <: Tuple , + Y <: Tuple ] = Concat [X , Y ]
155+
150156 /** Type of the element at position N in the tuple X */
151157 type Elem [X <: Tuple , N <: Int ] = X match {
152158 case x *: xs =>
0 commit comments