org.scalactic

algebra

package algebra

Visibility
  1. Public
  2. All

Type Members

  1. 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)
    

  2. trait Associative[A] extends AnyRef

    Typeclass trait representing a binary operation that obeys the associative law.

  3. trait Commutative[A] extends AnyRef

    Typeclass trait representing a binary operation that obeys the commutative law.

  4. trait Distributive[A] extends AnyRef

    Typeclass trait representing two binary operations that obeys the distributive law: one, dcombine that does the distributing, and the other combine binary combine that dcombine is applied to.

  5. trait Functor[Context[_]] extends AnyRef

    Typeclass trait representing an algebraic structure defined by a map method that obeys laws of identity and composition.

  6. trait Monad[Context[_]] extends Applicative[Context]

    Typeclass trait for algebraic structure containing insertion and flat-mapping methods that obey laws of identity and associativity.

  7. trait Monoid[A] extends Associative[A]

    Typeclass trait representing a binary operation that obeys the associative law and an identity element that obeys the left and right identity laws.

Value Members

  1. object Applicative

    Companion object for trait Applicative.

  2. object Associative

    Companion object for Associative.

  3. object Commutative

    Companion object for Commutative.

  4. object Distributive

    Companion object for Distributive.

  5. object Functor

    Companion object for trait Functor.

  6. object Monad

    Companion object for Monad typeclass.

  7. object Monoid

    Companion object for trait Monoid.

Ungrouped