1
0

tex: add stuff on dhall

This commit is contained in:
leo 2023-05-24 02:16:53 +02:00
parent 1b60d67d2b
commit ca79758b48
Signed by: wanderer
SSH Key Fingerprint: SHA256:Dp8+iwKHSlrMEHzE3bJnPng70I7LEsa3IJXRH/U+idQ
2 changed files with 29 additions and 1 deletions

@ -79,6 +79,14 @@
note={{Available from: \url{https://dhall-lang.org}. [viewed 2023-05-17]}},
}
@misc{dhallprelude,
howpublished = {[online]},
title = {{Prelude-v23.0.0}},
author = {{The Dhall Language Contributors}},
year = 2023,
note={{Available from: \url{https://store.dhall-lang.org/Prelude-v23.0.0/}. [viewed 2023-05-24]}},
}
@misc{dhallnorm,
howpublished = {[online]},
title = {{Safety Guarantees}},

@ -612,7 +612,27 @@ Figure~\ref{fig:dhallschema}. The \texttt{let} statement declares a variable
called \texttt{Schema} and assigns it the result of the expression on the right
side of the equals sign, which has for practical reasons been trimmed and is
displayed without the \emph{default} block, which is instead shown in its own
Figure~\ref{fig:dhallschemadefault}.
Figure~\ref{fig:dhallschemadefaults}.
The main configuration is comprised of both raw attributes and child records,
which allows for grouping of related functionality. For instance, configuration
settings pertaining mailserver setup are grouped in a record named
\textbf{Mailer}. Its attribute \textbf{Enabled} is annotated as \textbf{Bool},
which was deemed appropriate for a on-off switch-like functionality, with the
only permissible values being either \emph{True} or \emph{False}. Do note that
in Dhall \[true != True\], since \textbf{True} is internally a Bool constant,
which is built into Dhall (check out ``The Prelude''~\cite{dhallprelude}),
while \textbf{true} is evaluated as an \emph{unbound} variable, that is, a
variable \emph{not} defined in the current \emph{scope} and thus not
\emph{present} in the current scope.
Another one of specialties of Dhall is that $==$ and $!=$ equality operators
only work on values of type \texttt{Bool}, which for example means that
variables of type \texttt{Natural} (\texttt{uint}) or \texttt{Text}
(\texttt{string}) cannot be compared directly as in other languages, which
either leaves the work for a higher-level language (such as Go), or from the
perspective of the Dhall authors, \emph{enums} are promoted when the value
matters.
\begin{figure}[h]
\begin{varwidth}