scalaz

:+:

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
AnyRef, Any
Ordering
  1. Alphabetic
  2. By inheritance
Inherited
  1. :+:
  2. AnyRef
  3. Any
  1. Hide All
  2. Show all
Learn more about member selection
Visibility
  1. Public
  2. All

Instance Constructors

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

Value Members

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

    Definition Classes
    AnyRef
  2. final def !=(arg0: Any): Boolean

    Definition Classes
    Any
  3. final def ##(): Int

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

    Definition Classes
    AnyRef
  5. final def ==(arg0: Any): Boolean

    Definition Classes
    Any
  6. def appendLeft[A >: M, B >: N](m: A)(implicit arg0: Monoid[A], arg1: Monoid[B]): :+:[A, B]

    Append a value from the left monoid

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

    Append a value from the right monoid

  8. final def asInstanceOf[T0]: T0

    Definition Classes
    Any
  9. def both[A >: M, B >: N](implicit arg0: Monoid[A], arg1: Monoid[B]): (A, B)

    Project out both monoids individually

  10. def clone(): AnyRef

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

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

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

    Attributes
    protected[java.lang]
    Definition Classes
    AnyRef
    Annotations
    @throws( classOf[java.lang.Throwable] )
  14. 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).

  15. final def getClass(): Class[_]

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

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

    Definition Classes
    Any
  18. def left[A >: M](implicit arg0: Monoid[A]): A

    Project out the value in the left monoid

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

    Definition Classes
    AnyRef
  20. final def notify(): Unit

    Definition Classes
    AnyRef
  21. final def notifyAll(): Unit

    Definition Classes
    AnyRef
  22. def prependLeft[A >: M, B >: N](m: A)(implicit arg0: Monoid[A], arg1: Monoid[B]): :+:[A, B]

    Prepend a value from the left monoid

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

    Prepend a value from the right monoid

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

    Project out the value in the right monoid

  25. final def synchronized[T0](arg0: ⇒ T0): T0

    Definition Classes
    AnyRef
  26. def toString(): String

    Definition Classes
    AnyRef → Any
  27. 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.

  28. 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.

  29. 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.

  30. final def wait(): Unit

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

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

    Definition Classes
    AnyRef
    Annotations
    @throws( ... )
  33. 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