I'm very interested in why Text/fold, Text/length, and Text/build are not available, and even not implementable (as long as I read the docs) in Dhall.
Do you think they are unnecessary for a configuration languages?
I think for example Text/null would be useful to show default value when a text is empty:
if Text/null someText then "default text" else someText
You mean I should use Optional Text in such a case?
@igrep
You mean I should use Optional Text in such a case?
Yes, in this case I'd use Optional Text, so your example would be:
Optional/fold Text someText Text (位(t : Text) -> t) "default text"
Do you think they are unnecessary for a configuration languages?
Usually this question comes up wrt Text/equals (it's the same problem class of null, build, etc), so you might find the discussion in #164 interesting
I got the overall point of why the features aren't implemented. Closing.
Thank you!
@igrep: You might also find this useful: https://github.com/dhall-lang/dhall-lang/wiki/How-to-add-a-new-built-in-function