ByName

final
class ByName[+T](expression: => T) extends () => T

Provides a wrapper for by-name expressions with the intent that they can become eligible for implicit conversions and implicit resolution.

Type Params
T

Result type of the evaluated expression

Value Params
expression

A by-name parameter that will yield a result of type T when evaluated

Companion
object
trait () => T
class Object
trait Matchable
class Any

Value members

Concrete methods

def apply(): T

Evaluates the given expression every time without memoizing the result.

Evaluates the given expression every time without memoizing the result.

Returns

Result of type T when evaluating the provided expression.

def map[U](fn: T => U): ByName[U]

Lazily maps the given expression of type T to type U.

Lazily maps the given expression of type T to type U.

Inherited methods

override
def toString(): String
Definition Classes
Function0 -> Any
Inherited from
Function0