Packages

sealed class :+:[+M, +N] extends AnyRef

The coproduct (or free product) of monoids M and N. Conceptually this is an alternating list of M and N values, with the identity as the empty list, and composition as list concatenation that combines adjacent elements when possible.

Source
MonoidCoproduct.scala
Linear Supertypes
Ordering
  1. Alphabetic
  2. By Inheritance
Inherited
  1. :+:
  2. AnyRef
  3. Any
  1. Hide All
  2. Show All
Visibility
  1. Public
  2. All

Instance Constructors

  1. new :+:(rep: Vector[\/[M, N]])

Value Members

  1. final def !=(arg0: Any): Boolean
    Definition Classes
    AnyRef → Any
  2. final def ##(): Int
    Definition Classes
    AnyRef → Any
  3. final def ==(arg0: Any): Boolean
    Definition Classes
    AnyRef → Any
  4. def appendLeft[A >: M, B >: N](m: A)(implicit arg0: Monoid[A], arg1: Monoid[B]): :+:[A, B]

    Append a value from the left monoid

  5. def appendRight[A >: M, B >: N](n: B)(implicit arg0: Monoid[A], arg1: Monoid[B]): :+:[A, B]

    Append a value from the right monoid

  6. final def asInstanceOf[T0]: T0
    Definition Classes
    Any
  7. def both[A >: M, B >: N](implicit arg0: Monoid[A], arg1: Monoid[B]): (A, B)

    Project out both monoids individually

  8. def clone(): AnyRef
    Attributes
    protected[java.lang]
    Definition Classes
    AnyRef
    Annotations
    @native() @throws( ... )
  9. final def eq(arg0: AnyRef): Boolean
    Definition Classes
    AnyRef
  10. def equals(arg0: Any): Boolean
    Definition Classes
    AnyRef → Any
  11. def finalize(): Unit
    Attributes
    protected[java.lang]
    Definition Classes
    AnyRef
    Annotations
    @throws( classOf[java.lang.Throwable] )
  12. def fold[Z](f: (M) ⇒ Z, g: (N) ⇒ Z)(implicit arg0: Monoid[Z]): Z

    A homomorphism to a monoid Z (if f and g are homomorphisms).

  13. final def getClass(): Class[_]
    Definition Classes
    AnyRef → Any
    Annotations
    @native()
  14. def hashCode(): Int
    Definition Classes
    AnyRef → Any
    Annotations
    @native()
  15. final def isInstanceOf[T0]: Boolean
    Definition Classes
    Any
  16. def left[A >: M](implicit arg0: Monoid[A]): A

    Project out the value in the left monoid

  17. final def ne(arg0: AnyRef): Boolean
    Definition Classes
    AnyRef
  18. final def notify(): Unit
    Definition Classes
    AnyRef
    Annotations
    @native()
  19. final def notifyAll(): Unit
    Definition Classes
    AnyRef
    Annotations
    @native()
  20. def prependLeft[A >: M, B >: N](m: A)(implicit arg0: Monoid[A], arg1: Monoid[B]): :+:[A, B]

    Prepend a value from the left monoid

  21. def prependRight[A >: M, B >: N](n: B)(implicit arg0: Monoid[A], arg1: Monoid[B]): :+:[A, B]

    Prepend a value from the right monoid

  22. def right[A >: N](implicit arg0: Monoid[A]): A

    Project out the value in the right monoid

  23. final def synchronized[T0](arg0: ⇒ T0): T0
    Definition Classes
    AnyRef
  24. def toString(): String
    Definition Classes
    AnyRef → Any
  25. def untangle[A >: M, B >: N](f: (B, A) ⇒ A, g: (A, B) ⇒ B)(implicit arg0: Monoid[A], arg1: Monoid[B]): (A, B)

    Take a value from the coproduct monoid where each monoid acts on the other, and untangle into a pair of values.

    Take a value from the coproduct monoid where each monoid acts on the other, and untangle into a pair of values. Before being folded into the answer an N value is combined with the sum of the M values to its left via g and an M value is combined with the sum of the N values to its left via f. This allows you to add up N values while having the opportunity to "track" an evolving M value, and vice versa.

  26. def untangleLeft[A >: M, B >: N](f: (A, B) ⇒ B)(implicit arg0: Monoid[A], arg1: Monoid[B]): (A, B)

    Like untangle, except M values are simply combined without regard to the N values to the left of it.

  27. def untangleRight[A >: M, B >: N](f: (B, A) ⇒ A)(implicit arg0: Monoid[A], arg1: Monoid[B]): (A, B)

    Like untangle, except N values are simply combined without regard to the N values to the left of it.

  28. final def wait(): Unit
    Definition Classes
    AnyRef
    Annotations
    @throws( ... )
  29. final def wait(arg0: Long, arg1: Int): Unit
    Definition Classes
    AnyRef
    Annotations
    @throws( ... )
  30. final def wait(arg0: Long): Unit
    Definition Classes
    AnyRef
    Annotations
    @native() @throws( ... )
  31. def |+|[A >: M, B >: N](m: :+:[A, B])(implicit arg0: Monoid[A], arg1: Monoid[B]): :+:[A, B]

    The associative operation of the monoid coproduct

Inherited from AnyRef

Inherited from Any

Ungrouped