Minnesota Extensible Language Tools Group
Toggle Dark/Light/Auto mode Toggle Dark/Light/Auto mode Toggle Dark/Light/Auto mode Back to homepage

Ord.md

In grammar silver:core file Ord.sv:

class Ord

Contained in grammar [silver:core]. Defined at silver/core/Ord.sv line 29.

Ord represents ordering relationships between data.

Laws are based on Haskell’s Ord type class:

Transitivity if x <= y && y <= z = true, then x <= z = true Reflexivity x <= x = true Antisymmetry if x <= y && y <= x = true, then x == y = true

Note that the following operator interactions are expected to hold:

  1. x >= y = y <= x
  2. x < y = x <= y && x != y
  3. x > y = y < x
  4. x < y = compare x y < 0
  5. x > y = compare x y > 0
  6. x == y = compare x y == 0
  7. min(x, y) == if x <= y then x else y = true
  8. max(x, y) == if x >= y then x else y = true

Note that (7.) and (8.) do not require min and max to return either of their arguments. The result is merely required to equal one of the arguments in terms of (==).

Minimal complete definition: either compare or <=. Using compare can be more efficient for complex types.

class Ord.compare :: => (Integer ::= a a) (has default)

Contained in grammar [silver:core]. Defined at silver/core/Ord.sv line 30.

(Undocumented.)


class Ord.lt :: => (Boolean ::= a a) (has default)

Contained in grammar [silver:core]. Defined at silver/core/Ord.sv line 33.

(Undocumented.)


class Ord.lte :: => (Boolean ::= a a) (has default)

Contained in grammar [silver:core]. Defined at silver/core/Ord.sv line 34.

(Undocumented.)


class Ord.gt :: => (Boolean ::= a a) (has default)

Contained in grammar [silver:core]. Defined at silver/core/Ord.sv line 35.

(Undocumented.)


class Ord.gte :: => (Boolean ::= a a) (has default)

Contained in grammar [silver:core]. Defined at silver/core/Ord.sv line 36.

(Undocumented.)


class Ord.max :: => (a ::= a a) (has default)

Contained in grammar [silver:core]. Defined at silver/core/Ord.sv line 38.

(Undocumented.)


class Ord.min :: => (a ::= a a) (has default)

Contained in grammar [silver:core]. Defined at silver/core/Ord.sv line 39.

(Undocumented.)


ordering attribute compareKey, compare with compareTo

Contained in grammar [silver:core]. Defined at silver/core/Ord.sv line 42.

(Undocumented.)


instance Ord a

Contained in grammar [silver:core]. Defined at silver/core/Ord.sv line 44.

(Undocumented.)


instance Ord a.compare

Contained in grammar [silver:core]. Defined at silver/core/Ord.sv line 49.

(Undocumented.)


instance Ord Decorated a with i

Contained in grammar [silver:core]. Defined at silver/core/Ord.sv line 52.

(Undocumented.)


instance Ord Decorated a with i.compare

Contained in grammar [silver:core]. Defined at silver/core/Ord.sv line 54.

(Undocumented.)


instance Ord Integer

Contained in grammar [silver:core]. Defined at silver/core/Ord.sv line 57.

(Undocumented.)


instance Ord Integer.compare

Contained in grammar [silver:core]. Defined at silver/core/Ord.sv line 58.

(Undocumented.)


instance Ord Integer.lt

Contained in grammar [silver:core]. Defined at silver/core/Ord.sv line 59.

(Undocumented.)


instance Ord Integer.lte

Contained in grammar [silver:core]. Defined at silver/core/Ord.sv line 60.

(Undocumented.)


instance Ord Integer.gt

Contained in grammar [silver:core]. Defined at silver/core/Ord.sv line 61.

(Undocumented.)


instance Ord Integer.gte

Contained in grammar [silver:core]. Defined at silver/core/Ord.sv line 62.

(Undocumented.)


function ltInteger   (Boolean ::= x::Integer y::Integer )

Contained in grammar [silver:core]. Defined at silver/core/Ord.sv line 64.

(Undocumented.)


function lteInteger   (Boolean ::= x::Integer y::Integer )

