SyncIO

cats.effect.SyncIO$
See theSyncIO companion class
object SyncIO

Attributes

Companion
class
Source
SyncIO.scala
Graph
Supertypes
trait Sum
trait Mirror
class Object
trait Matchable
class Any
Self type
SyncIO.type

Members list

Type members

Inherited classlikes

protected class SyncIOSemigroup[A](implicit val A: Semigroup[A]) extends Semigroup[SyncIO[A]]

Attributes

Inherited from:
SyncIOLowPriorityImplicits (hidden)
Source
SyncIO.scala
Supertypes
trait Semigroup[SyncIO[A]]
trait Serializable
class Object
trait Matchable
class Any

Inherited types

type MirroredElemLabels <: Tuple

The names of the product elements

The names of the product elements

Attributes

Inherited from:
Mirror
Source
Mirror.scala

The name of the type

The name of the type

Attributes

Inherited from:
Mirror
Source
Mirror.scala

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.

Value parameters

thunk

side effectful expression to be suspended in SyncIO

Attributes

Returns

a SyncIO that will be evaluated to the side effectful expression thunk

Source
SyncIO.scala
def defer[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.

Value parameters

thunk

SyncIO expression to be suspended in SyncIO

Attributes

Returns

a SyncIO that will be evaluated to the value of the suspended thunk

Source
SyncIO.scala
def delay[A](thunk: => A): SyncIO[A]

Alias for apply.

Alias for apply.

Attributes

See also
Source
SyncIO.scala
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.

Value parameters

fa

Eval instance to be lifted in SyncIO

Attributes

Returns

SyncIO that will be evaluated to the value of the lifted fa

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

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

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

Value parameters

e

either value to be lifted

Attributes

Returns

SyncIO that evaluates to the value of e or fail with its Throwable instance

Source
SyncIO.scala
def fromOption[A](o: Option[A])(orElse: => Throwable): SyncIO[A]

Lifts an Option[A] into SyncIO, raising orElse if the provided option value is empty.

Lifts an Option[A] into SyncIO, raising orElse if the provided option value is empty.

Value parameters

o

option value to be lifted

orElse

expression that evaluates to Throwable

Attributes

Returns

SyncIO that evaluates to the optional value o or fail with the orElse expression

Source
SyncIO.scala
def fromTry[A](t: Try[A]): SyncIO[A]

Lifts a Try[A] into SyncIO, raising the throwable if it exists.

Lifts a Try[A] into SyncIO, raising the throwable if it exists.

Value parameters

t

try value to be lifted

Attributes

Returns

SyncIO that evaluates to the value of t if successful, or fails with its Throwable instance

Source
SyncIO.scala
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) than SyncIO(42), due to avoiding the allocation of extra thunks.

Value parameters

value

precomputed value used as the result of the SyncIO

Attributes

Returns

an already evaluated SyncIO holding value

Source
SyncIO.scala
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 using unsafeRunSync the exception will be thrown. This exception can be "caught" (or rather, materialized into value-space) using the attempt method.

Value parameters

t

Throwable value to fail with

Attributes

Returns

a SyncIO that results in failure with value t

See also
Source
SyncIO.scala
def unit: SyncIO[Unit]

Alias for SyncIO.pure(())

Alias for SyncIO.pure(())

Attributes

See also
Source
SyncIO.scala

Inherited methods

final def realTimeInstant: SyncIO[Instant]

Attributes

Inherited from:
SyncIOCompanionPlatform (hidden)
Source
SyncIOCompanionPlatform.scala

Concrete fields

Attributes

Source
SyncIO.scala

Attributes

Source
SyncIO.scala

Implicits

Implicits

implicit def alignForSyncIO: Align[SyncIO]

Attributes

Source
SyncIO.scala
implicit def monoidForIO[A : Monoid]: Monoid[SyncIO[A]]

Attributes

Source
SyncIO.scala
implicit def showForSyncIO[A](implicit A: Show[A]): Show[SyncIO[A]]

Attributes

Source
SyncIO.scala

Attributes

Source
SyncIO.scala

Inherited implicits

implicit def semigroupForIO[A : Semigroup]: Semigroup[SyncIO[A]]

Attributes

Inherited from:
SyncIOLowPriorityImplicits (hidden)
Source
SyncIO.scala