directory structure
[phd-thesis.git] / dsl / first-class_datatypes.tex
similarity index 99%
rename from domain-specific_languages/first-class_datatypes.tex
rename to dsl/first-class_datatypes.tex
index b579445..2f3464c 100644 (file)
@@ -118,7 +118,7 @@ First a data type representing the semantics is defined. In this case, the print
 \footnotetext{%
        In this case a \haskellinline{newtype} is used instead of regular \haskellinline{data} declarations.
        \haskellinline{newtype}s are special data types only consisting a single constructor with one field to which the type is isomorphic.
-       During compilation the constructor is completely removed resulting in no overhead~\cite[Sec.~4.2.3]{peyton_jones_haskell_2003}.
+       During compilation the constructor is completely removed resulting in no overhead~\citep[Sec.~4.2.3]{peyton_jones_haskell_2003}.
 }
 Since the language is typed, the printer data type has to have a type variable but it is only used during typing---i.e.\ a phantom type~\citep{leijen_domain_2000}:
 
@@ -262,7 +262,7 @@ Metaprogramming is a special flavour of programming where programs have the abil
 There are several techniques to facilitate metaprogramming, moreover it has been around for many years now~\citep{lilis_survey_2019}.
 Even though it has been around for many years, it is considered complex~\citep{sheard_accomplishments_2001}.
 
-\gls{TH} is GHC's de facto metaprogramming system, implemented as a compiler extension together with a library~\citep{sheard_template_2002}\cite[Sec.~6.13.1]{ghc_team_ghc_2021}.
+\gls{TH} is GHC's de facto metaprogramming system, implemented as a compiler extension together with a library~\citep{sheard_template_2002}\citep[Sec.~6.13.1]{ghc_team_ghc_2021}.
 Readers already familiar with \gls{TH} can safely skip this section.
 
 \gls{TH} adds four main concepts to the language, na\-me\-ly AST data types, splicing, quasiquotation and reification.
@@ -711,7 +711,7 @@ bin = QuasiQuoter { quoteExp = parseBin }
 Custom quasiquoters allow the \gls{DSL} user to enter fragments verbatim, bypassing the syntax of the host language.
 Pattern matching in general is not suitable for a custom quasiquoter because it does not really fit in one of the four syntactic categories for which custom quasiquoter support is available.
 However, a concrete use of pattern matching, interesting enough to be beneficial, but simple enough for a demonstration is the \emph{simple case expression}, a case expression that does not contain nested patterns and is always exhaustive.
-They correspond to a multi-way conditional expressions and can thus be converted to \gls{DSL} constructs straightforwardly~\cite[Chp.~4.4]{peyton_jones_implementation_1987}.
+They correspond to a multi-way conditional expressions and can thus be converted to \gls{DSL} constructs straightforwardly~\citep[Chp.~4.4]{peyton_jones_implementation_1987}.
 
 In contrast to the binary literal quasiquoter example, we do not create the parser by hand.
 The parser combinator library \emph{parsec} is used instead to ease the creation of the parser~\citep{leijen_parsec_2001}.
@@ -796,9 +796,9 @@ In generic programming, types are represented as sums of products and using this
 
 For example, Rhiger showed a method for expressing statically typed pattern matching using typed higher-order functions~\citep{rhiger_type-safe_2009}.
 If not the host language but the \gls{DSL} contains higher order functions, the same technique could be applied to port pattern matching to \glspl{DSL} though using an explicit sums of products representation.
-Atkey et al.\ describe embedding pattern matching in a \gls{DSL} by giving patterns an explicit representation in the \gls{DSL} by using pairs, sums and injections~\cite[Section~3.3]{atkey_unembedding_2009}.
+Atkey et al.\ describe embedding pattern matching in a \gls{DSL} by giving patterns an explicit representation in the \gls{DSL} by using pairs, sums and injections~\citep[Sec.~3.3]{atkey_unembedding_2009}.
 
-McDonell et al.\ extends on this idea, resulting in a very similar but different solution to ours~\citep{mcdonell_embedded_2021}.
+McDonell et al.\ extends on this idea, resulting in a very similar but different solution to ours~\citep{mcdonell_embedded_2022}.
 They used the technique that Atkey et al.\ showed and applied it to deep embedding using the concrete syntax of the host language.
 The scaffolding---e.g.\ generating the pairs, sums and injections---for embedding is automated using generics but the required pattern synonyms are generated using \gls{TH}.
 The key difference to our approach is that we specialise the implementation for each of the backends instead of providing a general implementation of data type handling operations.