SyncIO
- Companion
- class
trait Sum
trait Mirror
trait SyncIOLowPriorityImplicits
trait SyncIOCompanionPlatform
class Object
trait Matchable
class Any
Type members
Inherited classlikes
Value members
Methods
Suspends a synchronous side effect in
SyncIO
.Any exceptions thrown by the effect will be caught and sequenced
into the
into the
SyncIO
.- Value Params
- thunk
-
side effectful expression to be suspended in
SyncIO
- Returns
-
a
SyncIO
that will be evaluated to the side effectful expressionthunk
Suspends a synchronous side effect which produces a
SyncIO
in SyncIO
.This is useful for trampolining (i.e. when the side effect is
conceptually the allocation of a stack frame). Any exceptions
thrown by the side effect will be caught and sequenced into the
conceptually the allocation of a stack frame). Any exceptions
thrown by the side effect will be caught and sequenced into the
SyncIO
.- Value Params
- thunk
-
SyncIO
expression to be suspended inSyncIO
- Returns
-
a
SyncIO
that will be evaluated to the value of the suspendedthunk
Lifts an
Eval
into SyncIO
.This function will preserve the evaluation semantics of any
actions that are lifted into the pure
instances will be converted into thunk-less
actions that are lifted into the pure
SyncIO
. Eager Eval
instances will be converted into thunk-less
SyncIO
(i.e. eagerSyncIO
), while lazy eval and memoized will be executed as such.- Value Params
- fa
-
Eval
instance to be lifted inSyncIO
- Returns
-
SyncIO
that will be evaluated to the value of the liftedfa
Suspends a pure value in
SyncIO
.This should ''only'' be used if the value in question has
"already" been computed! In other words, something like
However,
(when evaluated) than
extra thunks.
"already" been computed! In other words, something like
SyncIO.pure(readLine)
is most definitely not the right thing to do!However,
SyncIO.pure(42)
is correct and will be more efficient(when evaluated) than
SyncIO(42)
, due to avoiding the allocation ofextra thunks.
- Value Params
- value
-
precomputed value used as the result of the
SyncIO
- Returns
-
an already evaluated
SyncIO
holdingvalue
Constructs a
SyncIO
which sequences the specified exception.If this
be thrown. This exception can be "caught" (or rather, materialized
into value-space) using the
SyncIO
is run using unsafeRunSync
the exception willbe thrown. This exception can be "caught" (or rather, materialized
into value-space) using the
attempt
method.- Value Params
- t
-
java.lang.Throwable value to fail with
- Returns
-
a
SyncIO
that results in failure with valuet
- See also
Lifts an
it exists.
Either[Throwable, A]
into SyncIO
, raising the throwable ifit exists.
- Value Params
- e
-
either value to be lifted
- Returns
-
SyncIO
that evaluates to the value ofe
or fail with itsThrowable
instance