LanguageExt.Core

LanguageExt.Core Traits Ord

Contents

interface Ord <in A> Source #

Methods

method int Compare (A x, A y) Source #

Compare two values

Parameters

param x

Left hand side of the compare operation

param y

Right hand side of the compare operation

returns

if x greater than y : 1

if x less than y : -1

if x equals y : 0

class Ord Source #

Methods

method bool greaterThan <A> (A x, A y) Source #

where A : Ord<A>

Returns true if x is greater than y

Parameters

param x

The first item to compare

param y

The second item to compare

returns

True if x is greater than y

method bool greaterOrEq <A> (A x, A y) Source #

where A : Ord<A>

Returns true if x is greater than or equal to y

Parameters

param x

The first item to compare

param y

The second item to compare

returns

True if x is greater than or equal to y

method bool lessThan <A> (A x, A y) Source #

where A : Ord<A>

Returns true if x is less than y

Parameters

param x

The first item to compare

param y

The second item to compare

returns

True if x is less than y

method bool lessOrEq <A> (A x, A y) Source #

where A : Ord<A>

Returns true if x is less than or equal to y

Parameters

param x

The first item to compare

param y

The second item to compare

returns

True if x is less than or equal to y

method int compare <A> (A x, A y) Source #

where A : Ord<A>

Compare one item to another to ascertain ordering

Parameters

param x

The first item to compare

param y

The second item to compare

returns

0 if x is equal to y -1 if x greater than y 1 if x less than y

method A max <OrdA, A> (A x, A y) Source #

where OrdA : Ord<A>

Find the maximum value between any two values

Parameters

param x

First value

param y

Second value

returns

When ordering the two values in ascending order, this is the last of those

method A min <OrdA, A> (A x, A y) Source #

where OrdA : Ord<A>

Find the minimum value between any two values

Parameters

param x

First value

param y

Second value

returns

When ordering the two values in ascending order, this is the first of those

method A min <OrdA, A> (A x, params A[] tail) Source #

where OrdA : Ord<A>

Find the minimum value between a set of values

Parameters

param x

First value

param y

Second value

param tail

Remaining values

returns

When ordering the values in ascending order, this is the first of those

method A max <OrdA, A> (A x, params A[] tail) Source #

where OrdA : Ord<A>

Find the maximum value between a set of values

Parameters

param x

First value

param y

Second value

param tail

Remaining values

returns

When ordering the values in ascending order, this is the last of those

class Prelude Source #

Methods

method bool greaterThan <ORD, A> (A x, A y) Source #

where ORD : Ord<A>

Returns true if x is greater than y

Parameters

param x

The first item to compare

param y

The second item to compare

returns

True if x is greater than y

method bool greaterOrEq <ORD, A> (A x, A y) Source #

where ORD : Ord<A>

Returns true if x is greater than or equal to y

Parameters

param x

The first item to compare

param y

The second item to compare

returns

True if x is greater than or equal to y

method bool lessThan <ORD, A> (A x, A y) Source #

where ORD : Ord<A>

Returns true if x is less than y

Parameters

param x

The first item to compare

param y

The second item to compare

returns

True if x is less than y

method bool lessOrEq <ORD, A> (A x, A y) Source #

where ORD : Ord<A>

Returns true if x is less than or equal to y

Parameters

param x

The first item to compare

param y

The second item to compare

returns

True if x is less than or equal to y

method int compare <ORD, A> (A x, A y) Source #

where ORD : Ord<A>

Compare one item to another to ascertain ordering

Parameters

param x

The first item to compare

param y

The second item to compare

returns

0 if x is equal to y -1 if x greater than y 1 if x less than y

method int compare <ORD, A> (Option<A> x, Option<A> y) Source #

where ORD : Ord<A>

Compare one item to another to ascertain ordering

Parameters

param x

The first item to compare

param y

The second item to compare

returns

0 if x is equal to y -1 if x greater than y 1 if x less than y

method int compare <ORDA, ORDB, A, B> (Either<A, B> x, Either<A, B> y) Source #

where ORDA : Ord<A>
where ORDB : Ord<B>

Compare one item to another to ascertain ordering

Parameters

param x

The first item to compare

param y

The second item to compare

returns

0 if x is equal to y -1 if x greater than y 1 if x less than y

method int compare <ORDA, ORDB, A, B> (Validation<A, B> x, Validation<A, B> y) Source #

where A : Monoid<A>
where ORDA : Ord<A>, Eq<A>
where ORDB : Ord<B>

Compare one item to another to ascertain ordering

Parameters

param x

The first item to compare

param y

The second item to compare

returns

0 if x is equal to y -1 if x greater than y 1 if x less than y

method int compare <ORD, A> (A[] x, A[] y) Source #

where ORD : Ord<A>

Compare one item to another to ascertain ordering

Parameters

param x

The first item to compare

param y

The second item to compare

returns

0 if x is equal to y -1 if x greater than y 1 if x less than y

method int compare <ORD, A> (Lst<A> x, Lst<A> y) Source #

where ORD : Ord<A>

Compare one item to another to ascertain ordering

Parameters

param x

The first item to compare

param y

The second item to compare

returns

0 if x is equal to y -1 if x greater than y 1 if x less than y

method int compare <ORD, L, R> (Either<L, R> x, Either<L, R> y) Source #

where ORD : Ord<R>

Compare one item to another to ascertain ordering

Parameters

param x

The first item to compare

param y

The second item to compare

returns

0 if x is equal to y -1 if x greater than y 1 if x less than y

class OrdComparer <OrdA, A> Source #

where OrdA : Ord<A>

Hosts a standard .NET IComparer from an Ord<A> instance (in the static Default property)

Fields

Methods

method int Compare (A? x, A? y) Source #