SyncIO

object SyncIO extends SyncIOInstances
Companion
class
class SyncIOInstances
class SyncIOLowPriorityInstances
class Object
trait Matchable
class Any

Value members

Concrete methods

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.

def eval[A](fa: Eval[A]): SyncIO[A]

Lifts an Eval into SyncIO.

Lifts an Eval into SyncIO.

This function will preserve the evaluation semantics of any actions that are lifted into the pure SyncIO. Eager Eval instances will be converted into thunk-less SyncIO (i.e. eager SyncIO), while lazy eval and memoized will be executed as such.

def fromEither[A](e: Either[Throwable, A]): SyncIO[A]

Lifts an Either[Throwable, A] into the SyncIO[A] context, raising the throwable if it exists.

Lifts an Either[Throwable, A] into the SyncIO[A] context, raising the throwable if it exists.

def pure[A](a: 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) than SyncIO(42), due to avoiding the allocation of extra thunks.

def raiseError[A](e: Throwable): SyncIO[A]

Constructs a SyncIO which sequences the specified exception.

Constructs a SyncIO which sequences the specified exception.

If this SyncIO is run using unsafeRunSync the exception will be thrown. This exception can be "caught" (or rather, materialized into value-space) using the attempt method.

See also
def suspend[A](thunk: => SyncIO[A]): SyncIO[A]

Suspends a synchronous side effect which produces a SyncIO in SyncIO.

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 SyncIO.

Concrete fields

val unit: SyncIO[Unit]

Alias for SyncIO.pure(()).

Alias for SyncIO.pure(()).

Deprecated and Inherited fields

@deprecated("Signature changed to return SyncEffect", "2.1.0")
val syncIoSync: Sync[[A] =>> SyncIO[A]]
Deprecated
Inherited from
SyncIOInstances

Implicits

Inherited implicits

implicit val syncIOalign: Align[[A] =>> SyncIO[A]]
Inherited from
SyncIOInstances
implicit val syncIOsyncEffect: SyncEffect[[A] =>> SyncIO[A]]
Inherited from
SyncIOInstances
implicit def syncIoMonoid[A](`evidence$1`: Monoid[A]): Monoid[SyncIO[A]]
Inherited from
SyncIOInstances
implicit def syncIoSemigroup[A](`evidence$3`: Semigroup[A]): Semigroup[SyncIO[A]]
Inherited from
SyncIOLowPriorityInstances
implicit val syncIoSemigroupK: SemigroupK[[A] =>> SyncIO[A]]
Inherited from
SyncIOInstances