Returns an F[A]
that evaluates the provided by-name fa
parameter on each run.
Returns an F[A]
that evaluates the provided by-name fa
parameter on each run. In essence it builds an F[A]
factory.
Constructor for F[A]
that's going to evaluate the
given by-name value in the F
context, with whatever
properties this data-type may have (e.g.
Constructor for F[A]
that's going to evaluate the
given by-name value in the F
context, with whatever
properties this data-type may have (e.g. lazy, async,
exceptions catching, etc).
For pure expressions, in case F[_]
also implements the
Applicative
type-class, then this operation should yield
a value that's equivalent with pure(f)
.
In case this is an applicative, should be isomorphic to:
F.pure(()).map(_ => F.pure(f))
In case F[_]
implements ApplicativeError[Throwable, F]
,
then eval(throw ex)
should be equivalent with raiseError(ex)
.
Describes data types that allows for arbitrarily delaying the evaluation of an operation, triggering its execution on each run.
Instances of this type-class have the following properties:
always
semantics, meaning that on each evaluation ofF[_]
, any captured side-effects get repeatedIf the data type also has a Monad implementation, then this operation is isomorphic to:
F.pure(()).flatMap(_ => fa)