ansible/dhall/Prelude/Text/default.dhall
2024-11-26 00:55:56 -05:00

10 lines
308 B
Text

--| 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