Index: doc/theses/jiada_liang_MMath/relatedwork.tex
===================================================================
--- doc/theses/jiada_liang_MMath/relatedwork.tex	(revision 8bdc9705a269bca69e322995d14337a6dacfab4a)
+++ doc/theses/jiada_liang_MMath/relatedwork.tex	(revision 56a8eb800f6b55356f6ae8dadefa2a22129648d6)
@@ -2463,5 +2463,5 @@
 
 \section{OCaml}
-\lstnewenvironment{ocaml}[1][]{\lstset{language=ML,escapechar=\$,morekeywords={match},moredelim=**[is][\color{red}]{@}{@},}\lstset{#1}}{}
+\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.
@@ -2469,7 +2469,7 @@
 \begin{ocaml}
 type weekday = Mon | Tue | Wed | Thu | Fri | Sat | Sun
-let day : weekday = Mon					$\C{(* bind *)}$
+let day : weekday @= Mon@				$\C{(* bind *)}$
 let take_class( d : weekday ) =
-	match d with						$\C{(* matching *)}$
+	@match@ d with						$\C{(* matching *)}$
 		Mon | Wed -> Printf.printf "CS442\n" |
 		Tue | Thu -> Printf.printf "CS343\n" |
@@ -2487,15 +2487,15 @@
 Each tag 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
+type colour = Red | Green of @string@ | Blue of @int * float@
 \end{ocaml}
-@colour@ is a summation of a nullary type, a unary product type of @string@, and a cross product of @int@ and @bool@.
-(Mathematically, a @Blue@ value is a Cartesian product of the @int@ type and the @bool@.)
+@colour@ is a summation of a nullary type, a unary product type of @string@, and a cross product of @int@ and @float@.
+(Mathematically, a @Blue@ value is a Cartesian product of the types @int@ type and @float@.)
 Hence, a variant type creates a sum of product of different types.
 \begin{ocaml}
-let c : colour = Red					$\C{(* 0-ary constructor *)}$
+let c = Red								$\C{(* 0-ary constructor, set tag *)}$
 let _ = match c with Red -> Printf.printf "Red, "
-let c : colour = Green( "abc" )			$\C{(* 1-ary constructor *)}$
+let c = Green( "abc" )					$\C{(* 1-ary constructor, set tag *)}$
 let _ = match c with Green g -> Printf.printf "%s, " g
-let c : colour = Blue( 1, 1.5 )			$\C{(* 2-ary constructor *)}$
+let c = Blue( 1, 1.5 )					$\C{(* 2-ary constructor, set tag *)}$
 let _ = match c with Blue( i, f ) -> Printf.printf "%d %g\n" i f
 @Red, abc, 1 1.5@
@@ -2504,5 +2504,5 @@
 A variant type can have a recursive definition.
 \begin{ocaml}
-type stringList = Empty | Pair of string * stringList
+type @stringList@ = Empty | Pair of string * @stringList@
 \end{ocaml}
 which is a recursive sum of product of types, called an \Newterm{algebraic data-type}.
@@ -2517,5 +2517,5 @@
 Each recursion is counted to obtain the number of elements in the type.
 
-Note, the compiler statically guarantees that only the correct kind of type can be used in the \lstinline[language=ML]{match} statement.
-However, the tag is dynamically set on binding (and possible reset on assignment), so the \lstinline[language=ML]{match} statement is effectively doing RTTI to select the matching case clause.
+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.
