Index: doc/theses/jiada_liang_MMath/relatedwork.tex
===================================================================
--- doc/theses/jiada_liang_MMath/relatedwork.tex	(revision 56a8eb800f6b55356f6ae8dadefa2a22129648d6)
+++ doc/theses/jiada_liang_MMath/relatedwork.tex	(revision 63379165b0323feff45cb7df3e343e44000450d4)
@@ -2463,8 +2463,8 @@
 
 \section{OCaml}
-\lstnewenvironment{ocaml}[1][]{\lstset{language=OCaml,escapechar=\$,morekeywords={match},moredelim=**[is][\color{red}]{@}{@},}\lstset{#1}}{}
-
-OCaml~\cite{Ocaml} provides a tagged variant (union) type, where multiple heterogeneously-typed objects share the same storage.
-The simplest form of the variant type is a list of untyped tags, which is like an unscoped, pure enumeration.
+\lstnewenvironment{ocaml}[1][]{\lstset{language=OCaml,escapechar=\$,moredelim=**[is][\color{red}]{@}{@},}\lstset{#1}}{}
+
+OCaml~\cite{Ocaml} provides a variant (union) type, where multiple heterogeneously-typed objects share the same storage.
+The simplest form of the variant type is a list of nullary datatype constructors, which is like an unscoped, pure enumeration.
 \begin{ocaml}
 type weekday = Mon | Tue | Wed | Thu | Fri | Sat | Sun
@@ -2479,11 +2479,11 @@
 @CS442@
 \end{ocaml}
-The only operations are binding a tag and pattern matching (equality).
+The only operations are binding and pattern matching (equality), where the variant name is logically the implementation tag stored in the union for discriminating the vale in the object storage.
 Here, function @take_class@ has a @weekday@ parameter, and returns @"CS442"@, if the weekday value is @Mon@ or @Wed@, @"CS343"@, if the value is @Tue@ or @Thu@, and @"Tutorial"@ for @Fri@.
 The ``@_@'' is a wildcard matching any @weekday@ value, so the function returns @"Take a break"@ for values @Sat@ or @Sun@, which are not matched by the previous cases.
-Since the tag has no type, it has a \Newterm{0-arity constructor}, \ie no parameters.
-Because @weekday@ is a summation of values @Mon@ to @Sun@, it is a \Newterm{sum type} in turns of the functional-programming paradigm. 
-
-Each tag can have an associated heterogeneous type, with an n-ary constructor for creating a corresponding value.
+Since the variant has no type, it has a \Newterm{0-arity constructor}, \ie no parameters.
+Because @weekday@ is a union of values @Mon@ to @Sun@, it is a \Newterm{union type} in turns of the functional-programming paradigm. 
+
+Each variant can have an associated heterogeneous type, with an n-ary constructor for creating a corresponding value.
 \begin{ocaml}
 type colour = Red | Green of @string@ | Blue of @int * float@
@@ -2509,8 +2509,8 @@
 A recursive function is often used to pattern match against a recursive variant type.
 \begin{ocaml}
-let rec len_of_string_list( list : stringList ): int =
+let rec @len_of_string_list@( list : stringList ): int =
 	match list with
 		Empty -> 0 |
-		Pair( _ , r ) -> 1 + len_of_string_list r
+		Pair( _ , r ) -> 1 + @len_of_string_list@ r
 \end{ocaml}
 Here, the head of the recursive type is removed and the remainder is processed until the type is empty.
@@ -2518,4 +2518,38 @@
 
 Note, the compiler statically guarantees that only the correct kind of type is used in the \lstinline[language=OCaml]{match} statement.
-However, the tag is dynamically set on binding (and possible reset on assignment), so a \lstinline[language=OCaml]{match} statement is effectively doing RTTI to select the matching case clause.
-Hence, a tagged variant has no notion of enumerabilty, and therefore is not a real enumeration, except for the simple pure (untyped) case.
+However, the union tag is dynamically set on binding (and possible reset on assignment), so a \lstinline[language=OCaml]{match} statement is effectively doing RTTI to select the matching case clause.
+
+In summary, an OCaml variant is a singleton value rather than a set of possibly ordered values, and hence, has no notion of enumerabilty.
+Therefore it is not an enumeration, except for the simple pure (nullary) case.
+
+\begin{comment}
+Date: Wed, 13 Mar 2024 10:52:34 -0400
+Subject: Re: OCaml
+To: "Peter A. Buhr" <pabuhr@uwaterloo.ca>
+From: Gregor Richards <gregor.richards@uwaterloo.ca>
+
+On 3/12/24 18:34, Peter A. Buhr wrote:
+> Gregor, attached is a section Jiada wrote on OCaml (1-page).
+> Does it reflect our discussion about functional languages and enumerations?
+
+Yeah, I think so. The most important part, i.e., that once they're
+parameterized they're not really enumerations at all, is covered clearly
+enough.
+
+A couple quibbles:
+
+<<a list of untyped tags>>
+
+This is true, but leaking implementation details. These are nullary datatype
+constructors. Indeed, you later talk about "tagged variants", which are really
+just parameterized variants, using the term "tag" differently, confusing the
+term "tag" further.
+
+<<Because weekday is a summation of values Mon to Sun, it is a sum type in
+turns of the functional-programming paradigm>>
+
+It is a *union* of values and is a *union* type.
+
+With valediction,
+  - Gregor Richards
+\end{comment}
