@@ -30,7 +30,7 @@ object NamedTuple:
30
30
31
31
export NamedTupleDecomposition .{
32
32
Names , DropNames ,
33
- apply , size , init , last , tail , take , drop , splitAt , ++ , map , reverse , zip , toList , toArray , toIArray
33
+ apply , size , init , head , last , tail , take , drop , splitAt , ++ , map , reverse , zip , toList , toArray , toIArray
34
34
}
35
35
36
36
extension [N <: Tuple , V <: Tuple ](x : NamedTuple [N , V ])
@@ -43,9 +43,6 @@ object NamedTuple:
43
43
// and should be reverted, just like NonEmptyList is also appealing at first, but a bad idea
44
44
// in the end.
45
45
46
- /** The first element value of this tuple */
47
- inline def head : Tuple .Elem [V , 0 ] = x.apply(0 )
48
-
49
46
// inline def :* [L] (x: L): NamedTuple[Append[N, ???], Append[V, L] = ???
50
47
// inline def *: [H] (x: H): NamedTuple[??? *: N], H *: V] = ???
51
48
@@ -149,6 +146,9 @@ object NamedTupleDecomposition:
149
146
/** The number of elements in this tuple */
150
147
inline def size : Tuple .Size [V ] = x.toTuple.size
151
148
149
+ /** The first element value of this tuple */
150
+ inline def head : Tuple .Elem [V , 0 ] = apply(0 )
151
+
152
152
/** The last element value of this tuple */
153
153
inline def last : Tuple .Last [V ] = apply(size - 1 ).asInstanceOf [Tuple .Last [V ]]
154
154
0 commit comments