trait Monad[Context[_]] extends Applicative[Context]
Typeclass trait for algebraic structure containing insertion and flat-mapping methods that obey laws of identity and associativity.
A Monad instance wraps an object that in some way behaves as a Monad.
- Source
- Monad.scala
- Alphabetic
- By Inheritance
- Monad
- Applicative
- Functor
- AnyRef
- Any
- Hide All
- Show All
- Public
- All
Abstract Value Members
-
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.
Applies the given function in context to the given value in context, returning the result in the context.
- Definition Classes
- Monad → Applicative
-
abstract
def
flatMap[A, B](ca: Context[A])(f: (A) ⇒ Context[B]): Context[B]
Applies the given function to the value contained in this context, returning the result of the function, which is a value wrapped in another context.
-
abstract
def
flatten[A](cca: Context[Context[A]]): Context[A]
Flattens a nested context into a single context.
-
abstract
def
insert[A](a: A): Context[A]
Inserts a value into a context.
Inserts a value into a context.
- Definition Classes
- Applicative
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.
Applies the given function in context to the given values in context, returning the result in the context.
- Definition Classes
- Applicative
-
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.
Applies the given function in context to the given values in context, returning the result in the context.
- Definition Classes
- Applicative
-
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.
Transforms the given function into another function where each parameter type and the result type are lifted into a context.
- Definition Classes
- Applicative
-
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.
Transforms the given function into another function where each parameter type and the result type are lifted into a context.
- Definition Classes
- Applicative
-
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.
Transforms the given function into another function where the parameter and result types are lifted into a context.
- Definition Classes
- Applicative
-
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.
Applies the given function to the given values in context, returning the result in the context.
- Definition Classes
- Applicative
-
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.
Applies the given function to the given values in context, returning the result in the context.
- Definition Classes
- Applicative
-
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.
Transforms three contexts containing values into a context containing a tuple of the three corresponding values.
- Definition Classes
- Applicative
-
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.
Transforms two contexts containing values into a context containing a tuple of the two corresponding values.
- Definition Classes
- Applicative
-
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( ... )