cps.monads

package cps.monads

Members list

Type members

Classlikes

sealed trait AsyncFreeMonad[+T]

FreeCpsMonad with async support. Used when you want use test free monad with API which uses callbacks.

FreeCpsMonad with async support. Used when you want use test free monad with API which uses callbacks.

Attributes

Companion
object
Source
FreeCpsMonad.scala
Supertypes
class Object
trait Matchable
class Any
Known subtypes
class Error
class FlatMap[A, B]
class FlatMapTry[A, B]
class Pure[A]

Attributes

Companion
trait
Source
FreeCpsMonad.scala
Supertypes
trait Sum
trait Mirror
class Object
trait Matchable
class Any
Self type
object CompletableFutureCpsMonad extends CpsSchedulingMonad[[T <: <FromJavaObject>] =>> CompletableFuture[T]], CpsTryMonadInstanceContext[[T <: <FromJavaObject>] =>> CompletableFuture[T]]

Attributes

Source
CompletableFutureCpsMonad.scala
Supertypes
trait CpsTryMonadInstanceContext[[T <: <FromJavaObject>] =>> CompletableFuture[T]]
trait CpsSchedulingMonad[[T <: <FromJavaObject>] =>> CompletableFuture[T]]
trait CpsConcurrentMonad[[T <: <FromJavaObject>] =>> CompletableFuture[T]]
trait CpsAsyncMonad[[T <: <FromJavaObject>] =>> CompletableFuture[T]]
trait CpsTryMonad[[T <: <FromJavaObject>] =>> CompletableFuture[T]]
trait CpsTrySupport[[T <: <FromJavaObject>] =>> CompletableFuture[T]]
trait CpsThrowMonad[[T <: <FromJavaObject>] =>> CompletableFuture[T]]
trait CpsThrowSupport[[T <: <FromJavaObject>] =>> CompletableFuture[T]]
trait CpsMonad[[T <: <FromJavaObject>] =>> CompletableFuture[T]]
class Object
trait Matchable
class Any
Show all
Self type

Attributes

Source
FutureAsyncMonad.scala
Supertypes
class Object
trait Matchable
class Any
Known subtypes

Implementation for FreeCpsMonad. It is intentionally defiend at top-level, to fire 'implicitAmbigious' error when async is called without parameters and without select instance of CpsMonad in scope.

Implementation for FreeCpsMonad. It is intentionally defiend at top-level, to fire 'implicitAmbigious' error when async is called without parameters and without select instance of CpsMonad in scope.

Attributes

Source
FreeCpsMonad.scala
Supertypes
class Object
trait Matchable
class Any
Show all
Self type
sealed trait FreeMonad[+T]

FreeCpsMonad Typical pattern - use FreeCpsMonad and custom interpreter in test.

FreeCpsMonad Typical pattern - use FreeCpsMonad and custom interpreter in test.

Attributes

Companion
object
Source
FreeCpsMonad.scala
Supertypes
class Object
trait Matchable
class Any
Known subtypes
class Error
class FlatMap[A, B]
class FlatMapTry[A, B]
class Pure[A]
object FreeMonad

Attributes

Companion
trait
Source
FreeCpsMonad.scala
Supertypes
trait Sum
trait Mirror
class Object
trait Matchable
class Any
Self type
FreeMonad.type
class FutureAsyncMonadAPI(using x$1: ExecutionContext) extends CpsSchedulingMonad[Future], CpsTryContextMonad[Future, FutureContext]

Default CpsMonad implementation for Future

Default CpsMonad implementation for Future

Attributes

Source
FutureAsyncMonad.scala
Supertypes
trait CpsSchedulingMonad[Future]
trait CpsConcurrentMonad[Future]
trait CpsAsyncMonad[Future]
trait CpsTryMonad[Future]
trait CpsTrySupport[Future]
trait CpsThrowMonad[Future]
trait CpsThrowSupport[Future]
trait CpsMonad[Future]
class Object
trait Matchable
class Any
Show all

Attributes

