EitherOrder

interface EitherOrder<L, R> : Order<Either<L, R>> (source)

Order instance for Either: every Either.Left is smaller than any Either.Right; values on the same side are compared with orderL / orderR.

Properties

Link copied to clipboard
abstract val orderL: Order<L>
Link copied to clipboard
abstract val orderR: Order<R>

Functions

Link copied to clipboard
open override fun compare(a: Either<L, R>, b: Either<L, R>): Int

Compares a with b: negative when a < b, zero when equivalent, positive when a > b.

Link copied to clipboard
open override fun eqv(a: Either<L, R>, b: Either<L, R>): Boolean

Returns true when a and b are equivalent.

Link copied to clipboard
open fun gt(a: Either<L, R>, b: Either<L, R>): Boolean

Returns true when a is strictly greater than b.

Link copied to clipboard
open fun gteqv(a: Either<L, R>, b: Either<L, R>): Boolean

Returns true when a is greater than or equivalent to b.

Link copied to clipboard
open fun lt(a: Either<L, R>, b: Either<L, R>): Boolean

Returns true when a is strictly less than b.

Link copied to clipboard
open fun lteqv(a: Either<L, R>, b: Either<L, R>): Boolean

Returns true when a is less than or equivalent to b.

Link copied to clipboard
open fun max(a: Either<L, R>, b: Either<L, R>): Either<L, R>

Returns the larger of a and b, preferring a on ties.

Link copied to clipboard
open fun min(a: Either<L, R>, b: Either<L, R>): Either<L, R>

Returns the smaller of a and b, preferring a on ties.

Link copied to clipboard
open fun neqv(a: Either<L, R>, b: Either<L, R>): Boolean

Returns true when a and b are not equivalent.

Link copied to clipboard

Returns a Comparator for use with the standard library (e.g. sortedWith).