X-Git-Url: https://git.martlubbers.net/?a=blobdiff_plain;f=appx%2Fc4hp.tex;h=8ee7fb1eb754d34ae2dd64c31e58471865b4ed41;hb=5702796e5885e85b9e8dcc0d5160dccb9386b05f;hp=56b80b04f5dc7fafeb42892e62cae2bd24786e4f;hpb=5bd4efa4ebb3e70f19c6fa09366a8feb68aa2de7;p=phd-thesis.git diff --git a/appx/c4hp.tex b/appx/c4hp.tex index 56b80b0..8ee7fb1 100644 --- a/appx/c4hp.tex +++ b/appx/c4hp.tex @@ -5,7 +5,7 @@ \begin{document} \input{subfileprefix} \ifSubfilesClassLoaded{\appendix}{} -\chapter{\texorpdfstring{\glsentrytext{CLEAN}}{Clean} for \texorpdfstring{\glsentrytext{HASKELL}}{Haskell} programmers}% +\chapter{Clean for Haskell programmers}% \label{chp:clean_for_haskell_programmers} This appendix is meant give people who are familiar with the \gls{FP} language \gls{HASKELL} a consise overview of the programming language \gls{CLEAN} and how it differs from \gls{HASKELL}. @@ -15,7 +15,7 @@ Obviously, this summary is not exhaustive. Some \gls{CLEAN} language elements that are not easily translatable to \gls{HASKELL} and thus do not occur in the summary following below. We hope you enjoy these notes and that it aids you in reading \gls{CLEAN} programs. -\Gls{CLEAN}---acronym for Clean \glsxtrlong{LEAN} \citep{barendregt_towards_1987}---, was originally designed as a \gls{GRS} core language but quickly served as an intermediate language for other functional languages \citep{brus_clean_1987}. +\Gls{CLEAN}---acronym for Clean Language of East-Anglia and Nijmegen \citep{barendregt_towards_1987}---, was originally designed as a \gls{GRS} core language but quickly served as an intermediate language for other functional languages \citep{brus_clean_1987}. In the early days it has also been called \emph{Concurrent} \gls{CLEAN} \citep{nocker_concurrent_1991} but these days the language has no support for concurrency anymore. Fast-forward thirty years, \gls{CLEAN} is now a robust language with state-of-the-art features and is actually used in industry as well as academia---albeit in select areas of the world. @@ -104,7 +104,7 @@ For example, defining a generic equality is done as in \cref{lst:generic_eq}. Metadata about the types is available using the \cleaninline{of} syntax that gives the function access to metadata records, as can be seen in \cref{lst:generic_print} showing a generic print function. This abundance of metadata allows for very complex generic functions that near the expression level of template metaprogramming (see \cref{chp:first-class_datatypes,sec:ccodegen}). \cleaninputlisting[language=Clean,firstline=4,label={lst:generic_print},caption={Generic print function}]{lst/generic_print.icl} -\subsection{\texorpdfstring{\glsentrytext{GADT}}{GADT}s} +\subsection{GADTs} \Glspl{GADT} are enriched data types that allow the type instantiation of the constructor to be explicitly defined \citep{cheney_first-class_2003,hinze_fun_2003}. While \glspl{GADT} are not natively supported in \gls{CLEAN}, they can be simulated using embedding-projection pairs or equivalence types \citep[\citesection{2.2}]{cheney_lightweight_2002}. To illustrate this, \cref{lst:gadt_haskell} shows a \gls{GADT} in \gls{HASKELL}\requiresGHCmod{GADTs} that can be implemented as in \cref{lst:gadt_clean}. @@ -115,14 +115,14 @@ To illustrate this, \cref{lst:gadt_haskell} shows a \gls{GADT} in \gls{HASKELL}\ \clearpage \section{Syntax} \lstset{basicstyle=\tt\footnotesize} -\begin{longtable}{p{.45\linewidth}p{.5\linewidth}} +\begin{longtable}{p{.46\linewidth}p{.46\linewidth}} \caption[]{Syntactical differences between \gls{CLEAN} and \gls{HASKELL}.}% \label{tbl:syn_clean_haskell}\\ \toprule \gls{CLEAN} & \gls{HASKELL}\\ \midrule \endfirsthead% - \caption[]{(continued)}\\ + \caption[]{Syntactical differences between \gls{CLEAN} and \gls{HASKELL}. (continued)}\\ \toprule \gls{CLEAN} & \gls{HASKELL}\\ \midrule