Index: doc/generic_types/generic_types.tex
===================================================================
--- doc/generic_types/generic_types.tex	(revision 036895e5fb641058a83f71934ff4f32d4f26424d)
+++ doc/generic_types/generic_types.tex	(revision 0a84919f0cbb3a7a91b2965a5d47497496481d1b)
@@ -9,4 +9,8 @@
 
 \makeatletter
+% Default underscore is too low and wide. Cannot use lstlisting "literate" as replacing underscore
+% removes it as a variable-name character so keyworks in variables are highlighted
+\DeclareTextCommandDefault{\textunderscore}{\leavevmode\makebox[1.2ex][c]{\rule{1ex}{0.1ex}}}
+
 % parindent is relative, i.e., toggled on/off in environments like itemize, so store the value for
 % use rather than use \parident directly.
@@ -14,5 +18,5 @@
 \setlength{\parindentlnth}{\parindent}
 
-\newlength{\gcolumnposn}				% temporary hack because lstlisting does handle tabs correctly
+\newlength{\gcolumnposn}				% temporary hack because lstlisting does not handle tabs correctly
 \newlength{\columnposn}
 \setlength{\gcolumnposn}{2.75in}
@@ -21,6 +25,4 @@
 \newcommand{\CRT}{\global\columnposn=\gcolumnposn}
 
