ansible/dhall/Prelude/Optional/null.dhall

13 lines
372 B
Text
Raw Normal View History

2024-11-26 05:55:44 +00:00
--| Returns `True` if the `Optional` value is absent and `False` if present
let null
: ∀(a : Type) → Optional a → Bool
= λ(a : Type) →
λ(xs : Optional a) →
merge { Some = λ(_ : a) → False, None = True } xs
let example0 = assert : null Natural (Some 2) ≡ False
let example1 = assert : null Natural (None Natural) ≡ True
in null