dhall-nix-lib/Number/compare.dhall

15 lines
342 B
Text
Raw Normal View History

2022-09-08 18:49:47 +00:00
λ(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