Commit fc6a4cb0 authored by Simon Marlow's avatar Simon Marlow
Browse files

Use tex4ht to format the HTML version

The new HTML output is much better-looking.

Also, switch to use the verbatim environment for code, after much
fighting with LaTeX.  This generates less HTML, and it looks better.
parent cfc5ac60
......@@ -21,11 +21,14 @@ default: haskell.pdf html
RUN_TEX = ../tools/run_tex
RUN_INDEX = ../tools/run_index
VERBATIM = ../tools/verbatim
VERB_TEX4HT = ../tools/verb-tex4ht
# splitAndIndexPgm won't work unless you have "perl"
SPLITPGM = perl ../tools/splitAndIndexPgm
RM = rm -f
CP = cp
LN = ln -sf
LATEX = latex
PDFLATEX = pdflatex
MAKEINDEX = makeindex
......@@ -44,7 +47,7 @@ EXPAND = expand
RELEASE_DIR = ../haskell-prime-draft
JFP_DIR = ../jfp-release
PARTS = preface.tex $(PARTS_NO_PREFACE)
PARTS = haskell.tex preface.tex $(PARTS_NO_PREFACE)
PARTS_NO_PREFACE = iso-chars.tex \
intro.tex lexemes.tex exps.tex \
decls.tex modules.tex basic.tex io-13.tex \
......@@ -56,9 +59,8 @@ PARTS_NO_PREFACE = iso-chars.tex \
array.tex io.tex char.tex monad.tex list.tex \
system.tex directory.tex \
maybe.tex time.tex cputime.tex random.tex \
locale.tex
SYNTAX = syntax-lexical.tex syntax-iso.tex
locale.tex syntax-lexical.tex syntax-iso.tex \
Prelude.tex PreludeList.tex PreludeText.tex PreludeIO.tex
CODE = lib-code/Ratio.tex lib-code/Complex.tex lib-code/Ix.tex \
lib-code/Numeric.tex \
......@@ -75,16 +77,7 @@ HEADERS = lib-hdrs/Ratio.tex lib-hdrs/Complex.tex lib-hdrs/Ix.tex \
lib-hdrs/Time.tex lib-hdrs/Time1.tex lib-hdrs/CPUTime.tex \
lib-hdrs/Locale.tex
PRELUDE = Prelude.tex PreludeList.tex PreludeText.tex PreludeIO.tex
LIBPARTS = lib-array.tex lib-intro.tex lib-io.tex lib-num.tex lib-os.tex lib-text.tex \
lib-index-intro.tex lib-posix.tex
LIBS = LibMonadicIO.tex LibStdIO.tex LibIOError.tex LibReadTextIO.tex LibWriteTextIO.tex \
LibSystem.tex LibDirectory.tex LibCPUTime.tex LibTime.tex LibUserInterrupt.tex \
LibRatio.tex LibArray.tex LibComplex.tex LibText.tex \
LibIO.tex LibIx.tex LibPosix.tex
HT_TEXS = $(patsubst %, ht/%, $(PARTS))
#########################################
# Main targets
......@@ -98,15 +91,15 @@ haskell.tex: haskell.verb
$(EXPAND) < $< | $(VERBATIM) >$@
# I have no idea why run_tex is run twice. SLPJ
html: index.html ${PARTS} ${SYNTAX} ${PRELUDE}
-mkdir haskell-report-html
$(RUN_TEX)
$(RUN_TEX)
$(RUN_INDEX)
cp index.html *.png *.gif haskell-report-html
# html: index.html ${PARTS}
# -mkdir haskell-report-html
# $(RUN_TEX)
# $(RUN_TEX)
# $(RUN_INDEX)
# cp index.html *.png *.gif haskell-report-html
haskell.dvi: haskell.tex haskell.ind ${PARTS} $(SYNTAX) ${PRELUDE} ${CODE} ${HEADERS}
haskell.pdf: haskell.tex haskell.ind ${PARTS} $(SYNTAX) ${PRELUDE} ${CODE} ${HEADERS}
haskell.dvi: haskell.tex haskell.ind ${PARTS} ${CODE} ${HEADERS}
haskell.pdf: haskell.tex haskell.ind ${PARTS} ${CODE} ${HEADERS}
# remove this rule if you don't have "makeindex"
......@@ -133,6 +126,23 @@ release: haskell.ps html
publish-pdf: report.pdf
gzip < report.pdf > y:Haskell/haskell-report/report.pdf.gz
#########################################
# HTML
#########################################
ht/classes.eps : classes.eps
$(CP) $< $@
ht/lib-hdrs :
$(RM) $@
$(LN) ../lib-hdrs ht/lib-hdrs
ht/lib-code :
$(RM) $@
$(LN) ../lib-code ht/lib-code
html: $(HT_TEXS) ht/classes.eps ht/lib-hdrs ht/lib-code
cd ht && htlatex haskell.tex "haskell,2"
#########################################
# Generic stuff
......@@ -142,7 +152,8 @@ veryclean: clean
$(RM) *~
clean:
$(RM) *.dvi *.log *.aux *.ilg *.blg *.toc ${PARTS} $(SYNTAX) $(PRELUDE) \
$(RM) ht/*.tex ht/*.html
$(RM) *.dvi *.log *.aux *.ilg *.blg *.toc ${PARTS} \
haskell.tex haskell.ps haskell.pdf *.o lex.yy.c haskell-report-html/*
......@@ -169,31 +180,13 @@ clean:
%.pdf: %.tex
$(PDFLATEX) $<
# -----------------------------------------------------------
# Out of date stuff
# -----------------------------------------------------------
# Report as formatted for SIGPLAN -- 2 sided, 2-up, odd pages on left.
# This is a bit horrible. But almost nobody should need to do this. KH
sigplan_haskell.dvi: sigplan_haskell.verb sigplan_article.sty \
haskell.tex haskell.ind \
${PARTS} $(SYNTAX) ${PRELUDE}
cp sigplan_article.sty article.sty
cp sigplan_haskell.verb haskell.verb
-make haskell.dvi
cp plain_haskell.verb haskell.verb
sigplan_haskell-libraries.dvi: sigplan_haskell-libraries.tex haskell-libraries.ind ${LIBPARTS} ${LIBS}
haskell-libraries.dvi: haskell-libraries.tex haskell-libraries.ind ${LIBPARTS} ${LIBS}
# ----------------------- END OF OLD SIGPLAN STUFF -----------------------------------
ht/%.tex: %.verb
$(EXPAND) < $< | $(VERB_TEX4HT) | sh ../tools/subsection >$@
jfp: h98-book.tex preface-jfp.tex ${PARTS_NO_PREFACE} $(SYNTAX) ${PRELUDE}
jfp: h98-book.tex preface-jfp.tex ${PARTS_NO_PREFACE}
-mkdir $(JFP_DIR)
for n in h98-book.tex preface-jfp.tex \
${PARTS_NO_PREFACE} $(SYNTAX) ${PRELUDE} ; do \
${PARTS_NO_PREFACE}; do \
../tools/subsection < $$n > $(JFP_DIR)/$$n ; done
cp classes.eps $(JFP_DIR)
cp haskell.bbl $(JFP_DIR)/h98-book.bbl
......
......@@ -53,7 +53,7 @@ Figure~\ref{array-examples} shows some examples that use the
@array@ constructor.
\begin{figure}[tb]
\outline{\small
\begin{outlineenv}\small
@
-- Scaling an array of numbers by a given number:
scale :: (Num a, Ix b) => a -> Array b a -> Array b a
......@@ -72,7 +72,7 @@ inner v w = if b == bounds w
else error "inconformable arrays for inner product"
where b = bounds v
@
}
\end{outlineenv}
\ecaption{Array examples}
\label{array-examples}
\end{figure}
......@@ -152,7 +152,7 @@ The @fmap@ function transforms the array values while
Figure~\ref{derived-array-examples} shows some examples.
\begin{figure}[tb]
\outline{\small
\begin{outlineenv}\small
@
-- A rectangular subarray
subArray :: (Ix a) => (a,a) -> Array a b -> Array a b
......@@ -172,7 +172,7 @@ diag x = ixmap (l,u) (\i->(i,i)) x
firstArray :: (Ix a) => Array a (b,c) -> Array a b
firstArray = fmap (\(x,y)->x)
@
}
\end{outlineenv}
\ecaption{Derived array examples}
\label{derived-array-examples}
\end{figure}
......
......@@ -666,11 +666,7 @@ types and the operations upon them have been heavily influenced by
Common Lisp and Scheme.
Numeric function names and operators are usually overloaded, using
several type classes with an inclusion relation shown in
Figure~\ref{standard-classes}%
%*ignore
, page~\pageref{standard-classes}%
%*endignore
.
Figure~\ref{standard-classes}.
The class @Num@\indexclass{Num} of numeric
types is a subclass of @Eq@\indexclass{Eq}, since all numbers may be
compared for equality; its subclass @Real@\indexclass{Real} is also a
......@@ -744,7 +740,7 @@ Figure~\ref{standard-classes} shows the class dependencies and
built-in types that are instances of the numeric classes.
\begin{figure}[tb]
\outlinec{
\begin{outlineenv}
@
class (Eq a, Show a) => Num a where
(+), (-), (*) :: a -> a -> a
......@@ -774,7 +770,7 @@ class (Fractional a) => Floating a where
sinh, cosh, tanh :: a -> a
asinh, acosh, atanh :: a -> a
@
}
\end{outlineenv}
%**<div align=center> <h4>Figure 6</h4> </div>
\ecaption{Standard Numeric Classes and Related Operations, Part 1}
\label{basic-numeric-1}
......@@ -802,7 +798,7 @@ class (Fractional a) => Floating a where
\end{figure}
\begin{figure}[tb]
\outlinec{
\begin{outlineenv}
@
class (Real a, Fractional a) => RealFrac a where
properFraction :: (Integral b) => a -> (b,a)
......@@ -829,7 +825,7 @@ gcd, lcm :: (Integral a) => a -> a-> a
fromIntegral :: (Integral a, Num b) => a -> b
realToFrac :: (Real a, Fractional b) => a -> b
@
}
\end{outlineenv}
%**<div align=center> <h4>Figure 7</h4> </div>
\ecaption{Standard Numeric Classes and Related Operations, Part 2}
\label{basic-numeric-2}
......
......@@ -1122,7 +1122,7 @@ which derived instances are allowed are
@Bounded@\indexdi{Bounded},
@Show@\indexdi{Show},
and @Read@\indexdi{Read},
all mentioned in Figure~\ref{standard-classes}, page~\pageref{standard-classes}.
all mentioned in Figure~\ref{standard-classes}.
The
precise details of how the derived instances are generated for each of
these classes are provided in Chapter~\ref{derived-appendix}, including
......@@ -1241,10 +1241,9 @@ is defaultable if:
\item at least one of these classes is a numeric class,
(that is, @Num@ or a subclass of @Num@), and
\item all of these classes are defined in the Prelude or a standard library
(Figures~\ref{basic-numeric-1}--\ref{basic-numeric-2},
pages~\pageref{basic-numeric-1}--\pageref{basic-numeric-2}
(Figures~\ref{basic-numeric-1}--\ref{basic-numeric-2}
show the numeric classes, and
Figure~\ref{standard-classes}, page~\pageref{standard-classes},
Figure~\ref{standard-classes}
shows the classes defined in the Prelude.)
\end{itemize}
Each defaultable variable is replaced by the first type in the
......@@ -1589,7 +1588,7 @@ definitions are all equivalent:
x @\bkqB@plus@\bkqA@ y = \ z -> x+y+z
(x @\bkqB@plus@\bkqA@ y) z = x+y+z
@
\eprogNoSkip
\eprog
\begin{haskellprime}
......@@ -1604,7 +1603,7 @@ illegal:
@
a ## b : xs = exp
@
\eprogNoSkip
\eprog
because @:@ has precedence 5, so the left hand side resolves to
@(a ## x) : xs@, and this cannot be a pattern binding because @(a ## x)@
is not a valid pattern.
......
......@@ -475,11 +475,11 @@ Note the implicit use of default class method
definitions---for
example, only @<=@ is defined for @Ord@, with the other
class methods (@<@, @>@, @>=@, @max@, and @min@) being defined by the defaults given in
the class declaration shown in Figure~\ref{standard-classes}
(page~\pageref{standard-classes}).
the class declaration shown in Figure~\ref{standard-classes}.
\begin{figure}[tb]
\outlinec{\small
\begin{outlineenv}
\small
@
infixr 5 :^:
data Tree a = Leaf a | Tree a :^: Tree a
......@@ -525,7 +525,7 @@ up_prec = 5 -- Precedence of :^:
app_prec = 10 -- Application has precedence one more than
-- the most tightly-binding operator
@
}
\end{outlineenv}
%**<div align=center> <h4>Figure 8</h4> </div>
\ecaption{Example of Derived Instances}
\label{tree-inst}
......
......@@ -354,11 +354,7 @@ the local meaning of the @-@ operator and unary negation.
Prefix negation has the same precedence as the infix operator @-@
defined in the Prelude (see
Table~\ref{prelude-fixities}%
%*ignore
, page~\pageref{prelude-fixities}%
%*endignore
). Because @e1-e2@ parses as an
Table~\ref{prelude-fixities}). Because @e1-e2@ parses as an
infix application of the binary operator @-@, one must write @e1(-e2)@ for
the alternative parsing. Similarly, @(-)@ is syntax for
@(\ x y -> x-y)@, as with any infix operator, and does not denote
......@@ -614,11 +610,7 @@ Arithmetic sequences satisfy these identities:
\end{center}
where @enumFrom@, @enumFromThen@, @enumFromTo@, and @enumFromThenTo@
are class methods in the class @Enum@ as defined in the Prelude
(see Figure~\ref{standard-classes}%
%*ignore
, page~\pageref{standard-classes}%
%*endignore
).
(see Figure~\ref{standard-classes}).
}
The semantics of arithmetic sequences therefore depends entirely
......@@ -1203,10 +1195,11 @@ partially-applied constructor.
All patterns must be {\em linear}\index{linearity}
\index{linear pattern}---no variable may appear more than once. For
example, this definition is illegal:
\bprog
@
f (x,x) = x -- ILLEGAL; x used twice in pattern
f (x,x) = x -- ILLEGAL; x used twice in pattern
@
\eprog
Patterns of the form "var"{\tt @@}"pat" are called {\em as-patterns},
\index{as-pattern ({\tt {\char'100}})}
and allow one to use "var"
......
......@@ -4,6 +4,7 @@
\usepackage{times}
\usepackage{makeidx}
\usepackage{graphicx}
\usepackage{url}
\usepackage[dvipsnames,usenames]{color}
\evensidemargin=0in
......@@ -104,31 +105,63 @@
% outlined figures
\newcommand{\ecaption}[1]{\vspace{-1 ex}\caption{#1}\vspace{1 ex}}
\newsavebox{\fmbox}
\newenvironment{outlineenv}
{\begin{lrbox}{\fmbox}%
\begin{minipage}{415pt}%
\vspace{1 ex}}
{\end{minipage}%
\vspace{1 ex}%
\end{lrbox}%
\begin{center}%
\fbox{\usebox{\fmbox}}%
\end{center}}
\newcommand{\outline}[1]{%
\begin{center}
\fbox{ \begin{minipage}{415pt}
\vspace{1 ex}
#1
\end{minipage} }
\begin{lrbox}{\fmbox}%
\begin{minipage}{415pt}%
\vspace{1 ex}
#1
\end{minipage}%
\vspace{1 ex}%
\end{lrbox}%
\begin{center}%
\fbox{\usebox{\fmbox}}%
\end{center}
}
\newcommand{\outlinec}{\outline} % Centered outlines in html
\newcommand{\bprog}{%
\par\noindent\begin{tabular}{@@{\hspace*{17pt}}l@@{}}}
\newcommand{\eprog}{%
\end{tabular}\\[\parskip]}
\newcommand{\eprogNoSkip}{%
\end{tabular}}
\newcommand{\outlinec}{\outline}
% This magic adds some indentation to the left of code blocks in the
% printed output. It also causes a million overfull \hbox warnings,
% which I don't know how to get rid of. The p{\textwidth} field in
% the tabular is required instead of just "l" because we want to use
% the verbatim environment in there.
%
% when generating HTML, we don't want the extra indentation, because
% it also adds some vertical space which seems hard to get rid of.
%
% variants for stdprelude; don't indent, and skip a little more
% --SDM 29/04/2010
%
\ifx \HCode\Undef
% not tex4ht...
\newcommand{\bprog}{
\par\vspace{-3ex}\noindent\begin{tabular}{@@{\hspace*{17pt}}p{\textwidth}@@{}}}
\newcommand{\eprog}{%
\end{tabular}\par\vspace{-2ex}}
\newcommand{\bprogB}{%
\begin{tabular}{@@{}l@@{}}}
\newcommand{\eprogB}{%
\end{tabular}\\[0.6\baselineskip]}
\begin{tabular}{@@{}p{\textwidth}@@{}}}
\newcommand{\eprogB}{\eprog}
\newcommand{\eprogNoSkip}{\eprog}
\else
% tex4ht mode...
\newcommand{\bprog}{}
\newcommand{\eprog}{}
\newcommand{\bprogB}{}
\newcommand{\eprogB}{}
\newcommand{\eprogNoSkip}{}
\fi
%special characters
\newcommand{\bkq}{\mbox{\tt \char'022}} % (syntax) backquote char
......
\Preamble{xhtml}
% Don't indent paragraphs in HTML
\Configure{HtmlPar}{
\HCode{<p class="noindent">}
}{
\HCode{<p class="noindent">}
}{}{}
% No pictures for math
%
\Configure{[]}{$$}{$$}
\Configure{()}{$}{$}
% Formatting details of signatures descriptions
%
\ConfigureList{codedesc}{%
\HCode{<dl>}
}{%
\HCode{</dl>}
}{%
\HCode{<dt class="codedesc">}
}{%
\HCode{<dd class="codedesc">}
}
%\ConfigureEnv{grammar}{\HCode{<div class="quote">}}{\HCode{</div>}}{}{}
\begin{document}
% Style sheet additions
%
\Css{
% We like a smaller sans font.
body {
font-family: Bitstream Vera Sans, Arial, Helvetica, sans-serif;
font-size : 14px;
}
%
% Environment for library signature descriptions.
% - Signatures in dark red
dt.codedesc {
color: darkred;
}
% - Avoid too much space between items.
dd.codedesc {
padding-bottom: .2em;
}
% - Verbatim displays in item descriptions should not have too wide margins.
dd.codedesc table {
margin-bottom: -.8em;
}
% - Paragraph start margin should be smaller in items.
% - Shrink paragraph end margins to avoid gap to next item.
dd.codedesc p {
margin-top: .5em;
margin-bottom: 0;
}
% Otherwise, the font size get's reduced twice.
sub {
font-size: 100\%;
}
% Here we need to reduce, as tex4ht doesn't grok the subscript.
sub.gnterm {
font-size: 70\%;
}
% We don't want tabular's centered;
table.tabular {
margin-left: 1em;
}
}
\EndPreamble
......@@ -68,7 +68,7 @@ Figure~\ref{prelude-index}.
\end{itemize}
\begin{figure}[tb]
\outline{\small
\begin{outlineenv}\small
@
instance (Ix a, Ix b) => Ix (a,b) where
range ((l,l'),(u,u'))
......@@ -97,7 +97,7 @@ instance (Ix a, Ix b) => Ix (a,b) where
-- inRange (l1,u1) i1 && inRange (l2,u2) i2 &&
-- ... && inRange (lk,uk) ik
@
}
\end{outlineenv}
\ecaption{Derivation of Ix instances}
\label{prelude-index}
\indexclass{Ix}
......
......@@ -446,7 +446,7 @@ tuple was detected, and (c)~the close brace at the very end, inserted
because of the column 0 indentation of the end-of-file token.
\begin{figure}
\outlinec{\small
\begin{outlineenv}\small
@
module AStack( Stack, push, pop, top, size ) where
data Stack a = Empty
......@@ -467,11 +467,11 @@ pop (MkStack x s)
top :: Stack a -> a
top (MkStack x s) = x -- (top Empty) is an error
@
}
\end{outlineenv}
%**<div align=center> <h4>Figure 1</h4> </div>
\ecaption{A sample program}
\label{layout-before}
\outlinec{\small
\begin{outlineenv}\small
@
module AStack( Stack, push, pop, top, size ) where
{data Stack a = Empty
......@@ -493,7 +493,7 @@ module AStack( Stack, push, pop, top, size ) where
;top (MkStack x s) = x -- (top Empty) is an error
}
@
}
\end{outlineenv}
%**<div align=center> <h4>Figure 2</h4> </div>
\ecaption{Sample program with layout expanded}
\label{layout-after}
......
%**<title>Preface</title>
%*section
%**~sheader
\markboth{PREFACE}{PREFACE}
\begin{center}
{\Large \bf Preface}
\end{center}
\chapter*{Preface}
\vspace{.2in}
......@@ -166,13 +161,7 @@ Removed language features:
\section*{\Haskell{} Resources}
\label{sect:resources}
The \Haskell{} web site
\bprog
@
http://haskell.org
@
\eprog
gives access to many useful resources, including:
The \Haskell{} web site \url{http://haskell.org} gives access to many useful resources, including:
\begin{itemize}
\item Online versions of the language and library definitions.
\item Tutorial material on \Haskell{}.
......
......@@ -393,129 +393,85 @@ these two styles in the same file.
\subsection{Context-Free Syntax}
\label{bnf}
@@@
module -> @module@ modid [exports] @where@ body
| body
body -> @{@ impdecls @;@ topdecls @}@
module -> @module@ modid [exports] @where@ body \indexsyn{module}
| body\indexsyn{modid}
body -> @{@ impdecls @;@ topdecls @}@\indexsyn{body}
| @{@ impdecls @}@
| @{@ topdecls @}@
impdecls -> impdecl_1 @;@ ... @;@ impdecl_n & (n>=1)
@@@
\indexsyn{module}%
\indexsyn{body}%
\indexsyn{modid}%
\indexsyn{impdecls}%
impdecls -> impdecl_1 @;@ ... @;@ impdecl_n & (n>=1)\indexsyn{impdecls}
@@@
exports -> @(@ export_1 @,@ ... @,@ export_n [ @,@ ] @)@ & (n>=0)
\indexsyn{exports}exports -> @(@ export_1 @,@ ... @,@ export_n [ @,@ ] @)@ & (n>=0)
export -> qvar
\indexsyn{export}export -> qvar
| qtycon [@(..)@ | @(@ cname_1 @,@ ... @,@ cname_n @)@] & (n>=0)
| qtycls [@(..)@ | @(@ qvar_1 @,@ ... @,@ qvar_n @)@] & (n>=0)
| @module@ modid
@@@
\indexsyn{exports}%
\indexsyn{export}%
@@@
impdecl -> @import@ [@qualified@] modid [@as@ modid] [impspec]
\indexsyn{impdecl}impdecl -> @import@ [@qualified@] modid [@as@ modid] [impspec]
| & (\tr{empty declaration})
impspec -> @(@ import_1 @,@ ... @,@ import_n [ @,@ ] @)@ & (n>=0)
\indexsyn{impspec}impspec -> @(@ import_1 @,@ ... @,@ import_n [ @,@ ] @)@ & (n>=0)
| @hiding@ @(@ import_1 @,@ ... @,@ import_n [ @,@ ] @)@ & (n>=0)
import -> var
\indexsyn{import}import -> var
| tycon [ @(..)@ | @(@ cname_1 @,@ ... @,@ cname_n @)@] & (n>=0)
| tycls [@(..)@ | @(@ var_1 @,@ ... @,@ var_n @)@] & (n>=0)
cname -> var | con
@@@
\indexsyn{impdecl}%
\indexsyn{impspec}%
\indexsyn{import}%
\indexsyn{cname}%
\indexsyn{cname}cname -> var | con
@@@
topdecls -> topdecl_1 @;@ ... @;@ topdecl_n & (n>=0)
topdecl -> @type@ simpletype @=@ type
\indexsyn{topdecls}topdecls -> topdecl_1 @;@ ... @;@ topdecl_n & (n>=0)
\indexsyn{topdecl}topdecl -> @type@ simpletype @=@ type
| @data@ [context @=>@] simpletype \hprime{[}@=@ constrs\hprime{]} [deriving]
| @newtype@ [context @=>@] simpletype @=@ newconstr [deriving]
| @class@ [scontext @=>@] tycls tyvar [@where@ cdecls]
| @instance@ [scontext @=>@] qtycls inst [@where@ idecls]
| @default@ @(@type_1 @,@ ... @,@ type_n@)@ & (n>=0)
| decl
@@@
\indexsyn{topdecls}%
\indexsyn{topdecl}%
@@@
decls -> @{@ decl_1 @;@ ... @;@ decl_n @}@ & (n>=0)
decl -> gendecl
\indexsyn{decls}decls -> @{@ decl_1 @;@ ... @;@ decl_n @}@ & (n>=0)
\indexsyn{decl}decl -> gendecl
| (funlhs | \hprime{pat}) rhs
cdecls -> @{@ cdecl_1 @;@ ... @;@ cdecl_n @}@ & (n>=0)
cdecl -> gendecl
\indexsyn{cdecls}cdecls -> @{@ cdecl_1 @;@ ... @;@ cdecl_n @}@ & (n>=0)
\indexsyn{cdecl}cdecl -> gendecl
| (funlhs | var) rhs
idecls -> @{@ idecl_1 @;@ ... @;@ idecl_n @}@ & (n>=0)
idecl -> (funlhs | var) rhs
\indexsyn{idecls}idecls -> @{@ idecl_1 @;@ ... @;@ idecl_n @}@ & (n>=0)
\indexsyn{idecl}idecl -> (funlhs | var) rhs
| & (\tr{empty})
gendecl -> vars @::@ [context @=>@] type & (\tr{type signature})
\indexsyn{gendecl}gendecl -> vars @::@ [context @=>@] type & (\tr{type signature})