Class/Object

scalaz

:+:

Related Docs: object :+: | package scalaz

Permalink

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
Visibility
  1. Public
  2. All

Instance Constructors

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

    Permalink

Value Members

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

    Permalink
    Definition Classes
    AnyRef → Any
  2. final def ##(): Int

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

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

    Permalink

    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]

    Permalink

    Append a value from the right monoid

  6. final def asInstanceOf[T0]: T0

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

    Permalink

    Project out both monoids individually

  8. def clone(): AnyRef

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

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

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

    Permalink
    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

    Permalink

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

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

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

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

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

    Permalink

    Project out the value in the left monoid

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

    Permalink
    Definition Classes
    AnyRef
  18. final def notify(): Unit

    Permalink
    Definition Classes
    AnyRef
  19. final def notifyAll(): Unit

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

    Permalink

    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]

    Permalink

    Prepend a value from the right monoid

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

    Permalink

    Project out the value in the right monoid

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

    Permalink
    Definition Classes
    AnyRef
  24. def toString(): String

    Permalink
    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)

    Permalink

    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)

    Permalink

    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)

    Permalink

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

  28. final def wait(): Unit

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

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

    Permalink
    Definition Classes
    AnyRef
    Annotations
    @throws( ... )
  31. def |+|[A >: M, B >: N](m: :+:[A, B])(implicit arg0: Monoid[A], arg1: Monoid[B]): :+:[A, B]

    Permalink

    The associative operation of the monoid coproduct

Inherited from AnyRef

Inherited from Any

Ungrouped