OrderPreservingMonoid

trait OrderPreservingMonoid[A] extends OrderPreservingSemigroup[A] with Monoid[A]

Monoid whose operation preserves the Order:

∀ a,b,c: (a ≤ b) → (a⊕c ≤ b⊕c) (a ≤ b) → (c⊕a ≤ c⊕b)

See also:
Companion:
object
trait Monoid[A]
trait Order[A]
trait Equal[A]
trait Semigroup[A]
class Object
trait Matchable
class Any

Type members

Inherited classlikes

trait EqualLaw
Inherited from:
Equal
trait MonoidLaw extends SemigroupLaw

Monoid instances must satisfy scalaz.Semigroup.SemigroupLaw and 2 additional laws:

Monoid instances must satisfy scalaz.Semigroup.SemigroupLaw and 2 additional laws:

  • '''left identity''': forall a. append(zero, a) == a
  • '''right identity''' : forall a. append(a, zero) == a
Inherited from:
Monoid
trait OrderLaw extends EqualLaw
Inherited from:
Order

A semigroup in type F must satisfy two laws:

A semigroup in type F must satisfy two laws:

  • '''closure''': ∀ a, b in F, append(a, b) is also in F. This is enforced by the type system.
  • '''associativity''': ∀ a, b, c in F, the equation append(append(a, b), c) = append(a, append(b , c)) holds.
Inherited from:
Semigroup

Value members

Inherited methods

def append(f1: A, f2: => A): A

The binary operation to combine f1 and f2.

The binary operation to combine f1 and f2.

Implementations should not evaluate the by-name parameter f2 if result can be determined by f1.

Inherited from:
Semigroup
final def applicative: Applicative[[α] =>> A]

A monoidal applicative functor, that implements point and ap with the operations zero and append respectively. Note that the type parameter α in Applicative[λ[α => F]] is discarded; it is a phantom type. As such, the functor cannot support scalaz.Bind.

A monoidal applicative functor, that implements point and ap with the operations zero and append respectively. Note that the type parameter α in Applicative[λ[α => F]] is discarded; it is a phantom type. As such, the functor cannot support scalaz.Bind.

Inherited from:
Monoid
final def apply: Apply[[α] =>> A]

An scalaz.Apply, that implements ap with append. Note that the type parameter α in Apply[λ[α => F]] is discarded; it is a phantom type. As such, the functor cannot support scalaz.Bind.

An scalaz.Apply, that implements ap with append. Note that the type parameter α in Apply[λ[α => F]] is discarded; it is a phantom type. As such, the functor cannot support scalaz.Bind.

Inherited from:
Semigroup
def apply(x: A, y: A): Ordering
Inherited from:
Order
final def category: Category[[α, β] =>> A]

Every Monoid gives rise to a scalaz.Category, for which the type parameters are phantoms.

Every Monoid gives rise to a scalaz.Category, for which the type parameters are phantoms.

Note:

category.monoid = this

Inherited from:
Monoid
final def compose: Compose[[α, β] =>> A]

Every Semigroup gives rise to a scalaz.Compose, for which the type parameters are phantoms.

Every Semigroup gives rise to a scalaz.Compose, for which the type parameters are phantoms.

Note:

compose.semigroup = this

Inherited from:
Semigroup
override def contramap[B](f: B => A): Order[B]
Definition Classes
Order -> Equal
Inherited from:
Order
def equal(x: A, y: A): Boolean
Inherited from:
Order
def equalIsNatural: Boolean
Returns:

true, if equal(f1, f2) is known to be equivalent to f1 == f2

Inherited from:
Equal
Inherited from:
Equal
def greaterThan(x: A, y: A): Boolean
Inherited from:
Order
def greaterThanOrEqual(x: A, y: A): Boolean
Inherited from:
Order
final def ifEmpty[B](a: A)(t: => B)(f: => B)(implicit eq: Equal[A]): B
Inherited from:
Monoid
def isMZero(a: A)(implicit eq: Equal[A]): Boolean

Whether a == zero.

Whether a == zero.

Inherited from:
Monoid
def lessThan(x: A, y: A): Boolean
Inherited from:
Order
def lessThanOrEqual(x: A, y: A): Boolean
Inherited from:
Order
def max(x: A, y: A): A
Inherited from:
Order
def min(x: A, y: A): A
Inherited from:
Order
Inherited from:
Monoid
def multiply(value: A, n: Int): A

For n = 0, zero For n = 1, append(zero, value) For n = 2, append(append(zero, value), value)

For n = 0, zero For n = 1, append(zero, value) For n = 2, append(append(zero, value), value)

Inherited from:
Monoid
def multiply1(value: A, n: Int): A

For n = 0, value For n = 1, append(value, value) For n = 2, append(append(value, value), value)

For n = 0, value For n = 1, append(value, value) For n = 2, append(append(value, value), value)

The default definition uses peasant multiplication, exploiting associativity to only require O(log n) uses of append

Inherited from:
Semigroup
final def onEmpty[A, B](a: A)(v: => B)(implicit eq: Equal[A], mb: Monoid[B]): B
Inherited from:
Monoid
final def onNotEmpty[B](a: A)(v: => B)(implicit eq: Equal[A], mb: Monoid[B]): B
Inherited from:
Monoid
def order(x: A, y: A): Ordering
Inherited from:
Order
Inherited from:
Order
def reverseOrder: Order[A]
Inherited from:
Order
Inherited from:
Semigroup
def sort(x: A, y: A): (A, A)
Inherited from:
Order
def toScalaOrdering: Ordering[A]
Note:

Order.fromScalaOrdering(toScalaOrdering).order(x, y) = this.order(x, y)

Inherited from:
Order
def unfoldlSum[S](seed: S)(f: S => Maybe[(S, A)]): A
Inherited from:
Monoid
def unfoldlSumOpt[S](seed: S)(f: S => Maybe[(S, A)]): Maybe[A]

Unfold seed to the left and sum using append. Semigroups with right absorbing elements may override this method to not unfold more than is necessary to determine the result.

Unfold seed to the left and sum using append. Semigroups with right absorbing elements may override this method to not unfold more than is necessary to determine the result.

Inherited from:
Semigroup
def unfoldrSum[S](seed: S)(f: S => Maybe[(A, S)]): A
Inherited from:
Monoid
def unfoldrSumOpt[S](seed: S)(f: S => Maybe[(A, S)]): Maybe[A]

Unfold seed to the right and sum using append. Semigroups with left absorbing elements may override this method to not unfold more than is necessary to determine the result.

Unfold seed to the right and sum using append. Semigroups with left absorbing elements may override this method to not unfold more than is necessary to determine the result.

Inherited from:
Semigroup
def zero: A

The identity element for append.

The identity element for append.

Inherited from:
Monoid

Inherited fields

val equalSyntax: EqualSyntax[A]
Inherited from:
Equal
val monoidSyntax: MonoidSyntax[A]
Inherited from:
Monoid
val orderSyntax: OrderSyntax[A]
Inherited from:
Order
val semigroupSyntax: SemigroupSyntax[A]
Inherited from:
Semigroup