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

19 lines
381 B
Text

{-
Render a `Text` literal as its own representation as Dhall source code (i.e. a
double-quoted string literal)
-}
let show
: Text → Text
= Text/show
let example0 = assert : show "ABC" ≡ "\"ABC\""
let example1 =
assert
: show
''
${"\u0000"} $ \
${" "}☺''
≡ "\"\\u0000 \\u0024 \\\\ \\n ☺\""
in show