Contained in grammar [silver:core]. Defined at silver/core/Ord.sv line 71.

(Undocumented.)


function gtInteger   (Boolean ::= x::Integer y::Integer )

Contained in grammar [silver:core]. Defined at silver/core/Ord.sv line 78.

(Undocumented.)


function gteInteger   (Boolean ::= x::Integer y::Integer )

Contained in grammar [silver:core]. Defined at silver/core/Ord.sv line 85.

(Undocumented.)


instance Ord Float

Contained in grammar [silver:core]. Defined at silver/core/Ord.sv line 93.

(Undocumented.)


instance Ord Float.lt

Contained in grammar [silver:core]. Defined at silver/core/Ord.sv line 94.

(Undocumented.)


instance Ord Float.lte

Contained in grammar [silver:core]. Defined at silver/core/Ord.sv line 95.

(Undocumented.)


instance Ord Float.gt

Contained in grammar [silver:core]. Defined at silver/core/Ord.sv line 96.

(Undocumented.)


instance Ord Float.gte

Contained in grammar [silver:core]. Defined at silver/core/Ord.sv line 97.

(Undocumented.)


function ltFloat   (Boolean ::= x::Float y::Float )

Contained in grammar [silver:core]. Defined at silver/core/Ord.sv line 99.

(Undocumented.)


function lteFloat   (Boolean ::= x::Float y::Float )

Contained in grammar [silver:core]. Defined at silver/core/Ord.sv line 106.

(Undocumented.)


function gtFloat   (Boolean ::= x::Float y::Float )

Contained in grammar [silver:core]. Defined at silver/core/Ord.sv line 113.

(Undocumented.)


function gteFloat   (Boolean ::= x::Float y::Float )

Contained in grammar [silver:core]. Defined at silver/core/Ord.sv line 120.

(Undocumented.)


instance Ord Boolean

Contained in grammar [silver:core]. Defined at silver/core/Ord.sv line 128.

(Undocumented.)


instance Ord Boolean.lt

Contained in grammar [silver:core]. Defined at silver/core/Ord.sv line 129.

(Undocumented.)


instance Ord Boolean.lte

Contained in grammar [silver:core]. Defined at silver/core/Ord.sv line 130.

(Undocumented.)


instance Ord Boolean.gt

Contained in grammar [silver:core]. Defined at silver/core/Ord.sv line 131.

(Undocumented.)


instance Ord Boolean.gte

Contained in grammar [silver:core]. Defined at silver/core/Ord.sv line 132.

(Undocumented.)


function ltBoolean   (Boolean ::= x::Boolean y::Boolean )

Contained in grammar [silver:core]. Defined at silver/core/Ord.sv line 134.

(Undocumented.)


function lteBoolean   (Boolean ::= x::Boolean y::Boolean )

Contained in grammar [silver:core]. Defined at silver/core/Ord.sv line 139.

(Undocumented.)


function gtBoolean   (Boolean ::= x::Boolean y::Boolean )

Contained in grammar [silver:core]. Defined at silver/core/Ord.sv line 144.

(Undocumented.)


function gteBoolean   (Boolean ::= x::Boolean y::Boolean )

Contained in grammar [silver:core]. Defined at silver/core/Ord.sv line 149.

(Undocumented.)


instance Ord String

Contained in grammar [silver:core]. Defined at silver/core/Ord.sv line 155.

(Undocumented.)


instance Ord String.compare

Contained in grammar [silver:core]. Defined at silver/core/Ord.sv line 156.

(Undocumented.)


instance Ord String.lt

Contained in grammar [silver:core]. Defined at silver/core/Ord.sv line 157.

(Undocumented.)


instance Ord String.lte

Contained in grammar [silver:core]. Defined at silver/core/Ord.sv line 158.

(Undocumented.)


instance Ord String.gt

Contained in grammar [silver:core]. Defined at silver/core/Ord.sv line 159.

(Undocumented.)


instance Ord String.gte

Contained in grammar [silver:core]. Defined at silver/core/Ord.sv line 160.

(Undocumented.)


function compareString   (Integer ::= l::String r::String )

Contained in grammar [silver:core]. Defined at silver/core/Ord.sv line 162.

