Trait/Object

org.scalactic.algebra

Applicative

Related Docs: object Applicative | package algebra

Permalink

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
Visibility
  1. Public
  2. All

Abstract Value Members

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

    Permalink

    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]

    Permalink

    Inserts a value into a context.

Concrete Value Members

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

    Permalink
    Definition Classes
    AnyRef → Any
  2. final def ##(): Int

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

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

    Permalink

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

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

    Permalink

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

  6. final def asInstanceOf[T0]: T0

    Permalink
    Definition Classes
    Any
  7. def clone(): AnyRef

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

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

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

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

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

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

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

    Permalink

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

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

    Permalink

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

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

    Permalink

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

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

    Permalink

    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
  18. def mapAll[A, B, C, D](ca: Context[A], cb: Context[B], cc: Context[C])(f: (A, B, C) ⇒ D): Context[D]

    Permalink

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

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

    Permalink

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

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

    Permalink
    Definition Classes
    AnyRef
  21. final def notify(): Unit

    Permalink
    Definition Classes
    AnyRef
  22. final def notifyAll(): Unit

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

    Permalink
    Definition Classes
    AnyRef
  24. def toString(): String

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

    Permalink

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

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

    Permalink

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

  27. final def wait(): Unit

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

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

    Permalink
    Definition Classes
    AnyRef
    Annotations
    @throws( ... )

Inherited from Functor[Context]

Inherited from AnyRef

Inherited from Any

Ungrouped