X-Git-Url: https://git.martlubbers.net/?a=blobdiff_plain;f=appx%2Fc4hp.tex;h=665e058fb547689db49bb59bf3d9dd8919e33d05;hb=e770ffa123986f62dcc3b69df9ff9895860ca319;hp=7c986f2ca904e9f99ff00e2f0b2d3ba9290c9074;hpb=168cd542dfa23e95e458c0e7391104b712628d5b;p=phd-thesis.git diff --git a/appx/c4hp.tex b/appx/c4hp.tex index 7c986f2..665e058 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}. @@ -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}.