(Undocumented.)


function ltString   (Boolean ::= x::String y::String )

Contained in grammar [silver:core]. Defined at silver/core/Ord.sv line 170.

(Undocumented.)


function lteString   (Boolean ::= x::String y::String )

Contained in grammar [silver:core]. Defined at silver/core/Ord.sv line 177.

(Undocumented.)


function gtString   (Boolean ::= x::String y::String )

Contained in grammar [silver:core]. Defined at silver/core/Ord.sv line 184.

(Undocumented.)


function gteString   (Boolean ::= x::String y::String )

Contained in grammar [silver:core]. Defined at silver/core/Ord.sv line 191.

(Undocumented.)


instance Ord TerminalId

Contained in grammar [silver:core]. Defined at silver/core/Ord.sv line 199.

(Undocumented.)


instance Ord TerminalId.compare

Contained in grammar [silver:core]. Defined at silver/core/Ord.sv line 200.

(Undocumented.)


instance Ord TerminalId.lt

Contained in grammar [silver:core]. Defined at silver/core/Ord.sv line 201.

(Undocumented.)


instance Ord TerminalId.lte

Contained in grammar [silver:core]. Defined at silver/core/Ord.sv line 202.

(Undocumented.)


instance Ord TerminalId.gt

Contained in grammar [silver:core]. Defined at silver/core/Ord.sv line 203.

(Undocumented.)


instance Ord TerminalId.gte

Contained in grammar [silver:core]. Defined at silver/core/Ord.sv line 204.

(Undocumented.)


function compareTerminalId   (Integer ::= x::TerminalId y::TerminalId )

Contained in grammar [silver:core]. Defined at silver/core/Ord.sv line 206.

(Undocumented.)


function ltTerminalId   (Boolean ::= x::TerminalId y::TerminalId )

Contained in grammar [silver:core]. Defined at silver/core/Ord.sv line 213.

(Undocumented.)


function lteTerminalId   (Boolean ::= x::TerminalId y::TerminalId )

Contained in grammar [silver:core]. Defined at silver/core/Ord.sv line 220.

(Undocumented.)


function gtTerminalId   (Boolean ::= x::TerminalId y::TerminalId )

Contained in grammar [silver:core]. Defined at silver/core/Ord.sv line 227.

(Undocumented.)


function gteTerminalId   (Boolean ::= x::TerminalId y::TerminalId )

Contained in grammar [silver:core]. Defined at silver/core/Ord.sv line 234.

(Undocumented.)


instance Ord [a]

Contained in grammar [silver:core]. Defined at silver/core/Ord.sv line 242.

(Undocumented.)


instance Ord [a].lte

Contained in grammar [silver:core]. Defined at silver/core/Ord.sv line 243.

(Undocumented.)


instance Ord Maybe<a>

Contained in grammar [silver:core]. Defined at silver/core/Ord.sv line 251.

(Undocumented.)


instance Ord Maybe<a>.lte

Contained in grammar [silver:core]. Defined at silver/core/Ord.sv line 252.

(Undocumented.)


instance Ord Pair<a b>

Contained in grammar [silver:core]. Defined at silver/core/Ord.sv line 260.

(Undocumented.)


instance Ord Pair<a b>.lte

Contained in grammar [silver:core]. Defined at silver/core/Ord.sv line 261.

(Undocumented.)


instance Ord Either<a b>

Contained in grammar [silver:core]. Defined at silver/core/Ord.sv line 264.

(Undocumented.)


instance Ord Either<a b>.compare

Contained in grammar [silver:core]. Defined at silver/core/Ord.sv line 265.

(Undocumented.)


instance Ord Unit

Contained in grammar [silver:core]. Defined at silver/core/Ord.sv line 274.

(Undocumented.)


instance Ord Unit.compare

Contained in grammar [silver:core]. Defined at silver/core/Ord.sv line 275.

(Undocumented.)


instance Ord Location

Contained in grammar [silver:core]. Defined at silver/core/Ord.sv line 278.

(Undocumented.)


instance Ord Location.lte

Contained in grammar [silver:core]. Defined at silver/core/Ord.sv line 279.

(Undocumented.)