org.scalactic.algebra

Applicative

trait Applicative[Context[_]] extends Functor[Context]

Typeclass trait representing an algebraic structure that is a Functor[Context] (i.e., it declares a map method that obeys the functor laws) augmented by insert and applying methods that obey laws of homomorphism and interchange. The homomorphism law states that given a value, a, of type A and a function, f, of type A => B (and implicit Applicative.adapters imported):

val ca = applicative.insert(a)
val cf = applicative.insert(f)
ca.applying(cf) === applicative.insert(f(a))
The interchange law states that given a value, a, of type A and a function, cf, of type Context[A => B] (and implicit Applicative.adapters imported):
val ca = applicative.insert(a)
val cg = applicative.insert((f: A => B) => f(a))
ca.applying(cf) === cf.applying(cg)

Source
Applicative.scala
Linear Supertypes
Functor[Context], AnyRef, Any
Known Subclasses
Ordering
  1. Alphabetic
  2. By inheritance
Inherited
  1. Applicative
  2. Functor
  3. AnyRef
  4. Any
  1. Hide All
  2. Show all
Learn more about member selection
Visibility
  1. Public
  2. All

Abstract Value Members

  1. abstract def applying[A, B](ca: Context[A])(cab: Context[(A) ⇒ B]): Context[B]

    Applies the given function in context to the given value in context, returning the result in the context.

  2. abstract def insert[A](a: A): Context[A]

    Inserts a value into a context.

Concrete Value Members

  1. final def !=(arg0: AnyRef): Boolean

    Definition Classes
    AnyRef
  2. final def !=(arg0: Any): Boolean

    Definition Classes
    Any
  3. final def ##(): Int

    Definition Classes
    AnyRef → Any
  4. final def ==(arg0: AnyRef): Boolean

    Definition Classes
    AnyRef
  5. final def ==(arg0: Any): Boolean

    Definition Classes
    Any
  6. def applying[A, B, C, D](ca: Context[A], cb: Context[B], cc: Context[C])(cf: Context[(A, B, C) ⇒ D]): Context[D]

    Applies the given function in context to the given values in context, returning the result in the context.

  7. def applying[A, B, C](ca: Context[A], cb: Context[B])(cf: Context[(A, B) ⇒ C]): Context[C]

    Applies the given function in context to the given values in context, returning the result in the context.

  8. final def asInstanceOf[T0]: T0

    Definition Classes
    Any
  9. def clone(): AnyRef

    Attributes
    protected[java.lang]
    Definition Classes
    AnyRef
    Annotations
    @throws( ... )
  10. final def eq(arg0: AnyRef): Boolean

    Definition Classes
    AnyRef
  11. def equals(arg0: Any): Boolean

    Definition Classes
    AnyRef → Any
  12. def finalize(): Unit

    Attributes
    protected[java.lang]
    Definition Classes
    AnyRef
    Annotations
    @throws( classOf[java.lang.Throwable] )
  13. final def getClass(): Class[_]

    Definition Classes
    AnyRef → Any
  14. def hashCode(): Int

    Definition Classes
    AnyRef → Any
  15. final def isInstanceOf[T0]: Boolean

    Definition Classes
    Any
  16. def lift[A, B, C, D](f: (A, B, C) ⇒ D): (Context[A], Context[B], Context[C]) ⇒ Context[D]

    Transforms the given function into another function where each parameter type and the result type are lifted into a context.

  17. def lift[A, B, C](f: (A, B) ⇒ C): (Context[A], Context[B]) ⇒ Context[C]

    Transforms the given function into another function where each parameter type and the result type are lifted into a context.

  18. def lift[A, B](f: (A) ⇒ B): (Context[A]) ⇒ Context[B]

    Transforms the given function into another function where the parameter and result types are lifted into a context.

  19. def map[A, B](ca: Context[A])(f: (A) ⇒ B): Context[B]

    Applies the given function to the given value in context, returning the result in the context.

    Applies the given function to the given value in context, returning the result in the context.

    Definition Classes
    ApplicativeFunctor
  20. def mapAll[A, B, C, D](ca: Context[A], cb: Context[B], cc: Context[C])(f: (A, B, C) ⇒ D): Context[D]

    Applies the given function to the given values in context, returning the result in the context.

  21. def mapAll[A, B, C](ca: Context[A], cb: Context[B])(f: (A, B) ⇒ C): Context[C]

    Applies the given function to the given values in context, returning the result in the context.

  22. final def ne(arg0: AnyRef): Boolean

    Definition Classes
    AnyRef
  23. final def notify(): Unit

    Definition Classes
    AnyRef
  24. final def notifyAll(): Unit

    Definition Classes
    AnyRef
  25. final def synchronized[T0](arg0: ⇒ T0): T0

    Definition Classes
    AnyRef
  26. def toString(): String

    Definition Classes
    AnyRef → Any
  27. def tupled[A, B, C](ca: Context[A], cb: Context[B], cc: Context[C]): Context[(A, B, C)]

    Transforms three contexts containing values into a context containing a tuple of the three corresponding values.

  28. def tupled[A, B](ca: Context[A], cb: Context[B]): Context[(A, B)]

    Transforms two contexts containing values into a context containing a tuple of the two corresponding values.

  29. final def wait(): Unit

    Definition Classes
    AnyRef
    Annotations
    @throws( ... )
  30. final def wait(arg0: Long, arg1: Int): Unit

    Definition Classes
    AnyRef
    Annotations
    @throws( ... )
  31. final def wait(arg0: Long): Unit

    Definition Classes
    AnyRef
    Annotations
    @throws( ... )

Inherited from Functor[Context]

Inherited from AnyRef

Inherited from Any

Ungrouped