Constructors for expressions
- Companion
- class
Value members
Concrete methods
Creates an expression that will construct the value x
Creates an expression that will construct the value x
e.betaReduce
returns an expression that is functionally equivalent to e
,
however if e
is of the form ((y1, ..., yn) => e2)(e1, ..., en)
then it optimizes this the top most call by returning the result of beta-reducing the application.
Otherwise returns expr
.
e.betaReduce
returns an expression that is functionally equivalent to e
,
however if e
is of the form ((y1, ..., yn) => e2)(e1, ..., en)
then it optimizes this the top most call by returning the result of beta-reducing the application.
Otherwise returns expr
.
To retain semantics the argument ei
is bound as val yi = ei
and by-name arguments to def yi = ei
.
Some bindings may be elided as an early optimization.
Returns an expression containing a block with the given statements and ending with the expression
Given list of statements s1 :: s2 :: ... :: Nil
and an expression e
the resulting expression
will be equivalent to '{ $s1; $s2; ...; $e }
.
Returns an expression containing a block with the given statements and ending with the expression
Given list of statements s1 :: s2 :: ... :: Nil
and an expression e
the resulting expression
will be equivalent to '{ $s1; $s2; ...; $e }
.
Creates an expression that will construct a copy of this list
Creates an expression that will construct a copy of this list
Transforms a list of expression
List(e1, e2, ...)
where ei: Expr[T]
to an expression equivalent to
'{ List($e1, $e2, ...) }
typed as an Expr[List[T]]
Creates an expression that will construct a copy of this sequence
Creates an expression that will construct a copy of this sequence
Transforms a sequence of expression
Seq(e1, e2, ...)
where ei: Expr[T]
to an expression equivalent to
'{ Seq($e1, $e2, ...) }
typed as an Expr[Seq[T]]
Given a tuple of the form (Expr[A1], ..., Expr[An])
, outputs a tuple Expr[(A1, ..., An)]
.
Given a tuple of the form (Expr[A1], ..., Expr[An])
, outputs a tuple Expr[(A1, ..., An)]
.
Creates an expression that will construct a copy of this tuple
Creates an expression that will construct a copy of this tuple
Transforms a sequence of expression
Seq(e1, e2, ...)
where ei: Expr[Any]
to an expression equivalent to
'{ ($e1, $e2, ...) }
typed as an Expr[Tuple]
Find a given instance of type T
in the current scope.
Return Some
containing the expression of the implicit or
None
if implicit resolution failed.
Find a given instance of type T
in the current scope.
Return Some
containing the expression of the implicit or
None
if implicit resolution failed.
- Type Params
- T
type of the implicit parameter
Get Some
of a copy of the value if the expression contains a literal constant or constructor of T
.
Otherwise returns None
.
Get Some
of a copy of the value if the expression contains a literal constant or constructor of T
.
Otherwise returns None
.
Usage:
case '{ ... ${expr @ Expr(value)}: T ...} =>
// expr: Expr[T]
// value: T
To directly get the value of an expression expr: Expr[T]
consider using expr.value
/expr.valueOrError
instead.