CpsMonadInstanceContext

trait CpsMonadInstanceContext[F[_]] extends CpsMonad[F]

Trait for minimal monad context, which provides an instance of CpsMonad. Mixin this trait into your monad in cases, when you monad have no internal API.

trait CpsMonad[F]
trait CpsAwaitable[F]
class Object
trait Matchable
class Any
object FreeCpsMonad.type

Type members

Inherited types

type WF[X] = F[X]
Inherited from:
CpsMonad

Value members

Concrete methods

def adoptAwait[A](fa: F[A]): F[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

def apply[T](op: Context => F[T]): F[T]

run with this instance

run with this instance

Inherited methods

def flatMap[A, B](fa: F[A])(f: A => F[B]): F[B]

bind combinator, which compose f over fa

bind combinator, which compose f over fa

Inherited from:
CpsMonad
def lazyPure[T](op: => T): F[T]

Lazy variant of pure, which by default - create monadic expression according to the choosen monad types. (i.e. delaing for effect monads, starting for eager monand, pure by defiault)

Lazy variant of pure, which by default - create monadic expression according to the choosen monad types. (i.e. delaing for effect monads, starting for eager monand, pure by defiault)

Inherited from:
CpsMonad
def map[A, B](fa: F[A])(f: A => B): F[B]

map a function f over fa

map a function f over fa

Inherited from:
CpsMonad
def pure[T](t: T): F[T]

Pure - wrap value t inside monad.

Pure - wrap value t inside monad.

Note, that pure use eager evaluation, which is different from Haskell.

Inherited from:
CpsMonad