-\newcommand{\TODO}[1]{\textbf{TODO}: {\itshape #1}} % TODO included
-%\newcommand{\TODO}[1]{} % TODO elided
 % Latin abbreviation
 \newcommand{\abbrevFont}{\textit}	% set empty for no italics
@@ -43,7 +45,4 @@
 	        {\abbrevFont{et al}.\xspace}%
 }%
-% \newcommand{\eg}{\textit{e}.\textit{g}.,\xspace}
-% \newcommand{\ie}{\textit{i}.\textit{e}.,\xspace}
-% \newcommand{\etc}{\textit{etc}.,\xspace}
 \makeatother
 
@@ -58,4 +57,6 @@
 \newcommand{\CS}{C\raisebox{-0.7ex}{\Large$^\sharp$}\xspace}
 \newcommand{\Textbf}[1]{{\color{red}\textbf{#1}}}
+\newcommand{\TODO}[1]{\textbf{TODO}: {\itshape #1}} % TODO included
+%\newcommand{\TODO}[1]{} % TODO elided
 
 % CFA programming language, based on ANSI C (with some gcc additions)
@@ -82,7 +83,7 @@
 belowskip=3pt,
 % replace/adjust listing characters that look bad in sanserif
-literate={-}{\raisebox{-0.15ex}{\texttt{-}}}1 {^}{\raisebox{0.6ex}{$\scriptscriptstyle\land\,$}}1
-	{~}{\raisebox{0.3ex}{$\scriptstyle\sim\,$}}1%{_}{\makebox[1.2ex][c]{\rule{1ex}{0.1ex}}}1 % {`}{\ttfamily\upshape\hspace*{-0.1ex}`}1
-	{<-}{$\leftarrow$}2 {=>}{$\Rightarrow$}2,
+literate={-}{\makebox[1.4ex][c]{\raisebox{0.5ex}{\rule{1.2ex}{0.1ex}}}}1 {^}{\raisebox{0.6ex}{$\scriptscriptstyle\land\,$}}1
+	{~}{\raisebox{0.3ex}{$\scriptstyle\sim\,$}}1 % {`}{\ttfamily\upshape\hspace*{-0.1ex}`}1
+	{<-}{$\leftarrow$}2 {=>}{$\Rightarrow$}2 {->}{\makebox[1.4ex][c]{\raisebox{0.5ex}{\rule{1.2ex}{0.1ex}}}\kern-0.3ex\textgreater}2,
 moredelim=**[is][\color{red}]{`}{`},
 }% lstset
@@ -185,5 +186,5 @@
 \CC is used similarly, but has the disadvantages of multiple legacy design-choices that cannot be updated and active divergence of the language model from C, requiring significant effort and training to incrementally add \CC to a C-based project.
 
-\CFA is currently implemented as a source-to-source translator from \CFA to the GCC-dialect of C~\citep{GCCExtensions}, allowing it to leverage the portability and code optimizations provided by GCC, meeting goals (1)-(3).
+\CFA is currently implemented as a source-to-source translator from \CFA to the GCC-dialect of C~\citep{GCCExtensions}, allowing it to leverage the portability and code optimizations provided by GCC, meeting goals (1)--(3).
 Ultimately, a compiler is necessary for advanced features and optimal performance.
 
@@ -273,17 +274,8 @@
 
 Finally, \CFA allows variable overloading:
-%\lstDeleteShortInline@%
-%\par\smallskip
-%\begin{tabular}{@{}l@{\hspace{1.5\parindent}}||@{\hspace{1.5\parindent}}l@{}}
 \begin{lstlisting}
 short int MAX = ...;   int MAX = ...;  double MAX = ...;
 short int s = MAX;    int i = MAX;    double d = MAX;   $\C{// select correct MAX}$
 \end{lstlisting}
-%\end{lstlisting}
-%&
-%\begin{lstlisting}
-%\end{tabular}
-%\smallskip\par\noindent
-%\lstMakeShortInline@%
 Here, the single name @MAX@ replaces all the C type-specific names: @SHRT_MAX@, @INT_MAX@, @DBL_MAX@.
 As well, restricted constant overloading is allowed for the values @0@ and @1@, which have special status in C, \eg the value @0@ is both an integer and a pointer literal, so its meaning depends on context.
@@ -464,7 +456,4 @@
 }
 \end{lstlisting}
-%	int c = cmp( a->first, b->first );
-%	if ( c == 0 ) c = cmp( a->second, b->second );
-%	return c;
 Since @pair(T *, T * )@ is a concrete type, there are no implicit parameters passed to @lexcmp@, so the generated code is identical to a function written in standard C using @void *@, yet the \CFA version is type-checked to ensure the fields of both pairs and the arguments to the comparison function match in type.
 
@@ -612,8 +601,8 @@
 double y = 3.5;
 [int, double] z;
-z = [x, y];		$\C{// multiple assignment}$
-[x, y] = z;		$\C{// multiple assignment}$
-z = 10;			$\C{// mass assignment}$
-[y, x] = 3.14;	$\C{// mass assignment}$
+z = [x, y];									$\C{// multiple assignment}$
+[x, y] = z;									$\C{// multiple assignment}$
+z = 10;										$\C{// mass assignment}$
+[y, x] = 3.14;								$\C{// mass assignment}$
 \end{lstlisting}
 %\end{lstlisting}
@@ -652,7 +641,7 @@
 [int, int, long, double] x;
 void f( double, long );
-x.[0, 1] = x.[1, 0];    $\C{// rearrange: [x.0, x.1] = [x.1, x.0]}$
-f( x.[0, 3] );            $\C{// drop: f(x.0, x.3)}$
-[int, int, int] y = x.[2, 0, 2]; $\C{// duplicate: [y.0, y.1, y.2] = [x.2, x.0.x.2]}$
+x.[0, 1] = x.[1, 0];						$\C{// rearrange: [x.0, x.1] = [x.1, x.0]}$
+f( x.[0, 3] );								$\C{// drop: f(x.0, x.3)}$
+[int, int, int] y = x.[2, 0, 2];			$\C{// duplicate: [y.0, y.1, y.2] = [x.2, x.0.x.2]}$
 \end{lstlisting}
 %\end{lstlisting}
@@ -851,5 +840,5 @@
 \begin{lstlisting}
 forall(dtype T0, dtype T1 | sized(T0) | sized(T1)) struct _tuple2 {
-	T0 field_0;			$\C{// generated before the first 2-tuple}$
+	T0 field_0;								$\C{// generated before the first 2-tuple}$
 	T1 field_1;
 };
@@ -857,5 +846,5 @@
 	_tuple2(double, double) x;
 	forall(dtype T0, dtype T1, dtype T2 | sized(T0) | sized(T1) | sized(T2)) struct _tuple3 {
-		T0 field_0;		$\C{// generated before the first 3-tuple}$
+		T0 field_0;							$\C{// generated before the first 3-tuple}$
 		T1 field_1;
 		T2 field_2;
@@ -1109,7 +1098,7 @@
 
 \begin{acks}
-The authors would like to recognize the design assistance of Glen Ditchfield, Richard Bilson, and Thierry Delisle on the features described in this paper. They also thank Magnus Madsen and three anonymous reviewers for valuable editorial feedback.
-
-This work is supported in part by a corporate partnership with \grantsponsor{Huawei}{Huawei Ltd.}{http://www.huawei.com}\ and the first author's \grantsponsor{NSERC-PGS}{NSERC PGS D}{http://www.nserc-crsng.gc.ca/Students-Etudiants/PG-CS/BellandPostgrad-BelletSuperieures_eng.asp} scholarship.
+The authors would like to recognize the design assistance of Glen Ditchfield, Richard Bilson, and Thierry Delisle on the features described in this paper, and thank Magnus Madsen and the three anonymous reviewers for valuable feedback.
+This work is supported in part by a corporate partnership with \grantsponsor{Huawei}{Huawei Ltd.}{http://www.huawei.com}, and Aaron Moss and Peter Buhr are funded by the \grantsponsor{Natural Sciences and Engineering Research Council} of Canada.
+% the first author's \grantsponsor{NSERC-PGS}{NSERC PGS D}{http://www.nserc-crsng.gc.ca/Students-Etudiants/PG-CS/BellandPostgrad-BelletSuperieures_eng.asp} scholarship.
 \end{acks}
 
@@ -1125,71 +1114,4 @@
 
 \lstset{basicstyle=\linespread{0.9}\sf\small}
-
-\begin{comment}
-\CFA
-\begin{lstlisting}[xleftmargin=2\parindentlnth,aboveskip=0pt,belowskip=0pt]
-forall(otype T) struct stack_node;
-forall(otype T) struct stack { stack_node(T) * head; };
-forall(otype T) void ?{}(stack(T) * s);
-forall(otype T) void ?{}(stack(T) * s, stack(T) t);
-forall(otype T) stack(T) ?=?(stack(T) * s, stack(T) t);
-forall(otype T) void ^?{}(stack(T) * s);
-forall(otype T) _Bool empty(const stack(T) * s);
-forall(otype T) void push(stack(T) * s, T value);
-forall(otype T) T pop(stack(T) * s);
-forall(otype T) void clear(stack(T) * s);
-
-void print( FILE * out, const char * x );
-void print( FILE * out, _Bool x );
-void print( FILE * out, char x );
-void print( FILE * out, int x );
-forall(otype T, ttype Params | { void print( FILE *, T ); void print( FILE *, Params ); })
-	void print( FILE * out, T arg, Params rest );
-forall(otype R, otype S | { void print( FILE *, R ); void print( FILE *, S ); })
-	void print( FILE * out, pair(R, S) x );
-\end{lstlisting}
-
-\medskip\noindent
-\CC
-\begin{lstlisting}[xleftmargin=2\parindentlnth,aboveskip=0pt,belowskip=0pt]
-std::pair
-std::forward_list wrapped in std::stack interface
-
-template<typename T> void print(ostream & out, const T & x) { out << x; }
-template<> void print<bool>(ostream & out, const bool & x) { out << (x ? "true" : "false"); }
-template<> void print<char>(ostream & out, const char & x ) { out << "'" << x << "'"; }
-template<typename R, typename S> ostream & operator<< (ostream & out, const pair<R, S>& x) {
-	out << "["; print(out, x.first); out << ", "; print(out, x.second); return out << "]"; }
-template<typename T, typename... Args> void print(ostream & out, const T & arg, const Args &... rest) {
-	out << arg;	print(out, rest...); }
-\end{lstlisting}
-
-\medskip\noindent
-C
-\begin{lstlisting}[xleftmargin=2\parindentlnth,aboveskip=0pt,belowskip=0pt]
-struct pair { void * first, second; };
-struct pair * new_pair( void * first, void * second );
-struct pair * copy_pair( const struct pair * src, 
-	void * (*copy_first)( const void * ), void * (*copy_second)( const void * ) );
-void free_pair( struct pair * p, void (*free_first)( void * ), void (*free_second)( void * ) );
-int cmp_pair( const struct pair * a, const struct pair * b, 
-	int (*cmp_first)( const void *, const void * ), int (*cmp_second)( const void *, const void * ) );
-
-struct stack_node;
-struct stack { struct stack_node * head; };
-struct stack new_stack();
-void copy_stack( struct stack * dst, const struct stack * src, void * (*copy)( const void * ) );
-void clear_stack( struct stack * s, void (*free_el)( void * ) );
-_Bool stack_empty( const struct stack * s );
-void push_stack( struct stack * s, void * value );
-void * pop_stack( struct stack * s );
-
-void print_string( FILE * out, const char * x );
-void print_bool( FILE * out, _Bool x );
-void print_char( FILE * out, char x );
-void print_int( FILE * out, int x );
-void print( FILE * out, const char * fmt, ... );
-\end{lstlisting}
-\end{comment}
 
 Throughout, @/***/@ designates a counted redundant type annotation.
