Movatterモバイル変換


[0]ホーム

URL:


Scala 3
3.7.4
LearnInstallPlaygroundFind A LibraryCommunityBlog
Scala 3
LearnInstallPlaygroundFind A LibraryCommunityBlog
DocsAPI
Generated with
Copyright (c) 2002-2025, LAMP/EPFL
Copyright (c) 2002-2025, LAMP/EPFL
Scala 3/scala/Tuple

Tuple

scala.Tuple
See theTuple companion trait
objectTuple

Attributes

Companion
trait
Source
Tuple.scala
Graph
Supertypes
classObject
traitMatchable
classAny
Self type
Tuple.type

Members list

Type members

Types

infixtype++[X <:Tuple,+Y <:Tuple] =Concat[X,Y]

An infix shorthand forConcat[X, Y]

An infix shorthand forConcat[X, Y]

Attributes

Source
Tuple.scala
infixtype:*[X <:Tuple,Y] =Append[X,Y]

An infix shorthand forAppend[X, Y]

An infix shorthand forAppend[X, Y]

Attributes

Source
Tuple.scala
typeAppend[X <:Tuple,Y] =X match{ caseEmptyTuple =>Y*:EmptyTuple casex*:xs =>x*:Append[xs,Y] }

Type of a tuple with an element appended

Type of a tuple with an element appended

Attributes

Source
Tuple.scala
typeConcat[X <:Tuple,+Y <:Tuple] =X match{ caseEmptyTuple =>Y casex1*:xs1 =>x1*:Concat[xs1,Y] }

Type of the concatenation of two tuples

Type of the concatenation of two tuples

Attributes

Source
Tuple.scala
typeContains[X <:Tuple,Y] =X match{ caseY*:_$13 =>true case_$14*:xs =>Contains[xs,Y] caseEmptyTuple =>false }

A type level Boolean indicating whether the tupleX has an element that matchesY.

A type level Boolean indicating whether the tupleX has an element that matchesY.

Attributes

Source
Tuple.scala
typeDisjoint[X <:Tuple,Y <:Tuple] =X match{ casex*:xs =>Contains[Y,x] match{ casetrue =>false casefalse =>Disjoint[xs,Y] } caseEmptyTuple =>true }

A type level Boolean indicating whether the typeY contains none of the elements ofX.

A type level Boolean indicating whether the typeY contains none of the elements ofX.

Attributes

Source
Tuple.scala
typeDrop[T <:Tuple,N <:Int] =N match{ case0 =>T caseS[n1] =>T match{ caseEmptyTuple =>EmptyTuple casex*:xs =>Drop[xs,n1] } }

Transforms a tuple(T1, ..., Tn) into(Ti+1, ..., Tn).

Transforms a tuple(T1, ..., Tn) into(Ti+1, ..., Tn).

Attributes

Source
Tuple.scala
typeElem[X <:Tuple,N <:Int] =X match{ casex*:xs =>N match{ case0 =>x caseS[n1] =>Elem[xs,n1] } }

Type of the element at position N in the tuple X

Type of the element at position N in the tuple X

Attributes

Source
Tuple.scala
typeFilter[Tup <:Tuple,P <:([_ <:Union[Tup]] =>>Boolean)] =Tup match{ caseEmptyTuple =>EmptyTuple caseh*:t =>P[h] match{ casetrue =>h*:Filter[t,P] casefalse =>Filter[t,P] } }

Filters out those members of the tuple for which the predicateP returnsfalse. A predicateP[X] is a type that can be eithertrue orfalse. For example:

Filters out those members of the tuple for which the predicateP returnsfalse. A predicateP[X] is a type that can be eithertrue orfalse. For example:

type IsString[x] <: Boolean = x match {  case String => true  case _ => false}summon[Tuple.Filter[(1, "foo", 2, "bar"), IsString] =:= ("foo", "bar")]

Attributes

Source
Tuple.scala
typeFlatMap[Tup <:Tuple,F <:([_ <:Union[Tup]] =>>Tuple)] =Tup match{ caseEmptyTuple =>EmptyTuple caseh*:t =>Concat[F[h],FlatMap[t,F]] }

Converts a tuple(T1, ..., Tn) to a flattened(..F[T1], ..., ..F[Tn])

Converts a tuple(T1, ..., Tn) to a flattened(..F[T1], ..., ..F[Tn])

Attributes

Source
Tuple.scala
typeFold[Tup <:Tuple,Z,F[_,_]] =Tup match{ caseEmptyTuple =>Z caseh*:t =>F[h,Fold[t,Z,F]] }

Fold a tuple(T1, ..., Tn) intoF[T1, F[... F[Tn, Z]...]]]

Fold a tuple(T1, ..., Tn) intoF[T1, F[... F[Tn, Z]...]]]

Attributes

Source
Tuple.scala
typeHead[X <:Tuple] =X match{ casex*:_$15 =>x }

Type of the head of a tuple

Type of the head of a tuple

Attributes

Source
Tuple.scala
typeInit[X <:Tuple] =X match{ case_$11*:EmptyTuple =>EmptyTuple casex*:xs =>x*:Init[xs] }

Type of the initial part of the tuple without its last element

Type of the initial part of the tuple without its last element

Attributes

Source
Tuple.scala
typeInverseMap[X <:Tuple,F[_]] =X match{ caseF[x]*:t =>x*:InverseMap[t,F] caseEmptyTuple =>EmptyTuple }

Converts a tuple(F[T1], ..., F[Tn]) to(T1, ... Tn)

Converts a tuple(F[T1], ..., F[Tn]) to(T1, ... Tn)

Attributes

