From c9d918de8944fb89e11cf182501e9846ff4316e7 Mon Sep 17 00:00:00 2001
From: Alec Theriault <alec.theriault@gmail.com>
Date: Sat, 4 Aug 2018 11:51:30 -0400
Subject: Latex type families (#734)

* Support for type families in LaTeX

The code is ported over from the XHTML backend.

* Refactor XHTML and LaTeX family handling

This is mostly a consolidation effort: stripping extra exports,
inlining some short definitions, and trying to make the backends
match.

The LaTeX backend now has preliminary support for data families,
although the only the data instance head is printed (not the actual constructors).

Both backends also now use "newtype" for newtype data family
instances.

* Add some tests
---
 latex-test/ref/TypeFamilies3/TypeFamilies3.tex | 44 ++++++++++++++++++++++++++
 1 file changed, 44 insertions(+)
 create mode 100644 latex-test/ref/TypeFamilies3/TypeFamilies3.tex

(limited to 'latex-test/ref/TypeFamilies3/TypeFamilies3.tex')

diff --git a/latex-test/ref/TypeFamilies3/TypeFamilies3.tex b/latex-test/ref/TypeFamilies3/TypeFamilies3.tex
new file mode 100644
index 00000000..2a8ad297
--- /dev/null
+++ b/latex-test/ref/TypeFamilies3/TypeFamilies3.tex
@@ -0,0 +1,44 @@
+\haddockmoduleheading{TypeFamilies3}
+\label{module:TypeFamilies3}
+\haddockbeginheader
+{\haddockverb\begin{verbatim}
+module TypeFamilies3 (
+    Foo,  Bar,  Baz(Baz3, Baz2, Baz1)
+  ) where\end{verbatim}}
+\haddockendheader
+
+\begin{haddockdesc}
+\item[\begin{tabular}{@{}l}
+type\ family\ Foo\ a\ where
+\end{tabular}]\haddockbegindoc
+\haddockbeginargs
+\haddockdecltt{Foo () = Int} \\
+\haddockdecltt{Foo \_ = ()} \\
+\end{tabulary}\par
+A closed type family\par
+
+\end{haddockdesc}
+\begin{haddockdesc}
+\item[\begin{tabular}{@{}l}
+type\ family\ Bar\ a
+\end{tabular}]\haddockbegindoc
+An open family\par
+
+\end{haddockdesc}
+\begin{haddockdesc}
+\item[\begin{tabular}{@{}l}
+type\ instance\ Bar\ Int\ =\ ()\\type\ instance\ Bar\ ()\ =\ Int
+\end{tabular}]
+\end{haddockdesc}
+\begin{haddockdesc}
+\item[\begin{tabular}{@{}l}
+data\ family\ Baz\ a
+\end{tabular}]\haddockbegindoc
+A data family\par
+
+\end{haddockdesc}
+\begin{haddockdesc}
+\item[\begin{tabular}{@{}l}
+newtype\ instance\ Baz\ Double\\data\ instance\ Baz\ Int\\data\ instance\ Baz\ ()
+\end{tabular}]
+\end{haddockdesc}
\ No newline at end of file
-- 
cgit v1.2.3