Source
FutureAsyncMonad.scala
Supertypes
trait CpsTryMonadContext[Future]
trait CpsThrowMonadContext[Future]
trait CpsMonadContext[Future]
class Object
trait Matchable
class Any
Show all
class IterableCpsMonad[C <: (IterableOnce)](iterableFactory: IterableFactory[C]) extends CpsThrowMonad[C], CpsThrowMonadInstanceContext[C]

Monad for iterable collection. typical usage:

Monad for iterable collection. typical usage:

  def allpairs[A](l:List[A]):List((A,A)) = reify[List] {
      (reflect(l),reflect(l))
  }

Attributes

Source
IterableCpsMonad.scala
Supertypes
trait CpsThrowMonad[C]
trait CpsThrowSupport[C]
trait CpsMonad[C]
class Object
trait Matchable
class Any
Show all

Attributes

Source
TailRecCpsMonad.scala
Supertypes
trait CpsThrowMonad[TailRec]
trait CpsThrowSupport[TailRec]
trait CpsMonad[TailRec]
class Object
trait Matchable
class Any
Show all
Self type

Types

type CpsIdentity[T] = T

Dependency-less version of IdentityMonad

Dependency-less version of IdentityMonad

Attributes

Source
CpsIdentityMonad.scala

Value members

Concrete methods

transparent inline def timedAwait[A](fa: Future[A], duration: FiniteDuration)(using CpsMonadContext[Future], ExecutionContextProvider, ScheduledExecutorService): A

Timed await -- await for future or throw TimeoutException after duration

Timed await -- await for future or throw TimeoutException after duration

Attributes

Source
TimedAwait.scala
transparent inline def timedReady[A](fa: Future[A], duration: FiniteDuration)(using CpsMonadContext[Future], ExecutionContextProvider, ScheduledExecutorService): Boolean

Attributes

Source
TimedAwait.scala

Givens

Givens

Implementation for FreeCpsMonad. It is intentionally defiend at top-level, to fire 'implicitAmbigious' error when async is called without parameters and without select instance of CpsMonad in scope.

Implementation for FreeCpsMonad. It is intentionally defiend at top-level, to fire 'implicitAmbigious' error when async is called without parameters and without select instance of CpsMonad in scope.

Attributes

Source
FreeCpsMonad.scala
given FutureAsyncMonad(using ec: ExecutionContext): FutureAsyncMonadAPI

Attributes

Source
FutureAsyncMonad.scala
given fromFutureConversion[G[_], T](using ex: ExecutionContext, m: CpsAsyncMonad[G]): fromFutureConversion[G, T]

Attributes

Source
FutureAsyncMonad.scala
given given_CpsMonadConversion_C_Iterable[C <: (Iterable)]: given_CpsMonadConversion_C_Iterable[C]

Attributes

Source
IterableCpsMonad.scala
inline given iterableCpsMonad[C <: (Iterable)]: CpsThrowMonad[C]

Attributes

Source
IterableCpsMonad.scala
given toFutureConversion[F[_], T](using x$1: ExecutionContext, x$2: CpsSchedulingMonad[F]): toFutureConversion[F, T]

Attributes

Source
FutureAsyncMonad.scala

Extensions

Extensions

extension [A](fa: Future[A])
def delayedComplete(duration: FiniteDuration)(a: => Try[A])(using ExecutionContext, ScheduledExecutorService): Future[A]

Create a future which will return true or false fa has no completed duriong duration

Create a future which will return true or false fa has no completed duriong duration

Attributes

Source
TimedAwait.scala
def withDelay(duration: FiniteDuration)(a: => A)(using ExecutionContext, ScheduledExecutorService): Future[A]

Create a future which will return true or false fa has no completed duriong duration

Create a future which will return true or false fa has no completed duriong duration

Attributes

Source
TimedAwait.scala
def withTimeout(duration: FiniteDuration)(using ExecutionContext, ScheduledExecutorService): Future[A]

Create a future which will return or value of original future fa or raise a timeout exception, if fa has no completed duriong duration

Create a future which will return or value of original future fa or raise a timeout exception, if fa has no completed duriong duration

Attributes

Source
TimedAwait.scala