NamedTuple

scala.NamedTuple
opaque object NamedTuple

Attributes

Experimental
true
Source
NamedTuple.scala
Graph
Supertypes
class Object
trait Matchable
class Any
Self type
NamedTuple.type

Members list

Type members

Types

opaque type AnyNamedTuple

A type which is a supertype of all named tuples

A type which is a supertype of all named tuples

Attributes

Source
NamedTuple.scala

Type of the concatenation of two tuples X and Y

Type of the concatenation of two tuples X and Y

Attributes

Source
NamedTuple.scala
type Drop[X <: AnyNamedTuple, N <: Int] = NamedTuple[Drop[Names[X], N], Drop[DropNames[X], N]]

The type of the named tuple consisting of all elements of X except the first N ones, or no elements if N exceeds Size[X].

The type of the named tuple consisting of all elements of X except the first N ones, or no elements if N exceeds Size[X].

Attributes

Source
NamedTuple.scala
type Elem[X <: AnyNamedTuple, N <: Int] = Elem[DropNames[X], N]

The type of the element value at position N in the named tuple X

The type of the element value at position N in the named tuple X

Attributes

Source
NamedTuple.scala
type Empty = EmptyTuple.type

The type of the empty named tuple

The type of the empty named tuple

Attributes

Source
NamedTuple.scala
type From[T] <: AnyNamedTuple

A type specially treated by the compiler to represent all fields of a class argument T as a named tuple. Or, if T is already a named tyuple, From[T] is the same as T.

A type specially treated by the compiler to represent all fields of a class argument T as a named tuple. Or, if T is already a named tyuple, From[T] is the same as T.

Attributes

Source
NamedTuple.scala
type Head[X <: AnyNamedTuple] = Elem[X, 0]

The type of the first element value of a named tuple

The type of the first element value of a named tuple

Attributes

Source
NamedTuple.scala

The type of the initial part of a named tuple without its last element

The type of the initial part of a named tuple without its last element

Attributes

Source
NamedTuple.scala
type Last[X <: AnyNamedTuple] = Last[DropNames[X]]

The type of the last element value of a named tuple

The type of the last element value of a named tuple

Attributes

Source
NamedTuple.scala
type Map[X <: AnyNamedTuple, F[_ <: Union[DropNames[X]]]] = NamedTuple[Names[X], Map[DropNames[X], F]]

The type of the named tuple X mapped with the type-level function F. If X = (n1 : T1, ..., ni : Ti) then Map[X, F] =(n1 : F[T1], ..., ni : F[Ti])`.

The type of the named tuple X mapped with the type-level function F. If X = (n1 : T1, ..., ni : Ti) then Map[X, F] =(n1 : F[T1], ..., ni : F[Ti])`.

Attributes

Source
NamedTuple.scala
opaque type NamedTuple[N <: Tuple, +V <: Tuple]

The type to which named tuples get mapped to. For instance, (name: String, age: Int) gets mapped to NamedTuple[("name", "age"), (String, Int)]

The type to which named tuples get mapped to. For instance, (name: String, age: Int) gets mapped to NamedTuple[("name", "age"), (String, Int)]

Attributes

Source
NamedTuple.scala

A named tuple with the elements of tuple X in reversed order

A named tuple with the elements of tuple X in reversed order

Attributes

Source
NamedTuple.scala
type Size[X <: AnyNamedTuple] = Size[DropNames[X]]

The size of a named tuple, represented as a literal constant subtype of Int

The size of a named tuple, represented as a literal constant subtype of Int

Attributes

Source
NamedTuple.scala
type Split[X <: AnyNamedTuple, N <: Int] = (Take[X, N], Drop[X, N])

The pair type `(Take(X, N), Drop[X, N]).

The pair type `(Take(X, N), Drop[X, N]).

Attributes

Source
NamedTuple.scala
type Tail[X <: AnyNamedTuple] = Drop[X, 1]

The type of a named tuple consisting of all elements of named tuple X except the first one

The type of a named tuple consisting of all elements of named tuple X except the first one

Attributes

Source
NamedTuple.scala
type Take[X <: AnyNamedTuple, N <: Int] = NamedTuple[Take[Names[X], N], Take[DropNames[X], N]]

The type of the named tuple consisting of the first N elements of X, or all elements if N exceeds Size[X].

The type of the named tuple consisting of the first N elements of X, or all elements if N exceeds Size[X].

Attributes

Source
NamedTuple.scala
type Zip[X <: AnyNamedTuple, Y <: AnyNamedTuple] = Names[X] match { case Names[Y] => NamedTuple[Names[X], Zip[DropNames[X], DropNames[Y]]] }

The type of the named tuple consisting of all element values of named tuple X zipped with corresponding element values of named tuple Y. If the two tuples have different sizes, the extra elements of the larger tuple will be disregarded. The names of X and Y at the same index must be the same. The result tuple keeps the same names as the operand tuples. For example, if

The type of the named tuple consisting of all element values of named tuple X zipped with corresponding element values of named tuple Y. If the two tuples have different sizes, the extra elements of the larger tuple will be disregarded. The names of X and Y at the same index must be the same. The result tuple keeps the same names as the operand tuples. For example, if

   X = (n1 : S1, ..., ni : Si)
   Y = (n1 : T1, ..., nj : Tj)  where j >= i

then

   Zip[X, Y] = (n1 : (S1, T1), ..., ni: (Si, Ti))

Attributes

Source
NamedTuple.scala

Value members

Concrete methods

