Comparisons
Type signatures are provisional and may contain errors.
LT
(LT)
> NatRepresents "less than" in ordering comparisons.
LT == 0EQ
(EQ)
> NatRepresents "equal to" in ordering comparisons.
EQ == 1GT
(GT)
> NatRepresents "greater than" in ordering comparisons.
GT == 2ordWeld
(ordWeld x y)
> x : Nat
> y : Nat
> NatCombines two ordering results, giving precedence to the first non-EQ result.
ordWeld LT EQ == 0 ; LT
ordWeld EQ GT == 2 ; GT
ordWeld EQ EQ == 1 ; EQ
ordWeld LT GT == 0 ; LTisZero
(isZero x)
> x : Nat
> BoolChecks if a value is zero.
isZero 0 == 1
isZero 1 == 0
isZero 100 == 0isOne
(isOne x)
> x : Nat
> BoolChecks if a value is one.
isOne 1 == 1
isOne 100 == 0cmp
(cmp x y)
> x : a
> y : a
> NatCompares two values, returning LT, EQ, or GT.
cmp 1 2 == LT
cmp 2 2 == EQ
cmp 3 2 == GT
cmp [1 2] [1 3] == LT
cmp [1 2] [1 2] == EQeql
(eql x y)
> x : a
> y : a
> BoolChecks if two values are equal.
eql 1 1 == 1
eql 1 2 == 0
eql [1 2] [1 2] == 1
eql [1 2] [1 3] == 0neq
(neq x y)
> x : a
> y : a
> BoolChecks if two values are not equal.
neq 1 2 == 1
neq 1 1 == 0
neq [1 2] [1 3] == 1
neq [1 2] [1 2] == 0lth
(lth x y)
> x : a
> y : a
> BoolChecks if the first value is less than the second.
lth 1 2 == 1
lth 2 1 == 0
lth 1 1 == 0lte
(lte x y)
> x : a
> y : a
> BoolChecks if the first value is less than or equal to the second.
lte 1 2 == 1
lte 1 1 == 1
lte 2 1 == 0gth
(gth x y)
> x : a
> y : a
> BoolChecks if the first value is greater than the second.
gth 2 1 == 1
gth 1 2 == 0
gth 1 1 == 0gte
(gte x y)
> x : a
> y : a
> BoolChecks if the first value is greater than or equal to the second.
gte 2 1 == 1
gte 1 1 == 1
gte 1 2 == 0min
(min x y)
> x : a
> y : a
> aReturns the minimum of two values.
min 1 2 == 1
min 2 1 == 1
min 1 1 == 1max
(max x y)
> x : a
> y : a
> aReturns the maximum of two values.
max 1 2 == 2
max 2 1 == 2
max 1 1 == 1Last updated