Effect

object Effect
Companion:
class
trait Sum
trait Mirror
class Object
trait Matchable
class Any
Effect.type

Type members

Inherited types

type MirroredElemLabels <: Tuple

The names of the product elements

The names of the product elements

Inherited from:
Mirror
type MirroredLabel <: String

The name of the type

The name of the type

Inherited from:
Mirror

Value members

Concrete methods

def apply[A](a: => A): Effect[A]

Creates an effect that, when successful, will produce given value, execution is suspended until the effect is run

Creates an effect that, when successful, will produce given value, execution is suspended until the effect is run

Type parameters:
A

type of the value to produce

Value parameters:
a

success value to produce

Returns:

an effect that, when successful, will produce given value

def callback[A](complete: (Result[A] => Any) => Any): Effect[A]

Creates an effect from a callback-based code, leaving completion logic to the caller to bring arbitrary asynchronous code into a functional effect

Creates an effect from a callback-based code, leaving completion logic to the caller to bring arbitrary asynchronous code into a functional effect

Value parameters:
complete

completion callback to call with a result

Returns:

an effect from a callback-based code

def error(e: E): Effect[Nothing]

Creates an effect that fails with given error

Creates an effect that fails with given error

Value parameters:
e

error to produce

Returns:

an effect that fails with given error

def unexpectedError(throwable: Throwable): Effect[Nothing]

Creates an effect that fails with given unexpected error

Creates an effect that fails with given unexpected error

Value parameters:
throwable

unexpected error to produce

Returns:

an effect that fails with given unexpected error

Concrete fields

val unit: Effect[Unit]

Successful effect yielding Unit value

Successful effect yielding Unit value