def apply[N <: Tuple, V <: Tuple](x: V): NamedTuple[N, V]

Attributes

Source
NamedTuple.scala
def unapply[N <: Tuple, V <: Tuple](x: NamedTuple[N, V]): Some[V]

Attributes

Source
NamedTuple.scala

Concrete fields

val Empty: Empty

The empty named tuple

The empty named tuple

Attributes

Source
NamedTuple.scala

Extensions

Extensions

extension [V <: Tuple](x: V)
inline def withNames[N <: Tuple]: NamedTuple[N, V]

Attributes

Source
NamedTuple.scala
extension [N <: Tuple, V <: Tuple](x: NamedTuple[N, V])
inline def ++[N2 <: Tuple, V2 <: Tuple](that: NamedTuple[N2, V2])(using Disjoint[N, N2] =:= true): NamedTuple[Concat[N, N2], Concat[V, V2]]

The tuple consisting of all elements of this tuple followed by all elements of tuple that. The names of the two tuples must be disjoint.

The tuple consisting of all elements of this tuple followed by all elements of tuple that. The names of the two tuples must be disjoint.

Attributes

Source
NamedTuple.scala
inline def apply(n: Int): Elem[V, n.type]

The value (without the name) at index n of this tuple

The value (without the name) at index n of this tuple

Attributes

Source
NamedTuple.scala
inline def drop(n: Int): NamedTuple[Drop[N, n.type], Drop[V, n.type]]

The tuple consisting of all elements of this tuple except the first n ones, or no elements if n exceeds size.

The tuple consisting of all elements of this tuple except the first n ones, or no elements if n exceeds size.

Attributes

Source
NamedTuple.scala
inline def head: Elem[V, 0]

The first element value of this tuple

The first element value of this tuple

Attributes

Source
NamedTuple.scala
inline def init: NamedTuple[Init[N], Init[V]]

The tuple consisting of all elements of this tuple except the last one

The tuple consisting of all elements of this tuple except the last one

Attributes

Source
NamedTuple.scala
inline def last: Last[V]

The last element value of this tuple

The last element value of this tuple

Attributes

Source
NamedTuple.scala
inline def map[F[_]](f: [t] => t => F[t]): NamedTuple[N, Map[V, F]]

The named tuple consisting of all element values of this tuple mapped by the polymorphic mapping function f. The names of elements are preserved. If x = (n1 = v1, ..., ni = vi) then x.map(f) =(n1 = f(v1), ..., ni = f(vi))`.

The named tuple consisting of all element values of this tuple mapped by the polymorphic mapping function f. The names of elements are preserved. If x = (n1 = v1, ..., ni = vi) then x.map(f) =(n1 = f(v1), ..., ni = f(vi))`.

Attributes

Source
NamedTuple.scala
inline def reverse: NamedTuple[Reverse[N], Reverse[V]]

The named tuple consisting of all elements of this tuple in reverse

The named tuple consisting of all elements of this tuple in reverse

Attributes

Source
NamedTuple.scala
inline def size: Size[V]

The number of elements in this tuple

The number of elements in this tuple

Attributes

Source
NamedTuple.scala
inline def splitAt(n: Int): (NamedTuple[Take[N, n.type], Take[V, n.type]], NamedTuple[Drop[N, n.type], Drop[V, n.type]])

The tuple (x.take(n), x.drop(n))

The tuple (x.take(n), x.drop(n))

Attributes

Source
NamedTuple.scala
inline def tail: NamedTuple[Tail[N], Tail[V]]

The tuple consisting of all elements of this tuple except the first one

The tuple consisting of all elements of this tuple except the first one

Attributes

Source
NamedTuple.scala
inline def take(n: Int): NamedTuple[Take[N, n.type], Take[V, n.type]]

The tuple consisting of the first n elements of this tuple, or all elements if n exceeds size.

The tuple consisting of the first n elements of this tuple, or all elements if n exceeds size.

Attributes

Source
NamedTuple.scala
inline def toArray: Array[Object]

An array consisting of all element values

An array consisting of all element values

Attributes

Source
NamedTuple.scala
inline def toIArray: IArray[Object]

An immutable array consisting of all element values

An immutable array consisting of all element values

Attributes

Source
NamedTuple.scala
inline def toList: List[Union[V]]

A list consisting of all element values

A list consisting of all element values

Attributes

Source
NamedTuple.scala
inline def toTuple: V

The underlying tuple without the names

The underlying tuple without the names

Attributes

Source
NamedTuple.scala
inline def zip[V2 <: Tuple](that: NamedTuple[N, V2]): NamedTuple[N, Zip[V, V2]]

The named tuple consisting of all elements values of this tuple zipped with corresponding element values in named tuple that. If the two tuples have different sizes, the extra elements of the larger tuple will be disregarded. The names of x and that at the same index must be the same. The result tuple keeps the same names as the operand tuples.

The named tuple consisting of all elements values of this tuple zipped with corresponding element values in named tuple that. If the two tuples have different sizes, the extra elements of the larger tuple will be disregarded. The names of x and that at the same index must be the same. The result tuple keeps the same names as the operand tuples.

Attributes

Source
NamedTuple.scala

Exports

Defined exports

final type DropNames = [NT <: AnyNamedTuple] =>> DropNames[NT]
Exported from NamedTupleDecomposition$

Attributes

Source
NamedTuple.scala
final type Names = [X <: AnyNamedTuple] =>> Names[X]
Exported from NamedTupleDecomposition$

Attributes

Source
NamedTuple.scala