File tree 1 file changed +7
-8
lines changed
1 file changed +7
-8
lines changed Original file line number Diff line number Diff line change @@ -84,15 +84,12 @@ 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 {
89
+ case EmptyTuple => EmptyTuple
88
90
case _ *: EmptyTuple => EmptyTuple
89
91
case x *: xs =>
90
- xs match {
91
- case _ *: EmptyTuple =>
92
- x *: EmptyTuple
93
- case _ =>
94
- x *: Init [xs]
95
- }
92
+ x *: Init [xs]
96
93
}
97
94
98
95
/** Type of the tail of a tuple */
@@ -101,13 +98,15 @@ object Tuple {
101
98
}
102
99
103
100
/** Type of the last of a tuple */
104
- type Last [X <: NonEmptyTuple ] = Reduce [X , EmptyTuple ] match {
101
+ @ experimental
102
+ type Last [X <: Tuple ] = Reduce [X , EmptyTuple ] match {
105
103
case x *: xs => xs match {
106
104
case EmptyTuple => x
107
105
}
108
106
}
109
107
110
108
/** Type of the reduce of the first tuple to a tuple of arity 1 or provide the second tuple as a result */
109
+ @ experimental
111
110
type Reduce [X <: Tuple , Y <: Tuple ] <: Tuple = X match {
112
111
case EmptyTuple => Y
113
112
case x *: xs => xs match {
You can’t perform that action at this time.
0 commit comments