ComputationExtensions

turbolift.internals.extensions.ComputationExtensions

No need to use this trait directly, because it's inherited by Computation's companion object.

Attributes

Graph
Supertypes
class Object
trait Matchable
class Any
Known subtypes
object Computation.type

Members list

Extensions

Extensions

extension [A](thiz: Computation[A, Any])(thiz: Computation[A, Any])
def run(using mode: Mode): A

Runs the computation, provided that it requests no effects.

Runs the computation, provided that it requests no effects.

Attributes

def runMT: A
def runST: A
extension [A, U >: IO](thiz: Computation[A, U])(thiz: Computation[A, U])
def unsafeRun(using mode: Mode): Try[A]

Runs the computation, provided that it requests IO effect only, or none at all.

Runs the computation, provided that it requests IO effect only, or none at all.

Attributes

def unsafeRunAsync(using mode: Mode)(callback: Try[A] => Unit): Unit
def unsafeRunMT: Try[A]
def unsafeRunST: Try[A]
extension [A, U](thiz: Computation[A, U])(thiz: Computation[A, U])
def >>=![F[_], L, N](f: A => Handler[[X] =>> X, F, L, N]): Handler[[X] =>> X, F, L, U & N]

Simplifies effectful creation of handlers.

Simplifies effectful creation of handlers.

Passes computed value to handler constructor. Effect used to compute the value, are absorbed by the handler, into its own dependencies.

Attributes

def >>=![F[_], L, N](f: A => Handler[[_] =>> A, F, L, N]): Handler[[_] =>> A, F, L, U & N]

Simplifies effectful creation of handlers.

Simplifies effectful creation of handlers.

Passes computed value to handler constructor. Effect used to compute the value, are absorbed by the handler, into its own dependencies.

Attributes

def downCast[U2 >: U]: Computation[A, U2]
def handleWith[V]: HandleWithApply[A, U, V]

Applies a handler to this computation.

Applies a handler to this computation.

Same as myHandler.handle(this).

Attributes

extension [F[_], G[_], L, N](thiz: Computation[Handler[F, G, L, N], N])(thiz: Computation[Handler[F, G, L, N], N])
def flattenHandler: Handler[F, G, L, N]

Simplifies effectful creation of handlers.

Simplifies effectful creation of handlers.

Same as Handler.flatHandle(this).

Attributes

extension [A, B, U](thiz: Computation[(A, B), U])(thiz: Computation[(A, B), U])
def flatMap2[C, U2 <: U](f: (A, B) => Computation[C, U2]): Computation[C, U2]
def map2[C](f: (A, B) => C): Computation[C, U]
extension [U](thiz: Computation[Boolean, U])(thiz: Computation[Boolean, U])
def if_!![U2 <: U](thenBody: => Computation[Unit, U2])(elseBody: => Computation[Unit, U2]): Computation[Unit, U2]

Like if statement, but the condition and the body are computations.

Like if statement, but the condition and the body are computations.

Attributes

def until_!![U2 <: U](body: => Computation[Unit, U2]): Computation[Unit, U2]

Like while statement, but the condition and the body are computations.

Like while statement, but the condition and the body are computations.

Attributes

def while_!![U2 <: U](body: => Computation[Unit, U2]): Computation[Unit, U2]

Like while statement, but the condition and the body are computations.

Like while statement, but the condition and the body are computations.

Attributes