JSFutureCpsMonad

class Object
trait Matchable
class Any

Type members

Inherited types

type Monad[X] = F[X]
type WF[X] = F[X]
Inherited from:
CpsMonad
Source:
CpsMonad.scala

Value members

Concrete methods

def error[A](ex: Throwable): JSFuture[A]
def flatMap[A, B](fa: JSFuture[A])(f: A => JSFuture[B]): JSFuture[B]
def flatMapTry[A, B](fa: JSFuture[A])(f: Try[A] => JSFuture[B]): JSFuture[B]
def map[A, B](fa: JSFuture[A])(f: A => B): JSFuture[B]
override def mapTry[A, B](fa: JSFuture[A])(f: Try[A] => B): JSFuture[B]
Definition Classes
Source:
JSFuture.scala
def pure[A](a: A): JSFuture[A]

Inherited methods

def adoptAwait[A](fa: JSFuture[A]): JSFuture[A]

If is it statically known, that monad is evaluated in this context, then this call is completely eliminated by dotty-cps-async macro

If is it statically known, that monad is evaluated in this context, then this call is completely eliminated by dotty-cps-async macro

Returns:

fa

Inherited from:
CpsMonadInstanceContext
Source:
CpsMonadContext.scala
def apply[T](op: Context => JSFuture[T]): JSFuture[T]

run with this instance

run with this instance

Inherited from:
CpsMonadInstanceContext
Source:
CpsMonadContext.scala
def fromTry[A](r: Try[A]): JSFuture[A]

transform r into pure value or error.

transform r into pure value or error.

Inherited from:
CpsTryMonad
Source:
CpsMonad.scala
def mapTryAsync[A, B](fa: JSFuture[A])(f: Try[A] => JSFuture[B]): JSFuture[B]

synonym for flatMapTry needed for processing awaits inside mapTry.

synonym for flatMapTry needed for processing awaits inside mapTry.

Inherited from:
CpsTryMonad
Source:
CpsMonad.scala
def restore[A](fa: JSFuture[A])(fx: Throwable => JSFuture[A]): JSFuture[A]

restore fa, ie if fa sucessful - return fa, otherwise apply fx to received error.

restore fa, ie if fa sucessful - return fa, otherwise apply fx to received error.

Inherited from:
CpsTryMonad
Source:
CpsMonad.scala
def tryImpure[A](a: => JSFuture[A]): JSFuture[A]

try to evaluate async operation and wrap successful or failed result into F.

try to evaluate async operation and wrap successful or failed result into F.

Inherited from:
CpsTryMonad
Source:
CpsMonad.scala
def tryPure[A](a: => A): JSFuture[A]

try to evaluate synchonious operation and wrap successful or failed result into F.

try to evaluate synchonious operation and wrap successful or failed result into F.

Inherited from:
CpsTryMonad
Source:
CpsMonad.scala
def tryPureAsync[A](a: () => JSFuture[A]): JSFuture[A]

async shift of tryPure.

async shift of tryPure.

Inherited from:
CpsTryMonad
Source:
CpsMonad.scala
def withAction[A](fa: JSFuture[A])(action: => Unit): JSFuture[A]

ensure that action will run before getting value from fa

ensure that action will run before getting value from fa

Inherited from:
CpsTryMonad
Source:
CpsMonad.scala
def withActionAsync[A](fa: JSFuture[A])(action: () => JSFuture[Unit]): JSFuture[A]

async shift of withAction.

async shift of withAction.

This method is substituted instead withAction, when we use await inside withAction argument.

Inherited from:
CpsTryMonad
Source:
CpsMonad.scala
def withAsyncAction[A](fa: JSFuture[A])(action: => JSFuture[Unit]): JSFuture[A]

return result of fa after completition of action.

return result of fa after completition of action.

Inherited from:
CpsTryMonad
Source:
CpsMonad.scala