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
- Alphabetic
- By Inheritance
- Applicative
- Functor
- AnyRef
- Any
- Hide All
- Show All
- Public
- All
Abstract Value Members
Concrete Value Members
-
final
def
!=(arg0: Any): Boolean
- Definition Classes
- AnyRef → Any
-
final
def
##(): Int
- Definition Classes
- AnyRef → Any
-
final
def
==(arg0: Any): Boolean
- Definition Classes
- AnyRef → Any
-
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.
-
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.
-
final
def
asInstanceOf[T0]: T0
- Definition Classes
- Any
-
def
clone(): AnyRef
- Attributes
- protected[java.lang]
- Definition Classes
- AnyRef
- Annotations
- @throws( ... )
-
final
def
eq(arg0: AnyRef): Boolean
- Definition Classes
- AnyRef
-
def
equals(arg0: Any): Boolean
- Definition Classes
- AnyRef → Any
-
def
finalize(): Unit
- Attributes
- protected[java.lang]
- Definition Classes
- AnyRef
- Annotations
- @throws( classOf[java.lang.Throwable] )
-
final
def
getClass(): Class[_]
- Definition Classes
- AnyRef → Any
-
def
hashCode(): Int
- Definition Classes
- AnyRef → Any
-
final
def
isInstanceOf[T0]: Boolean
- Definition Classes
- Any
-
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.
-
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.
-
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.
-
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
- Applicative → Functor
-
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.
-
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.
-
final
def
ne(arg0: AnyRef): Boolean
- Definition Classes
- AnyRef
-
final
def
notify(): Unit
- Definition Classes
- AnyRef
-
final
def
notifyAll(): Unit
- Definition Classes
- AnyRef
-
final
def
synchronized[T0](arg0: ⇒ T0): T0
- Definition Classes
- AnyRef
-
def
toString(): String
- Definition Classes
- AnyRef → Any
-
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.
-
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.
-
final
def
wait(): Unit
- Definition Classes
- AnyRef
- Annotations
- @throws( ... )
-
final
def
wait(arg0: Long, arg1: Int): Unit
- Definition Classes
- AnyRef
- Annotations
- @throws( ... )
-
final
def
wait(arg0: Long): Unit
- Definition Classes
- AnyRef
- Annotations
- @throws( ... )