Source
Tuple.scala
typeIsMappedBy[F[_]] = [X <:Tuple] =>>X=:=Map[InverseMap[X,F],F]

Implicit evidence. IsMappedBy[F][X] is present in the implicit scope iff X is a tuple for which each element's type is constructed viaF. E.g. (F[A1], ..., F[An]), but not(F[A1], B2, ..., F[An]) where B2 does not have the shape ofF[A].

Implicit evidence. IsMappedBy[F][X] is present in the implicit scope iff X is a tuple for which each element's type is constructed viaF. E.g. (F[A1], ..., F[An]), but not(F[A1], B2, ..., F[An]) where B2 does not have the shape ofF[A].

Attributes

Source
Tuple.scala
typeLast[X <:Tuple] =X match{ casex*:EmptyTuple =>x case_$12*:xs =>Last[xs] }

Type of the last element of a tuple

Type of the last element of a tuple

Attributes

Source
Tuple.scala
typeMap[Tup <:Tuple,F[_ <:Union[Tup]]] =Tup match{ caseEmptyTuple =>EmptyTuple caseh*:t =>F[h]*:Map[t,F] }

Converts a tuple(T1, ..., Tn) to(F[T1], ..., F[Tn])

Converts a tuple(T1, ..., Tn) to(F[T1], ..., F[Tn])

Attributes

Source
Tuple.scala

Type of the reversed tuple

Type of the reversed tuple

Attributes

Source
Tuple.scala
typeReverseOnto[From <:Tuple,+To <:Tuple] =From match{ casex*:xs =>ReverseOnto[xs,x*:To] caseEmptyTuple =>To }

Prepends all elements of a tuple in reverse order onto the other tuple

Prepends all elements of a tuple in reverse order onto the other tuple

Attributes

Source
Tuple.scala
typeSize[X <:Tuple] =X match{ caseEmptyTuple =>0 casex*:xs =>S[Size[xs]] }

Literal constant Int size of a tuple

Literal constant Int size of a tuple

Attributes

Source
Tuple.scala
typeSplit[T <:Tuple,N <:Int] = (Take[T,N],Drop[T,N])

Splits a tuple (T1, ..., Tn) into a pair of two tuples(T1, ..., Ti) and(Ti+1, ..., Tn).

Splits a tuple (T1, ..., Tn) into a pair of two tuples(T1, ..., Ti) and(Ti+1, ..., Tn).

Attributes

Source
Tuple.scala
typeTail[X <:Tuple] =X match{ case_$16*:xs =>xs }

Type of the tail of a tuple

Type of the tail of a tuple

Attributes

Source
Tuple.scala
typeTake[T <:Tuple,N <:Int] =N match{ case0 =>EmptyTuple caseS[n1] =>T match{ caseEmptyTuple =>EmptyTuple casex*:xs =>x*:Take[xs,n1] } }

Transforms a tuple(T1, ..., Tn) into(T1, ..., Ti).

Transforms a tuple(T1, ..., Tn) into(T1, ..., Ti).

Attributes

Source
Tuple.scala
typeUnion[T <:Tuple] =Fold[T,Nothing, [x,y] =>>x |y]

Given a tuple(T1, ..., Tn), returns a union of its member types:T1 | ... | Tn. ReturnsNothing if the tuple is empty.

Given a tuple(T1, ..., Tn), returns a union of its member types:T1 | ... | Tn. ReturnsNothing if the tuple is empty.

Attributes

Source
Tuple.scala
typeZip[T1 <:Tuple,T2 <:Tuple] = (T1,T2) match{ case(h1*:t1,h2*:t2) =>(h1,h2)*:Zip[t1,t2] caseAny =>EmptyTuple }

Given two tuples,A1 *: ... *: An * At andB1 *: ... *: Bn *: Bt where at least one ofAt orBt isEmptyTuple, returns the tuple type(A1, B1) *: ... *: (An, Bn) *: EmptyTuple.

Given two tuples,A1 *: ... *: An * At andB1 *: ... *: Bn *: Bt where at least one ofAt orBt isEmptyTuple, returns the tuple type(A1, B1) *: ... *: (An, Bn) *: EmptyTuple.

Attributes

Source
Tuple.scala

Value members

Concrete methods

Empty tuple

Empty tuple

Attributes

Source
Tuple.scala
defapply[T](x:T):T*:EmptyTuple

Tuple with one element

Tuple with one element

Attributes

Source
Tuple.scala
deffromArray[T](xs:Array[T]):Tuple

Convert an array into a tuple of unknown arity and types

Convert an array into a tuple of unknown arity and types

Attributes

Source
Tuple.scala
deffromIArray[T](xs:IArray[T]):Tuple

Convert an immutable array into a tuple of unknown arity and types

Convert an immutable array into a tuple of unknown arity and types

Attributes

Source
Tuple.scala

Convert a Product into a tuple of unknown arity and types

Convert a Product into a tuple of unknown arity and types

Attributes

Source
Tuple.scala
deffromProductTyped[P <:Product](p:P)(usingm:ProductOf[P]): m.MirroredElemTypes

Attributes

Source
Tuple.scala
defunapply(x:EmptyTuple): true

Matches an empty tuple.

Matches an empty tuple.

Attributes

Source
Tuple.scala

Givens

Givens

givencanEqualTuple[H1,T1 <:Tuple,H2,T2 <:Tuple](usingeqHead:CanEqual[H1,H2],eqTail:CanEqual[T1,T2]):CanEqual[H1*:T1,H2*:T2]

Attributes

Source
Tuple.scala
In this article
Generated with
Copyright (c) 2002-2025, LAMP/EPFL
Copyright (c) 2002-2025, LAMP/EPFL

[8]ページ先頭

©2009-2025 Movatter.jp