dhall-nix-lib/Number/compare.dhall

14 lines
342 B
Text

λ(nix : ../NixPrelude.dhall) →
let Number = ./Type.dhall
let lessThan = ./lessThan.dhall nix
let greaterThan = ./greaterThan.dhall nix
let compare
: Number → Number → Integer
= λ(a : Number) →
λ(b : Number) →
if lessThan a b then -1 else if greaterThan a b then +1 else +0
in compare