dhall-nix-lib/Natural/equal.dhall

15 lines
384 B
Text
Raw Normal View History

2022-09-01 08:05:34 +00:00
--| `equal` checks if two Naturals are equal.
2022-09-01 09:40:35 +00:00
let lessThanEqual = ./lessThanEqual.dhall
2022-09-01 08:05:34 +00:00
let equal
: Natural → Natural → Bool
= λ(a : Natural) → λ(b : Natural) → lessThanEqual a b && lessThanEqual b a
let example0 = assert : equal 5 5 ≡ True
let example1 = assert : equal 5 6 ≡ False
let property0 = λ(n : Natural) → assert : equal n n ≡ True
in equal