File tree Expand file tree Collapse file tree 1 file changed +8
-22
lines changed Expand file tree Collapse file tree 1 file changed +8
-22
lines changed Original file line number Diff line number Diff line change @@ -84,37 +84,23 @@ object Tuple {
84
84
}
85
85
86
86
/** Type of the initial part of the tuple without its last element */
87
- type Init [X <: NonEmptyTuple ] <: Tuple = X match {
87
+ @ experimental
88
+ type Init [X <: Tuple ] <: Tuple = X match {
88
89
case _ *: EmptyTuple => EmptyTuple
89
90
case x *: xs =>
90
- xs match {
91
- case _ *: EmptyTuple =>
92
- x *: EmptyTuple
93
- case _ =>
94
- x *: Init [xs]
95
- }
91
+ x *: Init [xs]
96
92
}
97
93
98
94
/** Type of the tail of a tuple */
99
95
type Tail [X <: NonEmptyTuple ] <: Tuple = X match {
100
96
case _ *: xs => xs
101
97
}
102
98
103
- /** Type of the last of a tuple */
104
- type Last [X <: NonEmptyTuple ] = Reduce [X , EmptyTuple ] match {
105
- case x *: xs => xs match {
106
- case EmptyTuple => x
107
- }
108
- }
109
-
110
- /** Type of the reduce of the first tuple to a tuple of arity 1 or provide the second tuple as a result */
111
- type Reduce [X <: Tuple , Y <: Tuple ] <: Tuple = X match {
112
- case EmptyTuple => Y
113
- case x *: xs => xs match {
114
- case EmptyTuple => x *: EmptyTuple
115
- case y *: ys =>
116
- Reduce [ys, y *: EmptyTuple ]
117
- }
99
+ /** Type of the last element of a tuple */
100
+ @ experimental
101
+ type Last [X <: Tuple ] = X match {
102
+ case x *: EmptyTuple => x
103
+ case _ *: xs => Last [xs]
118
104
}
119
105
120
106
/** Type of the concatenation of two tuples */
You can’t perform that action at this time.
0 commit comments