X-Git-Url: https://git.martlubbers.net/?a=blobdiff_plain;f=dsl%2Fdsl_techniques.tex;h=0164cb2868a92378f21551415a75b1e1470ea09d;hb=02d46e3fc22609f2624ebda38e089194a70dd5ad;hp=3e92c03c8bf300b9f9ca898b42ef870bf6a4a533;hpb=658c18356eecd7b43b27b5ee450db4d12a985834;p=phd-thesis.git diff --git a/dsl/dsl_techniques.tex b/dsl/dsl_techniques.tex index 3e92c03..0164cb2 100644 --- a/dsl/dsl_techniques.tex +++ b/dsl/dsl_techniques.tex @@ -99,7 +99,7 @@ Extending the \gls{ADT} is easy and convenient but extending the views according The first downside of this type of \gls{EDSL} can be overcome by using \glspl{GADT}~\citep{cheney_first-class_2003}. \Cref{lst:exdeepgadt} shows the same language, but type-safe with a \gls{GADT}. \glspl{GADT} are not supported in the current version of \gls{CLEAN} and therefore the syntax is hypothetical (See \todo{insert link to appendix}). -However, it has been shown that \glspl{GADT} can be simulated using bimaps or projection pairs~\citep[Sec.~2.2]{cheney_lightweight_2002}. +However, it has been shown that \glspl{GADT} can be simulated using bimaps or projection pairs~\citep[\citesection{2.2}]{cheney_lightweight_2002}. Unfortunately the lack of extendability remains a problem. If a language construct is added, no compile time guarantee can be given that all views support it. @@ -147,11 +147,11 @@ sub x y = \e->x e - y e \end{lstHaskell} Moreover, the language is type safe as it is directly typed in the host language, i.e.\ \haskellinline{lit True `plus` lit 4} is rejected. -Another advantage is the intimate link with the host language, allowing for a lot more linguistic reuse such as the support of implicit sharing~\cite{krishnamurthi_linguistic_2001}. +Another advantage is the intimate link with the host language, allowing for a lot more linguistic reuse such as the support of implicit sharing \citep{krishnamurthi_linguistic_2001}. The downside of this method is extending the language with views. It is nearly impossible to add views to a shallowly embedded language. -The only way of achieving this is by reimplementing all functions so that they run all backends at the same time or to create a single interpretation that produces a fold function~\citep{gibbons_folding_2014}. +The only way of achieving this is by reimplementing all functions so that they run all backends at the same time or to create a single interpretation that produces a fold function \citep{gibbons_folding_2014}. \subsection{Tagless-final embedding}\label{ssec:tagless} By lifting the functions representing the \gls{DSL} terms to type classes, interpretations can be added. @@ -168,7 +168,7 @@ class DSL v where An interpretation of this view is a data type that implements the type class. -\begin{lstHaskell}[label={lst:extagless},caption={A minimal tagless-final \gls{EDSL}.}] +\begin{lstHaskell}[label={lst:extaglessprint},caption={A pretty printer for the tagless-final \gls{EDSL}.}] data Print a = P {runPrint :: String} instance DSL Print where lit a = P (show a) @@ -207,7 +207,7 @@ Both flavours have their strengths and weaknesses and both flavours can be impro \begin{table}[ht] \begin{threeparttable}[b] - \caption{Comparison of embedding techniques, adapted from \citet[Sec.~3.6]{sun_compositional_2022}}% + \caption{Comparison of embedding techniques, adapted from \citet[\citesection{3.6}]{sun_compositional_2022}}% \label{tbl:dsl_comparison} \begin{tabular}{lllllll} \toprule