ansible/dhall/Prelude/Text/default.dhall

11 lines
308 B
Text
Raw Normal View History

2024-11-26 05:55:44 +00:00
--| Unwrap an `Optional` `Text` value, defaulting `None` to `""`
let default
: Optional Text → Text
= λ(o : Optional Text) → merge { Some = λ(t : Text) → t, None = "" } o
let example0 = assert : default (Some "ABC") ≡ "ABC"
let example1 = assert : default (None Text) ≡ ""
in default