dhall-nix-lib/Integer/negative.dhall

18 lines
409 B
Text

{-|
Returns `True` for any `Integer` less than `+0`.
`negative` is more efficient than `./lessThan +0` or `./lessThanEqual -1`.
-}
let positive = ./positive.dhall
let negative
: Integer → Bool
= λ(n : Integer) → positive (Integer/negate n)
let example0 = assert : negative +1 ≡ False
let example1 = assert : negative +0 ≡ False
let example2 = assert : negative -1 ≡ True
in negative