dhall-nix-lib/Integer/min.dhall

14 lines
371 B
Text

--| `min a b` returns the smaller of `a` or `b`
let lessThanEqual = ./lessThanEqual.dhall
let min
: Integer → Integer → Integer
= λ(a : Integer) → λ(b : Integer) → if lessThanEqual a b then a else b
let example0 = assert : min +1 +2 ≡ +1
let example1 = assert : min +2 +1 ≡ +1
let property0 = λ(n : Integer) → assert : min n n ≡ n
in min