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/scala.quoted/Quotes/reflectModule/TermModule

TermModule

scala.quoted.Quotes.reflectModule.TermModule

Methods of the module objectval Term

Attributes

Source
Quotes.scala
Graph
Supertypes
classObject
traitMatchable
classAny
Self type
Quotes.this.reflectModule.this.Term.type

Members list

Value members

Abstract methods

Returns a term that is functionally equivalent tot, however ift is of the form((y1, ..., yn) => e2)(e1, ..., en) then it optimizes the top most call by returningSome with the result of beta-reducing the function application. Similarly, all outermost curried function applications will be beta-reduced, if possible. Otherwise returnsNone.

Returns a term that is functionally equivalent tot, however ift is of the form((y1, ..., yn) => e2)(e1, ..., en) then it optimizes the top most call by returningSome with the result of beta-reducing the function application. Similarly, all outermost curried function applications will be beta-reduced, if possible. Otherwise returnsNone.

To retain semantics the argumentei is bound asval yi = ei and by-name arguments todef yi = ei. Some bindings may be elided as an early optimization.

Example:

((a: Int, b: Int) => a + b).apply(x, y)

will be reduced to

val a = xval b = ya + b

Generally:

([X1, Y1, ...] => (x1, y1, ...) => ... => [Xn, Yn, ...] => (xn, yn, ...) => f[X1, Y1, ..., Xn, Yn, ...](x1, y1, ..., xn, yn, ...))).apply[Tx1, Ty1, ...](myX1, myY1, ...)....apply[Txn, Tyn, ...](myXn, myYn, ...)

will be reduced to

type X1 = Tx1type Y1 = Ty1...val x1 = myX1val y1 = myY1...type Xn = Txntype Yn = Tyn...val xn = myXnval yn = myYn...f[X1, Y1, ..., Xn, Yn, ...](x1, y1, ..., xn, yn, ...)

Attributes

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

[8]ページ先頭

©2009-2025 Movatter.jp