object SyncIO extends SyncIOLowPriorityImplicits
- Source
- SyncIO.scala
- Alphabetic
- By Inheritance
- SyncIO
- SyncIOLowPriorityImplicits
- AnyRef
- Any
- Hide All
- Show All
- Public
- All
Type Members
Value Members
-
final
def
!=(arg0: Any): Boolean
- Definition Classes
- AnyRef → Any
-
final
def
##(): Int
- Definition Classes
- AnyRef → Any
-
final
def
==(arg0: Any): Boolean
- Definition Classes
- AnyRef → Any
-
def
apply[A](thunk: ⇒ A): SyncIO[A]
Suspends a synchronous side effect in
SyncIO
.Suspends a synchronous side effect in
SyncIO
.Any exceptions thrown by the effect will be caught and sequenced into the
SyncIO
.- thunk
side effectful expression to be suspended in
SyncIO
- returns
a
SyncIO
that will be evaluated to the side effectful expressionthunk
-
final
def
asInstanceOf[T0]: T0
- Definition Classes
- Any
-
def
clone(): AnyRef
- Attributes
- protected[lang]
- Definition Classes
- AnyRef
- Annotations
- @throws( ... ) @native() @HotSpotIntrinsicCandidate()
-
def
defer[A](thunk: ⇒ SyncIO[A]): SyncIO[A]
Suspends a synchronous side effect which produces a
SyncIO
inSyncIO
.Suspends a synchronous side effect which produces a
SyncIO
inSyncIO
.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
SyncIO
.- thunk
SyncIO
expression to be suspended inSyncIO
- returns
a
SyncIO
that will be evaluated to the value of the suspendedthunk
-
def
delay[A](thunk: ⇒ A): SyncIO[A]
Alias for
apply
.Alias for
apply
.- See also
-
final
def
eq(arg0: AnyRef): Boolean
- Definition Classes
- AnyRef
-
def
equals(arg0: Any): Boolean
- Definition Classes
- AnyRef → Any
-
def
eval[A](fa: Eval[A]): SyncIO[A]
Lifts an
Eval
intoSyncIO
.Lifts an
Eval
intoSyncIO
.This function will preserve the evaluation semantics of any actions that are lifted into the pure
SyncIO
. EagerEval
instances will be converted into thunk-lessSyncIO
(i.e. eagerSyncIO
), while lazy eval and memoized will be executed as such.- fa
Eval
instance to be lifted inSyncIO
- returns
SyncIO
that will be evaluated to the value of the liftedfa
-
def
fromEither[A](e: Either[Throwable, A]): SyncIO[A]
Lifts an
Either[Throwable, A]
intoSyncIO
, raising the throwable if it exists.Lifts an
Either[Throwable, A]
intoSyncIO
, raising the throwable if it exists.- e
either value to be lifted
- returns
SyncIO
that evaluates to the value ofe
or fail with itsThrowable
instance
-
def
fromOption[A](o: Option[A])(orElse: ⇒ Throwable): SyncIO[A]
Lifts an
Option[A]
intoSyncIO
, raisingorElse
if the provided option value is empty.Lifts an
Option[A]
intoSyncIO
, raisingorElse
if the provided option value is empty.- o
option value to be lifted
- orElse
expression that evaluates to
Throwable
- returns
SyncIO
that evaluates to the optional valueo
or fail with theorElse
expression
-
def
fromTry[A](t: Try[A]): SyncIO[A]
Lifts a
Try[A]
intoSyncIO
, raising the throwable if it exists.Lifts a
Try[A]
intoSyncIO
, raising the throwable if it exists.- t
try value to be lifted
- returns
SyncIO
that evaluates to the value oft
if successful, or fails with itsThrowable
instance
-
final
def
getClass(): Class[_]
- Definition Classes
- AnyRef → Any
- Annotations
- @native() @HotSpotIntrinsicCandidate()
-
def
hashCode(): Int
- Definition Classes
- AnyRef → Any
- Annotations
- @native() @HotSpotIntrinsicCandidate()
-
final
def
isInstanceOf[T0]: Boolean
- Definition Classes
- Any
- implicit def monoidForIO[A](implicit arg0: kernel.Monoid[A]): kernel.Monoid[SyncIO[A]]
- val monotonic: SyncIO[FiniteDuration]
-
final
def
ne(arg0: AnyRef): Boolean
- Definition Classes
- AnyRef
-
final
def
notify(): Unit
- Definition Classes
- AnyRef
- Annotations
- @native() @HotSpotIntrinsicCandidate()
-
final
def
notifyAll(): Unit
- Definition Classes
- AnyRef
- Annotations
- @native() @HotSpotIntrinsicCandidate()
-
def
pure[A](value: A): SyncIO[A]
Suspends a pure value in
SyncIO
.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
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) thanSyncIO(42)
, due to avoiding the allocation of extra thunks.- value
precomputed value used as the result of the
SyncIO
- returns
an already evaluated
SyncIO
holdingvalue
-
def
raiseError[A](t: Throwable): SyncIO[A]
Constructs a
SyncIO
which sequences the specified exception.Constructs a
SyncIO
which sequences the specified exception.If this
SyncIO
is run usingunsafeRunSync
the exception will be thrown. This exception can be "caught" (or rather, materialized into value-space) using theattempt
method.- t
Throwable value to fail with
- returns
a
SyncIO
that results in failure with valuet
- See also
- val realTime: SyncIO[FiniteDuration]
-
implicit
def
semigroupForIO[A](implicit arg0: kernel.Semigroup[A]): kernel.Semigroup[SyncIO[A]]
- Definition Classes
- SyncIOLowPriorityImplicits
- implicit def showForSyncIO[A](implicit A: Show[A]): Show[SyncIO[A]]
- implicit def syncEffectForSyncIO: SyncEffect[SyncIO]
-
final
def
synchronized[T0](arg0: ⇒ T0): T0
- Definition Classes
- AnyRef
-
def
toK[F[_]](implicit arg0: Sync[F]): ~>[SyncIO, F]
SyncIO#to
as a natural transformation.SyncIO#to
as a natural transformation.- See also
-
def
toString(): String
- Definition Classes
- AnyRef → Any
-
def
unit: SyncIO[Unit]
Alias for
SyncIO.pure(())
Alias for
SyncIO.pure(())
- See also
-
final
def
wait(arg0: Long, arg1: Int): Unit
- Definition Classes
- AnyRef
- Annotations
- @throws( ... )
-
final
def
wait(arg0: Long): Unit
- Definition Classes
- AnyRef
- Annotations
- @throws( ... ) @native()
-
final
def
wait(): Unit
- Definition Classes
- AnyRef
- Annotations
- @throws( ... )
Deprecated Value Members
-
def
finalize(): Unit
- Attributes
- protected[lang]
- Definition Classes
- AnyRef
- Annotations
- @throws( classOf[java.lang.Throwable] ) @Deprecated
- Deprecated