NamedTuple

scala.NamedTuple
object NamedTuple

Attributes

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

The type of the concatenation of two tuples X and Y.

The type of the concatenation of two tuples X and Y.

Attributes

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

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

The type of the empty named tuple.

The type of the empty named tuple.

Attributes

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 tuple, 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 tuple, From[T] is the same as T.

Attributes

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

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

The type of the last element value of a named tuple.

The type of the last element value of a named tuple.

Attributes

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

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

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

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

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

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

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

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

Value members

Concrete methods

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

A named tuple expression will desugar to a call to build. For instance, (name = "Lyra", age = 23) will desugar to build[("name", "age")]()(("Lyra", 23)).

A named tuple expression will desugar to a call to build. For instance, (name = "Lyra", age = 23) will desugar to build[("name", "age")]()(("Lyra", 23)).

Attributes

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

Concrete fields

val Empty: Empty

The empty named tuple.

The empty named tuple.

Attributes

Givens

Givens

The ordering instance for named tuples.

The ordering instance for named tuples.

Attributes

Extensions

Extensions

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

The underlying tuple without the names.

The underlying tuple without the names.

Attributes

Exports

Defined exports

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