dhall-nix-lib/Natural/compare.dhall

15 lines
587 B
Text

let lessThan =
https://raw.githubusercontent.com/dhall-lang/dhall-lang/v22.0.0/Prelude/Natural/lessThan.dhall
sha256:3381b66749290769badf8855d8a3f4af62e8de52d1364d838a9d1e20c94fa70c
let greaterThan =
https://raw.githubusercontent.com/dhall-lang/dhall-lang/v22.0.0/Prelude/Natural/greaterThan.dhall
sha256:f702abcdfcd7ad73619b9285d7e41c3a1d017fb6b8d037cf40bd93bf30c09b2c
let compare
: Natural → Natural → Integer
= λ(a : Natural) →
λ(b : Natural) →
if lessThan a b then -1 else if greaterThan a b then +1 else +0
in compare