UnitAlgebra

trait UnitOrder
trait Order[Unit]
trait Eq[Unit]
trait Group[Unit]
trait Monoid[Unit]
class Object
trait Matchable
class Any

Value members

Inherited methods

override def combine(x: Unit, y: Unit): Unit
Definition Classes
Inherited from:
UnitAbGroup

Given a sequence of as, sum them using the monoid and return the total.

Given a sequence of as, sum them using the monoid and return the total.

Example:

scala> import cats.kernel.instances.string._

scala> Monoid[String].combineAll(List("One ", "Two ", "Three"))
res0: String = One Two Three

scala> Monoid[String].combineAll(List.empty)
res1: String = ""
Inherited from:
Monoid
Definition Classes
Inherited from:
Monoid
override def combineN(a: Unit, n: Int): Unit

Return a appended to itself n times. If n is negative, then this returns inverse(a) appended to itself n times.

Return a appended to itself n times. If n is negative, then this returns inverse(a) appended to itself n times.

Definition Classes
Inherited from:
Group
def compare(x: Unit, y: Unit): Int
Inherited from:
UnitOrder

Like compare, but returns a cats.kernel.Comparison instead of an Int. Has the benefit of being able to pattern match on, but not as performant.

Like compare, but returns a cats.kernel.Comparison instead of an Int. Has the benefit of being able to pattern match on, but not as performant.

Inherited from:
Order
override def empty: Unit
Definition Classes
Inherited from:
UnitAbGroup
override def eqv(x: Unit, y: Unit): Boolean
Definition Classes
Inherited from:
UnitOrder
override def gt(x: Unit, y: Unit): Boolean
Definition Classes
Inherited from:
UnitOrder
override def gteqv(x: Unit, y: Unit): Boolean
Definition Classes
Inherited from:
UnitOrder
override def intercalate(middle: Unit): CommutativeSemigroup[Unit]
Definition Classes
Inherited from:
CommutativeSemigroup
override def inverse(a: Unit): Unit
Definition Classes
Inherited from:
UnitAbGroup
def isEmpty(a: Unit)(implicit ev: Eq[Unit]): Boolean

Tests if a is the identity.

Tests if a is the identity.

Example:

scala> import cats.kernel.instances.string._

scala> Monoid[String].isEmpty("")
res0: Boolean = true

scala> Monoid[String].isEmpty("something")
res1: Boolean = false
Inherited from:
Monoid
override def lt(x: Unit, y: Unit): Boolean
Definition Classes
Inherited from:
UnitOrder
override def lteqv(x: Unit, y: Unit): Boolean
Definition Classes
Inherited from:
UnitOrder
override def max(x: Unit, y: Unit): Unit
Definition Classes
Inherited from:
UnitOrder
override def min(x: Unit, y: Unit): Unit
Definition Classes
Inherited from:
UnitOrder
override def neqv(x: Unit, y: Unit): Boolean
Definition Classes
Inherited from:
UnitOrder
Inherited from:
Order

Like partialCompare, but returns a cats.kernel.Comparison instead of an Double. Has the benefit of being able to pattern match on, but not as performant.

Like partialCompare, but returns a cats.kernel.Comparison instead of an Double. Has the benefit of being able to pattern match on, but not as performant.

Inherited from:
PartialOrder
def pmax(x: Unit, y: Unit): Option[Unit]

Returns Some(x) if x >= y, Some(y) if x < y, otherwise None.

Returns Some(x) if x >= y, Some(y) if x < y, otherwise None.

Inherited from:
PartialOrder
def pmin(x: Unit, y: Unit): Option[Unit]

Returns Some(x) if x <= y, Some(y) if x > y, otherwise None.

Returns Some(x) if x <= y, Some(y) if x > y, otherwise None.

Inherited from:
PartialOrder
def remove(a: Unit, b: Unit): Unit

Remove the element b from a.

Remove the element b from a.

Equivalent to combine(a, inverse(b))

Example:

scala> import cats.kernel.instances.int._

scala> Group[Int].remove(5, 2)
res0: Int = 3
Inherited from:
Group

Convert a Order[A] to a scala.math.Ordering[A] instance.

Convert a Order[A] to a scala.math.Ordering[A] instance.

Inherited from:
Order
def tryCompare(x: Unit, y: Unit): Option[Int]

Result of comparing x with y. Returns None if operands are not comparable. If operands are comparable, returns Some[Int] where the Int sign is:

Result of comparing x with y. Returns None if operands are not comparable. If operands are comparable, returns Some[Int] where the Int sign is:

  • negative iff x < y
  • zero iff x = y
  • positive iff x > y
Inherited from:
PartialOrder