Packages

  • package root
    Definition Classes
    root
  • package com
    Definition Classes
    root
  • package daml
    Definition Classes
    com
  • package concurrent

    A compatible layer for scala.concurrent with extra type parameters to control ExecutionContexts.

    A compatible layer for scala.concurrent with extra type parameters to control ExecutionContexts. Deliberately uses the same names as the equivalent concepts in scala.concurrent.

    The trouble with sc.ExecutionContext is that it is used incoherently. This leads to the problems described in https://failex.blogspot.com/2020/05/global-typeclass-coherence-principles-3.html . The extension layer in this package adds a phantom type parameter to ExecutionContext and related types, so that types can be used to discriminate between ExecutionContexts at compile-time, and so Futures can declare which ExecutionContext their operations are in.

    For Scala 2.12, you must pass -Xsource:2.13 to scalac for methods and conversions to be automatically found. You must also import scalaz.syntax.bind._ or similar for Future methods like map, flatMap, and so on.

    There are no constraints on the EC type variable; you need only declare types you wish to use for it that are sufficient for describing the domains in which you want ExecutionContexts to be discriminated. These types will never be instantiated, so you can simply declare that they exist. They can be totally separate, or have subtyping relationships; any subtyping relationships they have will be reflected in equivalent subtyping relationships between the resulting ExecutionContexts; if you declare sealed trait Elephant extends Animal, then automatically ExecutionContext[Elephant] <: ExecutionContext[Animal] with scalac preferring the former when available (because it is "more specific"). They can even be singleton types, so you might use x.type to suggest that the context is associated with the exact value of the x variable.

    If you want to, say, refer to both sc.Future and concurrent.Future in the same file, we recommend importing *the containing package* with an alias rather than renaming each individual class you import. For example,

    import com.daml.concurrent._
    import scala.{concurrent => sc}
    // OR
    import scala.concurrent._
    import com.daml.{concurrent => dc}

    The exact name isn't important, but you should pick a short one that is sufficiently suggestive for you.

    You should always be able to remove the substring Of.Instance.T from any inferred type; we strongly suggest doing this for clarity.

    Demonstrations of the typing behavior can be found in FutureSpec and ExecutionContextSpec. This library has no interesting runtime characteristics; you should think of it as exactly like scala.concurrent in that regard.

    Definition Classes
    daml
  • ExecutionContext
  • ExecutionContextOf
  • Future
  • FutureOf

object FutureOf

Instances and methods for FutureOf. You should not import these; instead, enable -Xsource:2.13 and they will always be available without import.

Linear Supertypes
AnyRef, Any
Ordering
  1. Alphabetic
  2. By Inheritance
Inherited
  1. FutureOf
  2. AnyRef
  3. Any
  1. Hide All
  2. Show All
Visibility
  1. Public
  2. All

Type Members

  1. implicit final class AnyOps[+A] extends AnyVal

    Operations safe if the Future is set to any ExecutionContext.

  2. implicit final class NonEcOps[+A] extends AnyVal

    Operations that don't refer to an ExecutionContext.

  3. implicit final class Ops[-EC, +A] extends AnyVal

    Common methods like map and flatMap are not provided directly; instead, import the appropriate Scalaz syntax for these; scalaz.syntax.bind._ will give you map, flatMap, and most other common choices.

    Common methods like map and flatMap are not provided directly; instead, import the appropriate Scalaz syntax for these; scalaz.syntax.bind._ will give you map, flatMap, and most other common choices. Only exotic Future-specific combinators are provided here.

  4. type ScalazF[F[+_]] = Nondeterminism[F] with Cobind[F] with MonadError[F, Throwable] with Catchable[F]

Value Members

  1. final def !=(arg0: Any): Boolean
    Definition Classes
    AnyRef → Any
  2. final def ##(): Int
    Definition Classes
    AnyRef → Any
  3. final def ==(arg0: Any): Boolean
    Definition Classes
    AnyRef → Any
  4. val Instance: FutureOf
  5. final def asInstanceOf[T0]: T0
    Definition Classes
    Any
  6. def clone(): AnyRef
    Attributes
    protected[lang]
    Definition Classes
    AnyRef
    Annotations
    @throws( ... ) @native()
  7. final def eq(arg0: AnyRef): Boolean
    Definition Classes
    AnyRef
  8. def equals(arg0: Any): Boolean
    Definition Classes
    AnyRef → Any
  9. def finalize(): Unit
    Attributes
    protected[lang]
    Definition Classes
    AnyRef
    Annotations
    @throws( classOf[java.lang.Throwable] )
  10. implicit def future Instance[EC](implicit arg0: ExecutionContext[EC]): ScalazF[[+β$1$]T[EC, β$1$]]
  11. implicit def future Semigroup[A, EC](implicit arg0: Semigroup[A], arg1: ExecutionContext[EC]): Semigroup[Future[EC, A]]
  12. implicit def future is any[A](sf: scala.concurrent.Future[A]): Future[Any, A]

    A sc.Future converts to our Future with any choice of EC type.

  13. implicit def future is any type[A]: ===[scala.concurrent.Future[A], Future[Any, A]]
  14. final def getClass(): Class[_]
    Definition Classes
    AnyRef → Any
    Annotations
    @native()
  15. def hashCode(): Int
    Definition Classes
    AnyRef → Any
    Annotations
    @native()
  16. final def isInstanceOf[T0]: Boolean
    Definition Classes
    Any
  17. final def ne(arg0: AnyRef): Boolean
    Definition Classes
    AnyRef
  18. final def notify(): Unit
    Definition Classes
    AnyRef
    Annotations
    @native()
  19. final def notifyAll(): Unit
    Definition Classes
    AnyRef
    Annotations
    @native()
  20. def swapExecutionContext[L, R]: scalaz.Isomorphism.<~>[[β$2$]T[L, β$2$], [β$3$]T[R, β$3$]]
  21. final def synchronized[T0](arg0: ⇒ T0): T0
    Definition Classes
    AnyRef
  22. def toString(): String
    Definition Classes
    AnyRef → Any
  23. final def wait(): Unit
    Definition Classes
    AnyRef
    Annotations
    @throws( ... )
  24. final def wait(arg0: Long, arg1: Int): Unit
    Definition Classes
    AnyRef
    Annotations
    @throws( ... )
  25. final def wait(arg0: Long): Unit
    Definition Classes
    AnyRef
    Annotations
    @throws( ... ) @native()

Inherited from AnyRef

Inherited from Any

Ungrouped