aboutsummaryrefslogtreecommitdiff
path: root/latex-test
diff options
context:
space:
mode:
authorBen Gamari <ben@smart-cactus.org>2021-01-05 19:30:24 -0500
committerBen Gamari <ben@smart-cactus.org>2021-01-13 18:39:25 -0500
commite1230ede3d1c77a6916e318aefcd47829e56035c (patch)
tree36b89a8d6fae359a5c5de4887c020a6101bd5cf8 /latex-test
parent9a7e3d6fa3faad2ccb75f7f3e9d9f4bc203a77ca (diff)
parent99f61534a470b84c424fde0835215de6a3b6d721 (diff)
Merge remote-tracking branch 'origin/ghc-9.0' into ghc-head
Diffstat (limited to 'latex-test')
-rwxr-xr-xlatex-test/Main.hs4
-rw-r--r--latex-test/ref/ConstructorArgs/ConstructorArgs.tex32
-rw-r--r--latex-test/ref/ConstructorArgs/haddock.sty57
-rw-r--r--latex-test/ref/ConstructorArgs/main.tex11
-rw-r--r--latex-test/ref/DefaultSignatures/DefaultSignatures.tex41
-rw-r--r--latex-test/ref/Deprecated/Deprecated.tex17
-rw-r--r--latex-test/ref/Example/Example.tex30
-rw-r--r--latex-test/ref/GadtConstructorArgs/GadtConstructorArgs.tex15
-rw-r--r--latex-test/ref/GadtConstructorArgs/haddock.sty57
-rw-r--r--latex-test/ref/GadtConstructorArgs/main.tex11
-rw-r--r--latex-test/ref/LinearTypes/LinearTypes.tex26
-rw-r--r--latex-test/ref/NamespacedIdentifier/NamespacedIdentifiers.tex37
-rw-r--r--latex-test/ref/Simple/Simple.tex8
-rw-r--r--latex-test/ref/Simple/haddock.sty57
-rw-r--r--latex-test/ref/Simple/main.tex11
-rw-r--r--latex-test/ref/TypeFamilies3/TypeFamilies3.tex32
-rw-r--r--latex-test/ref/TypeFamilies3/haddock.sty57
-rw-r--r--latex-test/ref/TypeFamilies3/main.tex11
-rw-r--r--latex-test/ref/UnboxedStuff/UnboxedStuff.tex26
-rw-r--r--latex-test/ref/UnboxedStuff/haddock.sty57
-rw-r--r--latex-test/ref/UnboxedStuff/main.tex11
-rw-r--r--latex-test/src/DefaultSignatures/DefaultSignatures.hs19
-rw-r--r--latex-test/src/Deprecated/Deprecated.hs7
-rw-r--r--latex-test/src/Example/Example.hs11
-rw-r--r--latex-test/src/NamespacedIdentifier/NamespacedIdentifier.hs13
25 files changed, 249 insertions, 409 deletions
diff --git a/latex-test/Main.hs b/latex-test/Main.hs
index 8d2a4922..17ae8ae8 100755
--- a/latex-test/Main.hs
+++ b/latex-test/Main.hs
@@ -19,7 +19,9 @@ checkConfig = CheckConfig
dirConfig :: DirConfig
-dirConfig = defaultDirConfig $ takeDirectory __FILE__
+dirConfig = (defaultDirConfig $ takeDirectory __FILE__)
+ { dcfgCheckIgnore = (`elem` ["haddock.sty", "main.tex"]) . takeFileName
+ }
main :: IO ()
diff --git a/latex-test/ref/ConstructorArgs/ConstructorArgs.tex b/latex-test/ref/ConstructorArgs/ConstructorArgs.tex
index 44304f47..c8e5271d 100644
--- a/latex-test/ref/ConstructorArgs/ConstructorArgs.tex
+++ b/latex-test/ref/ConstructorArgs/ConstructorArgs.tex
@@ -3,15 +3,16 @@
\haddockbeginheader
{\haddockverb\begin{verbatim}
module ConstructorArgs (
- Foo((:|), Rec, Baz, Boa, (:*), x, y), Boo(Foo, Foa, Fo, Fo'), pattern Bo,
+ Foo((:|), Rec, Baz, Boa, (:*), x, y), Boo(Foo, Foa, Fo, Fo'), pattern Bo,
pattern Bo'
) where\end{verbatim}}
\haddockendheader
\begin{haddockdesc}
\item[\begin{tabular}{@{}l}
-data\ Foo
-\end{tabular}]\haddockbegindoc
+data Foo
+\end{tabular}]
+{\haddockbegindoc
\enspace \emph{Constructors}\par
\haddockbeginconstrs
\haddockdecltt{=} & \haddockdecltt{Rec} & doc on a record \\
@@ -25,12 +26,13 @@ data\ Foo
\haddockdecltt{|} & \haddockdecltt{(:*)} & doc on the \haddockid{:*} constructor \\
& \qquad \haddockdecltt{Int} & doc on the \haddockid{Int} field of the \haddockid{:*} constructor \\
& \qquad \haddockdecltt{String} & doc on the \haddockid{String} field of the \haddockid{:*} constructor \\
-\end{tabulary}\par
+\end{tabulary}\par}
\end{haddockdesc}
\begin{haddockdesc}
\item[\begin{tabular}{@{}l}
-data\ Boo\ where
-\end{tabular}]\haddockbegindoc
+data Boo where
+\end{tabular}]
+{\haddockbegindoc
\enspace \emph{Constructors}\par
\haddockbeginconstrs
& \haddockdecltt{Foo} & Info about a \haddockid{Foo} \\
@@ -46,24 +48,24 @@ data\ Boo\ where
& \qquad \haddockdecltt{->} \enspace \haddockdecltt{String} & a \haddockid{String} \\
& \qquad \haddockdecltt{->} \enspace \haddockdecltt{Boo} & a \haddockid{Boo} \\
& \haddockdecltt{pattern Fo' :: Boo} & Bundled and no argument docs \\
-\end{tabulary}\par
+\end{tabulary}\par}
\end{haddockdesc}
\begin{haddockdesc}
\item[\begin{tabular}{@{}l}
-pattern\ Bo
-\end{tabular}]\haddockbegindoc
+pattern Bo
+\end{tabular}]
+{\haddockbegindoc
\haddockbeginargs
\haddockdecltt{::} & \haddockdecltt{Int} & an \haddockid{Int} \\
\haddockdecltt{->} & \haddockdecltt{String} & a \haddockid{String} \\
\haddockdecltt{->} & \haddockdecltt{Boo} & a \haddockid{Boo} pattern \\
\end{tabulary}\par
-Info about not-bundled \haddockid{Bo}\par
-
+Info about not-bundled \haddockid{Bo}\par}
\end{haddockdesc}
\begin{haddockdesc}
\item[\begin{tabular}{@{}l}
-pattern\ Bo'\ ::\ Int\ ->\ String\ ->\ Boo
-\end{tabular}]\haddockbegindoc
-Not bunded and no argument docs\par
-
+pattern Bo' :: Int -> String -> Boo
+\end{tabular}]
+{\haddockbegindoc
+Not bunded and no argument docs\par}
\end{haddockdesc} \ No newline at end of file
diff --git a/latex-test/ref/ConstructorArgs/haddock.sty b/latex-test/ref/ConstructorArgs/haddock.sty
deleted file mode 100644
index 6e031a98..00000000
--- a/latex-test/ref/ConstructorArgs/haddock.sty
+++ /dev/null
@@ -1,57 +0,0 @@
-% Default Haddock style definitions. To use your own style, invoke
-% Haddock with the option --latex-style=mystyle.
-
-\usepackage{tabulary} % see below
-
-% make hyperlinks in the PDF, and add an expandabale index
-\usepackage[pdftex,bookmarks=true]{hyperref}
-
-\newenvironment{haddocktitle}
- {\begin{center}\bgroup\large\bfseries}
- {\egroup\end{center}}
-\newenvironment{haddockprologue}{\vspace{1in}}{}
-
-\newcommand{\haddockmoduleheading}[1]{\chapter{\texttt{#1}}}
-
-\newcommand{\haddockbeginheader}{\hrulefill}
-\newcommand{\haddockendheader}{\noindent\hrulefill}
-
-% a little gap before the ``Methods'' header
-\newcommand{\haddockpremethods}{\vspace{2ex}}
-
-% inserted before \\begin{verbatim}
-\newcommand{\haddockverb}{\small}
-
-% an identifier: add an index entry
-\newcommand{\haddockid}[1]{\haddocktt{#1}\index{#1@\texttt{#1}}}
-
-% The tabulary environment lets us have a column that takes up ``the
-% rest of the space''. Unfortunately it doesn't allow
-% the \end{tabulary} to be in the expansion of a macro, it must appear
-% literally in the document text, so Haddock inserts
-% the \end{tabulary} itself.
-\newcommand{\haddockbeginconstrs}{\begin{tabulary}{\linewidth}{@{}llJ@{}}}
-\newcommand{\haddockbeginargs}{\begin{tabulary}{\linewidth}{@{}llJ@{}}}
-
-\newcommand{\haddocktt}[1]{{\small \texttt{#1}}}
-\newcommand{\haddockdecltt}[1]{{\small\bfseries \texttt{#1}}}
-
-\makeatletter
-\newenvironment{haddockdesc}
- {\list{}{\labelwidth\z@ \itemindent-\leftmargin
- \let\makelabel\haddocklabel}}
- {\endlist}
-\newcommand*\haddocklabel[1]{\hspace\labelsep\haddockdecltt{#1}}
-\makeatother
-
-% after a declaration, start a new line for the documentation.
-% Otherwise, the documentation starts right after the declaration,
-% because we're using the list environment and the declaration is the
-% ``label''. I tried making this newline part of the label, but
-% couldn't get that to work reliably (the space seemed to stretch
-% sometimes).
-\newcommand{\haddockbegindoc}{\hfill\\[1ex]}
-
-% spacing between paragraphs and no \parindent looks better
-\parskip=10pt plus2pt minus2pt
-\setlength{\parindent}{0cm}
diff --git a/latex-test/ref/ConstructorArgs/main.tex b/latex-test/ref/ConstructorArgs/main.tex
deleted file mode 100644
index 80f639c5..00000000
--- a/latex-test/ref/ConstructorArgs/main.tex
+++ /dev/null
@@ -1,11 +0,0 @@
-\documentclass{book}
-\usepackage{haddock}
-\begin{document}
-\begin{titlepage}
-\begin{haddocktitle}
-
-\end{haddocktitle}
-\end{titlepage}
-\tableofcontents
-\input{ConstructorArgs}
-\end{document} \ No newline at end of file
diff --git a/latex-test/ref/DefaultSignatures/DefaultSignatures.tex b/latex-test/ref/DefaultSignatures/DefaultSignatures.tex
new file mode 100644
index 00000000..162f5014
--- /dev/null
+++ b/latex-test/ref/DefaultSignatures/DefaultSignatures.tex
@@ -0,0 +1,41 @@
+\haddockmoduleheading{DefaultSignatures}
+\label{module:DefaultSignatures}
+\haddockbeginheader
+{\haddockverb\begin{verbatim}
+module DefaultSignatures (
+ Foo(baz', baz, bar)
+ ) where\end{verbatim}}
+\haddockendheader
+
+\begin{haddockdesc}
+\item[\begin{tabular}{@{}l}
+class Foo a where
+\end{tabular}]
+{\haddockbegindoc
+Documentation for Foo.\par
+\haddockpremethods{}\emph{Methods}
+\begin{haddockdesc}
+\item[\begin{tabular}{@{}l}
+bar, baz :: a -> String
+\end{tabular}]
+{\haddockbegindoc
+Documentation for bar and baz.\par}
+\end{haddockdesc}
+\begin{haddockdesc}
+\item[\begin{tabular}{@{}l}
+default bar :: Show a => a -> String
+\end{tabular}]
+\end{haddockdesc}
+\begin{haddockdesc}
+\item[\begin{tabular}{@{}l}
+baz' :: String -> a
+\end{tabular}]
+{\haddockbegindoc
+Documentation for baz'.\par}
+\end{haddockdesc}
+\begin{haddockdesc}
+\item[\begin{tabular}{@{}l}
+default baz' :: Read a => String -> a
+\end{tabular}]
+\end{haddockdesc}}
+\end{haddockdesc} \ No newline at end of file
diff --git a/latex-test/ref/Deprecated/Deprecated.tex b/latex-test/ref/Deprecated/Deprecated.tex
new file mode 100644
index 00000000..0ae2410b
--- /dev/null
+++ b/latex-test/ref/Deprecated/Deprecated.tex
@@ -0,0 +1,17 @@
+\haddockmoduleheading{Deprecated}
+\label{module:Deprecated}
+\haddockbeginheader
+{\haddockverb\begin{verbatim}
+module Deprecated (
+ deprecated
+ ) where\end{verbatim}}
+\haddockendheader
+
+\begin{haddockdesc}
+\item[\begin{tabular}{@{}l}
+deprecated :: Int
+\end{tabular}]
+{\haddockbegindoc
+Deprecated: Don't use this\par
+Docs for something deprecated\par}
+\end{haddockdesc} \ No newline at end of file
diff --git a/latex-test/ref/Example/Example.tex b/latex-test/ref/Example/Example.tex
new file mode 100644
index 00000000..11f7e734
--- /dev/null
+++ b/latex-test/ref/Example/Example.tex
@@ -0,0 +1,30 @@
+\haddockmoduleheading{Example}
+\label{module:Example}
+\haddockbeginheader
+{\haddockverb\begin{verbatim}
+module Example (
+ split
+ ) where\end{verbatim}}
+\haddockendheader
+
+\begin{haddockdesc}
+\item[\begin{tabular}{@{}l}
+split :: Int -> ()
+\end{tabular}]
+{\haddockbegindoc
+Example use.\par
+\begin{quote}
+{\haddockverb\begin{verbatim}
+>>> split 1
+()
+
+\end{verbatim}}
+\end{quote}
+\begin{quote}
+{\haddockverb\begin{verbatim}
+>>> split 2
+()
+
+\end{verbatim}}
+\end{quote}}
+\end{haddockdesc} \ No newline at end of file
diff --git a/latex-test/ref/GadtConstructorArgs/GadtConstructorArgs.tex b/latex-test/ref/GadtConstructorArgs/GadtConstructorArgs.tex
index 7aaf5512..9953ce55 100644
--- a/latex-test/ref/GadtConstructorArgs/GadtConstructorArgs.tex
+++ b/latex-test/ref/GadtConstructorArgs/GadtConstructorArgs.tex
@@ -9,17 +9,18 @@ module GadtConstructorArgs (
\begin{haddockdesc}
\item[\begin{tabular}{@{}l}
-data\ Boo\ where
-\end{tabular}]\haddockbegindoc
+data Boo where
+\end{tabular}]
+{\haddockbegindoc
\enspace \emph{Constructors}\par
\haddockbeginconstrs
& \haddockdecltt{Fot} & \\
- & \qquad \haddockdecltt{:: \{} \enspace \haddockdecltt{x :: Int} & an \haddockid{x} \\
+ & \qquad \haddockdecltt{:: {\char '173}} \enspace \haddockdecltt{x :: Int} & an \haddockid{x} \\
& \qquad \haddockdecltt{\ \ \ \ ,} \enspace \haddockdecltt{y :: Int} & a \haddockid{y} \\
- & \qquad \haddockdecltt{\ \ \ \ \} ->} \enspace \haddockdecltt{Boo} & \\
+ & \qquad \haddockdecltt{\ \ \ \ {\char '175} ->} \enspace \haddockdecltt{Boo} & \\
& \haddockdecltt{Fob} & Record GADT with docs \\
- & \qquad \haddockdecltt{:: \{} \enspace \haddockdecltt{w :: Int} & a \haddockid{w} \\
+ & \qquad \haddockdecltt{:: {\char '173}} \enspace \haddockdecltt{w :: Int} & a \haddockid{w} \\
& \qquad \haddockdecltt{\ \ \ \ ,} \enspace \haddockdecltt{z :: Int} & a \haddockid{z} \\
- & \qquad \haddockdecltt{\ \ \ \ \} ->} \enspace \haddockdecltt{Boo} & a \haddockid{Boo} \\
-\end{tabulary}\par
+ & \qquad \haddockdecltt{\ \ \ \ {\char '175} ->} \enspace \haddockdecltt{Boo} & a \haddockid{Boo} \\
+\end{tabulary}\par}
\end{haddockdesc} \ No newline at end of file
diff --git a/latex-test/ref/GadtConstructorArgs/haddock.sty b/latex-test/ref/GadtConstructorArgs/haddock.sty
deleted file mode 100644
index 6e031a98..00000000
--- a/latex-test/ref/GadtConstructorArgs/haddock.sty
+++ /dev/null
@@ -1,57 +0,0 @@
-% Default Haddock style definitions. To use your own style, invoke
-% Haddock with the option --latex-style=mystyle.
-
-\usepackage{tabulary} % see below
-
-% make hyperlinks in the PDF, and add an expandabale index
-\usepackage[pdftex,bookmarks=true]{hyperref}
-
-\newenvironment{haddocktitle}
- {\begin{center}\bgroup\large\bfseries}
- {\egroup\end{center}}
-\newenvironment{haddockprologue}{\vspace{1in}}{}
-
-\newcommand{\haddockmoduleheading}[1]{\chapter{\texttt{#1}}}
-
-\newcommand{\haddockbeginheader}{\hrulefill}
-\newcommand{\haddockendheader}{\noindent\hrulefill}
-
-% a little gap before the ``Methods'' header
-\newcommand{\haddockpremethods}{\vspace{2ex}}
-
-% inserted before \\begin{verbatim}
-\newcommand{\haddockverb}{\small}
-
-% an identifier: add an index entry
-\newcommand{\haddockid}[1]{\haddocktt{#1}\index{#1@\texttt{#1}}}
-
-% The tabulary environment lets us have a column that takes up ``the
-% rest of the space''. Unfortunately it doesn't allow
-% the \end{tabulary} to be in the expansion of a macro, it must appear
-% literally in the document text, so Haddock inserts
-% the \end{tabulary} itself.
-\newcommand{\haddockbeginconstrs}{\begin{tabulary}{\linewidth}{@{}llJ@{}}}
-\newcommand{\haddockbeginargs}{\begin{tabulary}{\linewidth}{@{}llJ@{}}}
-
-\newcommand{\haddocktt}[1]{{\small \texttt{#1}}}
-\newcommand{\haddockdecltt}[1]{{\small\bfseries \texttt{#1}}}
-
-\makeatletter
-\newenvironment{haddockdesc}
- {\list{}{\labelwidth\z@ \itemindent-\leftmargin
- \let\makelabel\haddocklabel}}
- {\endlist}
-\newcommand*\haddocklabel[1]{\hspace\labelsep\haddockdecltt{#1}}
-\makeatother
-
-% after a declaration, start a new line for the documentation.
-% Otherwise, the documentation starts right after the declaration,
-% because we're using the list environment and the declaration is the
-% ``label''. I tried making this newline part of the label, but
-% couldn't get that to work reliably (the space seemed to stretch
-% sometimes).
-\newcommand{\haddockbegindoc}{\hfill\\[1ex]}
-
-% spacing between paragraphs and no \parindent looks better
-\parskip=10pt plus2pt minus2pt
-\setlength{\parindent}{0cm}
diff --git a/latex-test/ref/GadtConstructorArgs/main.tex b/latex-test/ref/GadtConstructorArgs/main.tex
deleted file mode 100644
index dc1a1aa3..00000000
--- a/latex-test/ref/GadtConstructorArgs/main.tex
+++ /dev/null
@@ -1,11 +0,0 @@
-\documentclass{book}
-\usepackage{haddock}
-\begin{document}
-\begin{titlepage}
-\begin{haddocktitle}
-
-\end{haddocktitle}
-\end{titlepage}
-\tableofcontents
-\input{GadtConstructorArgs}
-\end{document} \ No newline at end of file
diff --git a/latex-test/ref/LinearTypes/LinearTypes.tex b/latex-test/ref/LinearTypes/LinearTypes.tex
index d02b6aa7..cb583ca8 100644
--- a/latex-test/ref/LinearTypes/LinearTypes.tex
+++ b/latex-test/ref/LinearTypes/LinearTypes.tex
@@ -3,28 +3,28 @@
\haddockbeginheader
{\haddockverb\begin{verbatim}
module LinearTypes (
- unrestricted, linear, poly
+ unrestricted, linear, poly
) where\end{verbatim}}
\haddockendheader
\begin{haddockdesc}
\item[\begin{tabular}{@{}l}
-unrestricted\ ::\ a\ ->\ b
-\end{tabular}]\haddockbegindoc
-Does something unrestricted.\par
-
+unrestricted :: a -> b
+\end{tabular}]
+{\haddockbegindoc
+Does something unrestricted.\par}
\end{haddockdesc}
\begin{haddockdesc}
\item[\begin{tabular}{@{}l}
-linear\ ::\ a\ {\char '45}1\ ->\ b
-\end{tabular}]\haddockbegindoc
-Does something linear.\par
-
+linear :: a {\char '45}1 -> b
+\end{tabular}]
+{\haddockbegindoc
+Does something linear.\par}
\end{haddockdesc}
\begin{haddockdesc}
\item[\begin{tabular}{@{}l}
-poly\ ::\ a\ {\char '45}m\ ->\ b
-\end{tabular}]\haddockbegindoc
-Does something polymorphic.\par
-
+poly :: a {\char '45}m -> b
+\end{tabular}]
+{\haddockbegindoc
+Does something polymorphic.\par}
\end{haddockdesc} \ No newline at end of file
diff --git a/latex-test/ref/NamespacedIdentifier/NamespacedIdentifiers.tex b/latex-test/ref/NamespacedIdentifier/NamespacedIdentifiers.tex
new file mode 100644
index 00000000..44c052c6
--- /dev/null
+++ b/latex-test/ref/NamespacedIdentifier/NamespacedIdentifiers.tex
@@ -0,0 +1,37 @@
+\haddockmoduleheading{NamespacedIdentifiers}
+\label{module:NamespacedIdentifiers}
+\haddockbeginheader
+{\haddockverb\begin{verbatim}
+module NamespacedIdentifiers (
+ Foo(Bar), Bar
+ ) where\end{verbatim}}
+\haddockendheader
+
+\begin{haddockdesc}
+\item[\begin{tabular}{@{}l}
+data Foo
+\end{tabular}]
+{\haddockbegindoc
+A link to:\par
+\vbox{\begin{itemize}
+\item
+the type \haddockid{Bar}\par
+\item
+the constructor \haddockid{Bar}\par
+\item
+the unimported but qualified type \haddockid{A}\par
+\item
+the unimported but qualified value \haddockid{A}\par
+\end{itemize}}
+\enspace \emph{Constructors}\par
+\haddockbeginconstrs
+\haddockdecltt{=} & \haddockdecltt{Bar} & \\
+\end{tabulary}\par}
+\end{haddockdesc}
+\begin{haddockdesc}
+\item[\begin{tabular}{@{}l}
+data Bar
+\end{tabular}]
+{\haddockbegindoc
+A link to the value \haddocktt{Foo} (which shouldn't exist).\par}
+\end{haddockdesc} \ No newline at end of file
diff --git a/latex-test/ref/Simple/Simple.tex b/latex-test/ref/Simple/Simple.tex
index 5ba4712c..96e9338a 100644
--- a/latex-test/ref/Simple/Simple.tex
+++ b/latex-test/ref/Simple/Simple.tex
@@ -9,8 +9,8 @@ module Simple (
\begin{haddockdesc}
\item[\begin{tabular}{@{}l}
-foo\ ::\ t
-\end{tabular}]\haddockbegindoc
-This is foo.\par
-
+foo :: t
+\end{tabular}]
+{\haddockbegindoc
+This is foo.\par}
\end{haddockdesc} \ No newline at end of file
diff --git a/latex-test/ref/Simple/haddock.sty b/latex-test/ref/Simple/haddock.sty
deleted file mode 100644
index 6e031a98..00000000
--- a/latex-test/ref/Simple/haddock.sty
+++ /dev/null
@@ -1,57 +0,0 @@
-% Default Haddock style definitions. To use your own style, invoke
-% Haddock with the option --latex-style=mystyle.
-
-\usepackage{tabulary} % see below
-
-% make hyperlinks in the PDF, and add an expandabale index
-\usepackage[pdftex,bookmarks=true]{hyperref}
-
-\newenvironment{haddocktitle}
- {\begin{center}\bgroup\large\bfseries}
- {\egroup\end{center}}
-\newenvironment{haddockprologue}{\vspace{1in}}{}
-
-\newcommand{\haddockmoduleheading}[1]{\chapter{\texttt{#1}}}
-
-\newcommand{\haddockbeginheader}{\hrulefill}
-\newcommand{\haddockendheader}{\noindent\hrulefill}
-
-% a little gap before the ``Methods'' header
-\newcommand{\haddockpremethods}{\vspace{2ex}}
-
-% inserted before \\begin{verbatim}
-\newcommand{\haddockverb}{\small}
-
-% an identifier: add an index entry
-\newcommand{\haddockid}[1]{\haddocktt{#1}\index{#1@\texttt{#1}}}
-
-% The tabulary environment lets us have a column that takes up ``the
-% rest of the space''. Unfortunately it doesn't allow
-% the \end{tabulary} to be in the expansion of a macro, it must appear
-% literally in the document text, so Haddock inserts
-% the \end{tabulary} itself.
-\newcommand{\haddockbeginconstrs}{\begin{tabulary}{\linewidth}{@{}llJ@{}}}
-\newcommand{\haddockbeginargs}{\begin{tabulary}{\linewidth}{@{}llJ@{}}}
-
-\newcommand{\haddocktt}[1]{{\small \texttt{#1}}}
-\newcommand{\haddockdecltt}[1]{{\small\bfseries \texttt{#1}}}
-
-\makeatletter
-\newenvironment{haddockdesc}
- {\list{}{\labelwidth\z@ \itemindent-\leftmargin
- \let\makelabel\haddocklabel}}
- {\endlist}
-\newcommand*\haddocklabel[1]{\hspace\labelsep\haddockdecltt{#1}}
-\makeatother
-
-% after a declaration, start a new line for the documentation.
-% Otherwise, the documentation starts right after the declaration,
-% because we're using the list environment and the declaration is the
-% ``label''. I tried making this newline part of the label, but
-% couldn't get that to work reliably (the space seemed to stretch
-% sometimes).
-\newcommand{\haddockbegindoc}{\hfill\\[1ex]}
-
-% spacing between paragraphs and no \parindent looks better
-\parskip=10pt plus2pt minus2pt
-\setlength{\parindent}{0cm}
diff --git a/latex-test/ref/Simple/main.tex b/latex-test/ref/Simple/main.tex
deleted file mode 100644
index 36536981..00000000
--- a/latex-test/ref/Simple/main.tex
+++ /dev/null
@@ -1,11 +0,0 @@
-\documentclass{book}
-\usepackage{haddock}
-\begin{document}
-\begin{titlepage}
-\begin{haddocktitle}
-
-\end{haddocktitle}
-\end{titlepage}
-\tableofcontents
-\input{Simple}
-\end{document} \ No newline at end of file
diff --git a/latex-test/ref/TypeFamilies3/TypeFamilies3.tex b/latex-test/ref/TypeFamilies3/TypeFamilies3.tex
index 2a8ad297..d8787704 100644
--- a/latex-test/ref/TypeFamilies3/TypeFamilies3.tex
+++ b/latex-test/ref/TypeFamilies3/TypeFamilies3.tex
@@ -3,42 +3,42 @@
\haddockbeginheader
{\haddockverb\begin{verbatim}
module TypeFamilies3 (
- Foo, Bar, Baz(Baz3, Baz2, Baz1)
+ Foo, Bar, Baz(Baz3, Baz2, Baz1)
) where\end{verbatim}}
\haddockendheader
\begin{haddockdesc}
\item[\begin{tabular}{@{}l}
-type\ family\ Foo\ a\ where
-\end{tabular}]\haddockbegindoc
+type family Foo a where
+\end{tabular}]
+{\haddockbegindoc
\haddockbeginargs
\haddockdecltt{Foo () = Int} \\
-\haddockdecltt{Foo \_ = ()} \\
+\haddockdecltt{Foo {\char '137} = ()} \\
\end{tabulary}\par
-A closed type family\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
-
+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
+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
-
+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\ ()
+newtype instance Baz Double\\data instance Baz Int\\data instance Baz ()
\end{tabular}]
\end{haddockdesc} \ No newline at end of file
diff --git a/latex-test/ref/TypeFamilies3/haddock.sty b/latex-test/ref/TypeFamilies3/haddock.sty
deleted file mode 100644
index 6e031a98..00000000
--- a/latex-test/ref/TypeFamilies3/haddock.sty
+++ /dev/null
@@ -1,57 +0,0 @@
-% Default Haddock style definitions. To use your own style, invoke
-% Haddock with the option --latex-style=mystyle.
-
-\usepackage{tabulary} % see below
-
-% make hyperlinks in the PDF, and add an expandabale index
-\usepackage[pdftex,bookmarks=true]{hyperref}
-
-\newenvironment{haddocktitle}
- {\begin{center}\bgroup\large\bfseries}
- {\egroup\end{center}}
-\newenvironment{haddockprologue}{\vspace{1in}}{}
-
-\newcommand{\haddockmoduleheading}[1]{\chapter{\texttt{#1}}}
-
-\newcommand{\haddockbeginheader}{\hrulefill}
-\newcommand{\haddockendheader}{\noindent\hrulefill}
-
-% a little gap before the ``Methods'' header
-\newcommand{\haddockpremethods}{\vspace{2ex}}
-
-% inserted before \\begin{verbatim}
-\newcommand{\haddockverb}{\small}
-
-% an identifier: add an index entry
-\newcommand{\haddockid}[1]{\haddocktt{#1}\index{#1@\texttt{#1}}}
-
-% The tabulary environment lets us have a column that takes up ``the
-% rest of the space''. Unfortunately it doesn't allow
-% the \end{tabulary} to be in the expansion of a macro, it must appear
-% literally in the document text, so Haddock inserts
-% the \end{tabulary} itself.
-\newcommand{\haddockbeginconstrs}{\begin{tabulary}{\linewidth}{@{}llJ@{}}}
-\newcommand{\haddockbeginargs}{\begin{tabulary}{\linewidth}{@{}llJ@{}}}
-
-\newcommand{\haddocktt}[1]{{\small \texttt{#1}}}
-\newcommand{\haddockdecltt}[1]{{\small\bfseries \texttt{#1}}}
-
-\makeatletter
-\newenvironment{haddockdesc}
- {\list{}{\labelwidth\z@ \itemindent-\leftmargin
- \let\makelabel\haddocklabel}}
- {\endlist}
-\newcommand*\haddocklabel[1]{\hspace\labelsep\haddockdecltt{#1}}
-\makeatother
-
-% after a declaration, start a new line for the documentation.
-% Otherwise, the documentation starts right after the declaration,
-% because we're using the list environment and the declaration is the
-% ``label''. I tried making this newline part of the label, but
-% couldn't get that to work reliably (the space seemed to stretch
-% sometimes).
-\newcommand{\haddockbegindoc}{\hfill\\[1ex]}
-
-% spacing between paragraphs and no \parindent looks better
-\parskip=10pt plus2pt minus2pt
-\setlength{\parindent}{0cm}
diff --git a/latex-test/ref/TypeFamilies3/main.tex b/latex-test/ref/TypeFamilies3/main.tex
deleted file mode 100644
index 2c98043c..00000000
--- a/latex-test/ref/TypeFamilies3/main.tex
+++ /dev/null
@@ -1,11 +0,0 @@
-\documentclass{book}
-\usepackage{haddock}
-\begin{document}
-\begin{titlepage}
-\begin{haddocktitle}
-
-\end{haddocktitle}
-\end{titlepage}
-\tableofcontents
-\input{TypeFamilies3}
-\end{document} \ No newline at end of file
diff --git a/latex-test/ref/UnboxedStuff/UnboxedStuff.tex b/latex-test/ref/UnboxedStuff/UnboxedStuff.tex
index 36d5c12b..990d2a5b 100644
--- a/latex-test/ref/UnboxedStuff/UnboxedStuff.tex
+++ b/latex-test/ref/UnboxedStuff/UnboxedStuff.tex
@@ -3,34 +3,34 @@
\haddockbeginheader
{\haddockverb\begin{verbatim}
module UnboxedStuff (
- X, Y, Z, unboxedUnit, unboxedTuple, unboxedSum
+ X, Y, Z, unboxedUnit, unboxedTuple, unboxedSum
) where\end{verbatim}}
\haddockendheader
\begin{haddockdesc}
\item[\begin{tabular}{@{}l}
-data\ X
+data X
\end{tabular}]
\end{haddockdesc}
\begin{haddockdesc}
\item[\begin{tabular}{@{}l}
-data\ Y
+data Y
\end{tabular}]
\end{haddockdesc}
\begin{haddockdesc}
\item[\begin{tabular}{@{}l}
-data\ Z
+data Z
\end{tabular}]
\end{haddockdesc}
\section{Unboxed type constructors}
\begin{haddockdesc}
-\item[
-unboxedUnit\ ::\ ({\char '43}\ {\char '43})\ ->\ ({\char '43}\ {\char '43})
-]
-\item[
-unboxedTuple\ ::\ ({\char '43}\ X,\ Y\ {\char '43})\ ->\ ({\char '43}\ X,\ Y,\ Z\ {\char '43})
-]
-\item[
-unboxedSum\ ::\ ({\char '43}\ X\ |\ Y\ {\char '43})\ ->\ ({\char '43}\ X\ |\ Y\ |\ Z\ {\char '43})
-]
+\item[\begin{tabular}{@{}l}
+unboxedUnit :: ({\char '43} {\char '43}) -> ({\char '43} {\char '43})
+\end{tabular}]
+\item[\begin{tabular}{@{}l}
+unboxedTuple :: ({\char '43} X, Y {\char '43}) -> ({\char '43} X, Y, Z {\char '43})
+\end{tabular}]
+\item[\begin{tabular}{@{}l}
+unboxedSum :: ({\char '43} X | Y {\char '43}) -> ({\char '43} X | Y | Z {\char '43})
+\end{tabular}]
\end{haddockdesc} \ No newline at end of file
diff --git a/latex-test/ref/UnboxedStuff/haddock.sty b/latex-test/ref/UnboxedStuff/haddock.sty
deleted file mode 100644
index 6e031a98..00000000
--- a/latex-test/ref/UnboxedStuff/haddock.sty
+++ /dev/null
@@ -1,57 +0,0 @@
-% Default Haddock style definitions. To use your own style, invoke
-% Haddock with the option --latex-style=mystyle.
-
-\usepackage{tabulary} % see below
-
-% make hyperlinks in the PDF, and add an expandabale index
-\usepackage[pdftex,bookmarks=true]{hyperref}
-
-\newenvironment{haddocktitle}
- {\begin{center}\bgroup\large\bfseries}
- {\egroup\end{center}}
-\newenvironment{haddockprologue}{\vspace{1in}}{}
-
-\newcommand{\haddockmoduleheading}[1]{\chapter{\texttt{#1}}}
-
-\newcommand{\haddockbeginheader}{\hrulefill}
-\newcommand{\haddockendheader}{\noindent\hrulefill}
-
-% a little gap before the ``Methods'' header
-\newcommand{\haddockpremethods}{\vspace{2ex}}
-
-% inserted before \\begin{verbatim}
-\newcommand{\haddockverb}{\small}
-
-% an identifier: add an index entry
-\newcommand{\haddockid}[1]{\haddocktt{#1}\index{#1@\texttt{#1}}}
-
-% The tabulary environment lets us have a column that takes up ``the
-% rest of the space''. Unfortunately it doesn't allow
-% the \end{tabulary} to be in the expansion of a macro, it must appear
-% literally in the document text, so Haddock inserts
-% the \end{tabulary} itself.
-\newcommand{\haddockbeginconstrs}{\begin{tabulary}{\linewidth}{@{}llJ@{}}}
-\newcommand{\haddockbeginargs}{\begin{tabulary}{\linewidth}{@{}llJ@{}}}
-
-\newcommand{\haddocktt}[1]{{\small \texttt{#1}}}
-\newcommand{\haddockdecltt}[1]{{\small\bfseries \texttt{#1}}}
-
-\makeatletter
-\newenvironment{haddockdesc}
- {\list{}{\labelwidth\z@ \itemindent-\leftmargin
- \let\makelabel\haddocklabel}}
- {\endlist}
-\newcommand*\haddocklabel[1]{\hspace\labelsep\haddockdecltt{#1}}
-\makeatother
-
-% after a declaration, start a new line for the documentation.
-% Otherwise, the documentation starts right after the declaration,
-% because we're using the list environment and the declaration is the
-% ``label''. I tried making this newline part of the label, but
-% couldn't get that to work reliably (the space seemed to stretch
-% sometimes).
-\newcommand{\haddockbegindoc}{\hfill\\[1ex]}
-
-% spacing between paragraphs and no \parindent looks better
-\parskip=10pt plus2pt minus2pt
-\setlength{\parindent}{0cm}
diff --git a/latex-test/ref/UnboxedStuff/main.tex b/latex-test/ref/UnboxedStuff/main.tex
deleted file mode 100644
index e34c5f14..00000000
--- a/latex-test/ref/UnboxedStuff/main.tex
+++ /dev/null
@@ -1,11 +0,0 @@
-\documentclass{book}
-\usepackage{haddock}
-\begin{document}
-\begin{titlepage}
-\begin{haddocktitle}
-
-\end{haddocktitle}
-\end{titlepage}
-\tableofcontents
-\input{UnboxedStuff}
-\end{document} \ No newline at end of file
diff --git a/latex-test/src/DefaultSignatures/DefaultSignatures.hs b/latex-test/src/DefaultSignatures/DefaultSignatures.hs
new file mode 100644
index 00000000..52d68a96
--- /dev/null
+++ b/latex-test/src/DefaultSignatures/DefaultSignatures.hs
@@ -0,0 +1,19 @@
+{-# LANGUAGE DefaultSignatures #-}
+
+module DefaultSignatures where
+
+-- | Documentation for Foo.
+class Foo a where
+ -- | Documentation for bar and baz.
+ bar, baz :: a -> String
+
+ -- | Documentation for the default signature of bar.
+ default bar :: Show a => a -> String
+ bar = show
+
+ -- | Documentation for baz'.
+ baz' :: String -> a
+
+ -- | Documentation for the default signature of baz'.
+ default baz' :: Read a => String -> a
+ baz' = read
diff --git a/latex-test/src/Deprecated/Deprecated.hs b/latex-test/src/Deprecated/Deprecated.hs
new file mode 100644
index 00000000..aecec94e
--- /dev/null
+++ b/latex-test/src/Deprecated/Deprecated.hs
@@ -0,0 +1,7 @@
+module Deprecated where
+
+-- | Docs for something deprecated
+deprecated :: Int
+deprecated = 1
+
+{-# DEPRECATED deprecated "Don't use this" #-}
diff --git a/latex-test/src/Example/Example.hs b/latex-test/src/Example/Example.hs
new file mode 100644
index 00000000..42ff1646
--- /dev/null
+++ b/latex-test/src/Example/Example.hs
@@ -0,0 +1,11 @@
+module Example where
+
+-- | Example use.
+--
+-- >>> split 1
+-- ()
+--
+-- >>> split 2
+-- ()
+split :: Int -> ()
+split _ = ()
diff --git a/latex-test/src/NamespacedIdentifier/NamespacedIdentifier.hs b/latex-test/src/NamespacedIdentifier/NamespacedIdentifier.hs
new file mode 100644
index 00000000..6f59d247
--- /dev/null
+++ b/latex-test/src/NamespacedIdentifier/NamespacedIdentifier.hs
@@ -0,0 +1,13 @@
+module NamespacedIdentifiers where
+
+-- | A link to:
+--
+-- * the type t'Bar'
+-- * the constructor v'Bar'
+-- * the unimported but qualified type t'A.A'
+-- * the unimported but qualified value v'A.A'
+--
+data Foo = Bar
+
+-- | A link to the value v'Foo' (which shouldn't exist).
+data Bar