CpsMonad

cps.CpsMonad
See theCpsMonad companion object
trait CpsMonad[F[_]]

Basic CpsMonad operations. Implementing this typeclass is enough to use async/await with supports of basic control-flow constructions (if, loops, but no exceptions).

Attributes

Companion
object
Source
CpsMonad.scala
Graph
Supertypes
class Object
trait Matchable
class Any
Known subtypes

Members list

Type members

Types

Attributes

Source
CpsMonad.scala
type WF[X] = F[X]

Attributes

Source
CpsMonad.scala

Value members

Abstract methods

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

run op in the context environment.

run op in the context environment.

Attributes

Source
CpsMonad.scala
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

Attributes

Source
CpsMonad.scala
def map[A, B](fa: F[A])(f: A => B): F[B]

map a function f over fa

map a function f over fa

Attributes

Source
CpsMonad.scala
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.

Attributes

Source
CpsMonad.scala

Concrete methods

def flatWrap[T](op: => F[T]): F[T]

Wrap and flatten of monadic expression..

Wrap and flatten of monadic expression..

Attributes

Source
CpsMonad.scala
def flatten[T](ffa: F[F[T]]): F[T]

Attributes

Source
CpsMonad.scala
def wrap[T](op: => T): F[T]

Create monadic expression according to the default operation of choosen monad types. (i.e. delaying for effect monads, starting for eager monand, pure by default)

Create monadic expression according to the default operation of choosen monad types. (i.e. delaying for effect monads, starting for eager monand, pure by default)

Attributes

Source
CpsMonad.scala