Commit c11ae54f authored by Simon Peyton Jones's avatar Simon Peyton Jones
Browse files

More small changes to

  a) formatting
  b) index entries

Many due to Ross Paterson, Simon Marlow, Malcolm Wallace.

This is pretty much exactly what CUP will publish as the Haskell 98 book.
(I say "pretty much" because CUP got a set of sources a month or two ago,
and have been modifying them independently, so some formatting changes
might differ slightly.)
parent 6e97c3ea
......@@ -116,10 +116,12 @@ haskell.ind: haskell.idx
haskell.ps : haskell.dvi
dvips haskell.dvi -o haskell.ps
# Can't use pdflatex because of eps inclusion
release: haskell.ps html
ps2pdf haskell.ps
gzip < haskell.ps > $(RELEASE_DIR)/haskell.ps.gz
cp haskell.pdf $(RELEASE_DIR)/haskell.pdf.gz
cp haskell.pdf $(RELEASE_DIR)/haskell.pdf
cp -r haskell98-report-html $(RELEASE_DIR)
tar cvf - haskell98-report-html | gzip > $(RELEASE_DIR)/haskell98-report-html.tar.gz
cp h98-revised.html $(RELEASE_DIR)/index.html
......
%
% $Header: /home/cvs/root/haskell-report/report/basic.verb,v 1.16 2002/12/10 11:51:05 simonpj Exp $
% $Header: /home/cvs/root/haskell-report/report/basic.verb,v 1.17 2003/01/13 13:08:54 simonpj Exp $
%
%**<title>The Haskell 98 Report: Predefined Types and Classes</title>
%*section 6
......@@ -211,6 +211,7 @@ the Prelude.
\subsection{Strict Evaluation}
\label{strict-eval}
\index{$""!@@{\tt {\char'044}{\char'041}}}
\index{$@@{\tt {\char'044}}}
\indextt{seq}
Function application in Haskell is non-strict; that is, a function
argument is evaluated only when required. Sometimes it is desirable to
......@@ -243,8 +244,8 @@ non-strict application.
@
infixr 0 $, $!
($), ($!) :: (a -> b) -> a -> b
f $ x = f x
f $! x = x `seq` f x
f $ x = f x
f $! x = x `seq` f x
@
\eprog
The non-strict application operator @$@ may appear redundant, since
......@@ -515,7 +516,7 @@ the list of lowercase letters in alphabetical order.
\item Numeric types: @Int@, @Integer@, @Float@, @Double@. The semantics
of these instances is given next.
\end{itemize}
For all four numeric types, @succ@ adds 1; and @pred@ subtracts 1.
For all four numeric types, @succ@ adds 1, and @pred@ subtracts 1.
The conversions @fromEnum@ and @toEnum@ convert between the type and @Int@.
In the case of @Float@ and @Double@, the digits after the decimal point may be lost.
It is implementation-dependent what @fromEnum@ returns when applied to
......@@ -695,7 +696,7 @@ conform to current language independent arithmetic (LIA) standards. These
standards require considerably more complexity in the numeric
structure and have thus been relegated to a library. Some, but not
all, aspects of the IEEE floating point standard have been
accounted for in Prelude class @RealFloat@.b
accounted for in Prelude class @RealFloat@.
The standard numeric types are listed in Table~\ref{standard-numeric-types}.
The finite-precision integer type @Int@\indextycon{Int} covers at
......
%
% $Header: /home/cvs/root/haskell-report/report/decls.verb,v 1.18 2002/12/10 11:51:10 simonpj Exp $
% $Header: /home/cvs/root/haskell-report/report/decls.verb,v 1.19 2003/01/13 13:08:55 simonpj Exp $
%
%**<title>The Haskell 98 Report: Declarations</title>
%*section 4
......@@ -590,7 +590,7 @@ constructor. The arguments to the positional constructor occur in the
same order as the labeled fields. For example, the declaration
\bprog
@
data C = F { f1,f2 :: Int, f3 :: Bool}
data C = F { f1,f2 :: Int, f3 :: Bool }
@
\eprog
defines a type and constructor identical to the one produced by
......@@ -1546,7 +1546,7 @@ otherwise, the binding is called a {\em function
binding}. Either binding may appear at the top-level of a module or
within a @where@ or @let@ construct.
\subsubsubsection{Function bindings.}
\subsubsubsection{Function bindings}
\index{function binding}
A function binding binds a variable to a function value. The general
form of a function binding for variable "x" is:
......@@ -1604,7 +1604,7 @@ equivalent to the equation (i.e.~simple pattern binding):
where the "x_i" are new identifiers.
}
\subsubsubsection{Pattern bindings.}
\subsubsubsection{Pattern bindings}
\label{patbind}
\index{pattern binding}
......
%
% $Header: /home/cvs/root/haskell-report/report/exps.verb,v 1.19 2002/12/10 11:51:10 simonpj Exp $
% $Header: /home/cvs/root/haskell-report/report/exps.verb,v 1.20 2003/01/13 13:08:55 simonpj Exp $
%
%*section 3
%**<title>The Haskell 98 Report: Expressions</title>
......@@ -812,7 +812,7 @@ Section~\ref{pattern-bindings}.
%
@@@
exp -> @case@ exp @of@ @{@ alts @}@
alts -> alt_1 @;@ ... @;@ alt_n & (n>=0)
alts -> alt_1 @;@ ... @;@ alt_n & (n>=1)
alt -> pat @->@ exp [@where@ decls]
| pat gdpat [@where@ decls]
| & (empty alternative)
......@@ -875,7 +875,7 @@ Pattern matching is described in Section~\ref{pattern-matching}, with
the formal semantics of case expressions in
Section~\ref{case-semantics}.
{\em A note about parsing}. The expression
{\em A note about parsing.} The expression
\bprog
@
case x of { (a,_) | let b = not a in b :: Bool -> a }
......
......@@ -13,10 +13,10 @@
<img src="h98.gif" alt="Haskell 98">
</div>
<h1>Haskell 98: The Revised Report (Dec 2002)</h1>
<h1>Haskell 98: The Revised Report (Jan 2003)</h1>
The Haskell 98 Report has undergone an extensive process of revision since its publication
in January 1999. This process converged in December 2002, producing the Revised Report.
in January 1999. This process converged in January 2003, producing the Revised Report.
<p>
The Revised Report is published by Cambridge University Press, as a book
<a href="http://titles.cambridge.org/catalogue.asp?isbn=0521826144">"Haskell 98 language
......
......@@ -60,8 +60,8 @@ S.L.~Peyton~Jones.
\bibitem{unicode}
{Unicode Consortium}.
\newblock {\em Unicode Character Data and Mappings}.
\newblock unicode.org.
\newblock {\em The Unicode Standard, Version 3.0}.
\newblock Addison Wesley, Reading, MA, 2000.
\bibitem{wadler:classes}
P.~Wadler and S.~Blott.
......
......@@ -30,7 +30,7 @@
\indexentry{vertab@{\it vertab}}{9}
\indexentry{formfeed@{\it formfeed}}{9}
\indexentry{comment@{\it comment}}{9}
\indexentry{dashes1@{\it dashes1}}{9}
\indexentry{dashes@{\it dashes}}{9}
\indexentry{ncomment@{\it ncomment}}{9}
\indexentry{opencom@{\it opencom}}{9}
\indexentry{closecom@{\it closecom}}{9}
......@@ -506,6 +506,7 @@
\indexentry{maybe@{\tt maybe}}{81}
\indexentry{either@{\tt either}}{81}
\indexentry{$"!@{\tt {\char'044}{\char'041}}}{81}
\indexentry{$@{\tt {\char'044}}}{81}
\indexentry{seq@{\tt seq}}{81}
\indexentry{strictness flags}{82}
\indexentry{Eq@{\tt Eq} (class)}{82}
......@@ -1043,7 +1044,7 @@
\indexentry{vertab@{\it vertab}}{129}
\indexentry{formfeed@{\it formfeed}}{129}
\indexentry{comment@{\it comment}}{129}
\indexentry{dashes1@{\it dashes1}}{129}
\indexentry{dashes@{\it dashes}}{129}
\indexentry{ncomment@{\it ncomment}}{129}
\indexentry{opencom@{\it opencom}}{129}
\indexentry{closecom@{\it closecom}}{129}
......@@ -1316,9 +1317,9 @@
\indexentry{range@{\tt range}}{169}
\indexentry{index@{\tt index}}{169}
\indexentry{inRange@{\tt inRange}}{169}
\indexentry{Ix@{\tt Ix}!derived instance}{170}
\indexentry{Ix@{\tt Ix} (class)!derived instance}{170}
\indexentry{enumeration}{170}
\indexentry{Ix@{\tt Ix}}{171}
\indexentry{Ix@{\tt Ix} (class)}{171}
\indexentry{range@{\tt range}}{171}
\indexentry{index@{\tt index}}{171}
\indexentry{inRange@{\tt inRange}}{171}
......@@ -1704,7 +1705,7 @@
\indexentry{bracket@{\tt bracket}}{211}
\indexentry{bracket{\char '137}@{\tt bracket{\char '137}}}{211}
\indexentry{I/O errors}{212}
\indexentry{IOError@{\tt IOError}}{212}
\indexentry{IOError@{\tt IOError} (datatype)}{212}
\indexentry{isAlreadyExistsError@{\tt isAlreadyExistsError}}{212}
\indexentry{isDoesNotExistError@{\tt isDoesNotExistError}}{212}
\indexentry{isAlreadyInUseError@{\tt isAlreadyInUseError}}{212}
......@@ -1838,7 +1839,7 @@
\indexentry{system@{\tt system}}{229}
\indexentry{exitWith@{\tt exitWith}}{229}
\indexentry{exitFailure@{\tt exitFailure}}{229}
\indexentry{ExitCode@{\tt ExitCode}}{229}
\indexentry{ExitCode@{\tt ExitCode} (datatype)}{229}
\indexentry{ExitSuccess@{\tt ExitSuccess}}{229}
\indexentry{ExitFailure@{\tt ExitFailure}}{229}
\indexentry{getArgs@{\tt getArgs}}{229}
......@@ -1954,9 +1955,9 @@
\indexentry{split@{\tt split}}{245}
\indexentry{genRange@{\tt genRange}}{245}
\indexentry{RandomGen@{\tt RandomGen}}{245}
\indexentry{StdGen@{\tt StdGen}}{246}
\indexentry{StdGen@{\tt StdGen} (datatype)}{246}
\indexentry{mkStdGen@{\tt mkStdGen}}{246}
\indexentry{Random@{\tt Random}}{247}
\indexentry{Random@{\tt Random} (class)}{247}
\indexentry{random@{\tt random}}{247}
\indexentry{randomR@{\tt randomR}}{247}
\indexentry{randoms@{\tt randoms}}{247}
......
......@@ -130,9 +130,9 @@
\end{tabular}\\[0.6\baselineskip]}
%special characters
\newcommand{\bkq}{\mbox{\it \char'022}} % (syntax) backquote char
\newcommand{\bkqB}{\bkq} % (syntax) backquote char (Before)
\newcommand{\bkqA}{\hspace{-.2em}\mbox{\it \char'022}}% (syntax) backquote char (After)
\newcommand{\bkq}{\mbox{\tt \char'022}} % (syntax) backquote char
\newcommand{\bkqB}{\bkq\hspace{-.2em}} % (syntax) backquote char (Before)
\newcommand{\bkqA}{\hspace{-.2em}\bkq}% (syntax) backquote char (After)
%\newcommand{\fwq}{\mbox{\it \char'023}} % (syntax) (forward) quote char
% math formatting
\newcommand{\ba}{\begin{array}}
......
......@@ -26,7 +26,7 @@ Some related operations on file systems are contained in the
\label{IOError}
Errors of type @IOError@ are used by the I/O monad. This is an
abstract type; the library provides functions to interrogate and
construct values in @IOError@:\indextt{IOError}
construct values in @IOError@:\indextycon{IOError}
\begin{itemize}
\item
@isAlreadyExistsError@\indextt{isAlreadyExistsError}
......@@ -271,7 +271,7 @@ handle will still fail as if "hdl" had been successfully closed.
For a handle "hdl" which is attached to a physical file, @hFileSize@\indextt{hFileSize}
"hdl" returns the size of that file in 8-bit bytes ("\geq" 0).
\subsubsection{Detecting the End of Input}
\subsection{Detecting the End of Input}
\label{EOF}
\index{end of file}
......@@ -296,7 +296,7 @@ except that it works only on @stdin@.
% The handle is not open for reading.
% \end{itemize}
\subsubsection{Buffering Operations}
\subsection{Buffering Operations}
\label{Buffering}
\index{file buffering}
......
......@@ -32,7 +32,7 @@ operations:
% lies within the bounds of an array when accessing that array.
\subsection{Deriving Instances of @Ix@}
\index{Ix@@{\tt Ix}!derived instance}
\indexdi{Ix}
It is possible to derive an instance of @Ix@ automatically, using
a @deriving@ clause on a @data@ declaration (Section~\ref{derived-decls}).
......@@ -100,7 +100,7 @@ instance (Ix a, Ix b) => Ix (a,b) where
}
\ecaption{Derivation of Ix instances}
\label{prelude-index}
\indextt{Ix}
\indexclass{Ix}
\indextt{range}\indextt{index}\indextt{inRange}
\indextt{rangeSize}
\end{figure}
......
%
% $Header: /home/cvs/root/haskell-report/report/lexemes.verb,v 1.13 2002/12/10 11:51:11 simonpj Exp $
% $Header: /home/cvs/root/haskell-report/report/lexemes.verb,v 1.14 2003/01/13 13:08:55 simonpj Exp $
%
%*section 2
%**<title>Haskell 98 Lexical Structure</title>
......@@ -171,7 +171,7 @@ identifiers beginning with underscore. This allows programmers to use
``@_foo@'' for a parameter that they expect to be unused.
@@@
varsym -> ( symbol \{symbol | @:@\} )_{\langle{}reservedop | dashes \rangle{}}
varsym -> ( symbol \{symbol | @:@\} )_{\langle{}reservedop | dashes\rangle{}}
consym -> (@:@ \{symbol | @:@\})_{\langle{}reservedop\rangle{}}
reservedop -> @..@ | @:@ | @::@ | @=@ | @\@ | @|@ | @<-@ | @->@ | \verb+@@+ | @~@ | @=>@
@@@
......
......@@ -160,7 +160,7 @@ is processed from right-to-left rather than left-to-right.
\subsection{@unfoldr@}
The @unfoldr@ function is a `dual' to @foldr@: while @foldr@ reduces a list
The @unfoldr@ function is a ``dual'' to @foldr@: while @foldr@ reduces a list
to a summary value, @unfoldr@ builds a list from a seed value. For
example:
\bprog
......
%
% $Header: /home/cvs/root/haskell-report/report/modules.verb,v 1.19 2002/12/10 11:51:11 simonpj Exp $
% $Header: /home/cvs/root/haskell-report/report/modules.verb,v 1.20 2003/01/13 13:08:56 simonpj Exp $
%
%**<title>The Haskell 98 Report: Modules</title>
%*section 5
......@@ -148,7 +148,7 @@ A value, field name, or class method, whether declared in
the module body or imported,
may be named by giving the name of the value as a "qvarid", which must be in scope.
Operators should be enclosed in parentheses to turn them into
"qvarid"'s.
"qvarid"s.
\item
An algebraic datatype "T"
......@@ -517,11 +517,10 @@ illegal to write
\eprog
\item {\em By an @import@ declaration.} An @import@ declaration, whether @qualified@ or not,
always brings into scope the qualified name of the imported entity (Section~\ref{import}).
\end{itemize}
Qualifiers may also be applied to
names imported by an unqualified import; this allows a qualified
This allows a qualified
import to be replaced with an unqualified one without forcing changes
in the references to the imported names.
\end{itemize}
\subsubsection{Name clashes}
......@@ -655,8 +654,8 @@ functions, called the ``Standard Prelude.'' In
\Haskell{}, the Prelude is contained in the
module @Prelude@.\indexmodule{Prelude} There are also
many predefined library modules, which provide less frequently used
functions and types. For example, arrays,
tables, and most of the input/output are all part of the standard
functions and types. For example, complex numberss, arrays,
and most of the input/output are all part of the standard
libraries. These are
defined in Part~\ref{libraries}
Separating
......
......@@ -82,7 +82,7 @@ type @StdGen@:
mkStdGen :: Int -> StdGen
@
\eprog
\indextt{StdGen}
\indextycon{StdGen}
\indextt{mkStdGen}
The @StgGen@ instance of @RandomGen@ has a @genRange@ of at least 30 bits.
......@@ -165,7 +165,7 @@ instance Random Bool where ...
instance Random Char where ...
@
\eprog
\indextt{Random}
\indexclass{Random}
\indextt{random}
\indextt{randomR}
\indextt{randoms}
......@@ -262,8 +262,8 @@ For example, @rollDice@ gets a random integer between 1 and 6:
\item[{[3]}] DG Carta, ``Two fast implementations of the minimal standard random number generator'',
Comm ACM, 33(1), Jan 1990, pp87-88.
\item[{[4]}] P Hellekalek, ``Don't trust parallel Monte Carlo'', Department of Mathematics,
University of Salzburg, @http://random.mat.sbg.ac.at/~peter/pads98.ps@, 1998.
\item[{[4]}] P Hellekalek, ``Don't trust parallel Monte Carlo'',
ACM SIGSIM Simulation Digest 28(1), pp82-89, July 1998.
\end{description}
The Web site @http://random.mat.sbg.ac.at/@ is a great source of information.
......
%
% $Header: /home/cvs/root/haskell-report/report/syntax-iso.verb,v 1.11 2002/12/10 11:51:11 simonpj Exp $
% $Header: /home/cvs/root/haskell-report/report/syntax-iso.verb,v 1.12 2003/01/13 13:08:56 simonpj Exp $
%
%**<title>Haskell 98 Syntax</title>
%**~header
......@@ -639,7 +639,7 @@ qual -> pat @<-@ exp & (\tr{generator})
| @let@ decls & (\tr{local declaration})
| exp & (\tr{guard})
alts -> alt_1 @;@ ... @;@ alt_n & (n>=0)
alts -> alt_1 @;@ ... @;@ alt_n & (n>=1)
alt -> pat @->@ exp [@where@ decls]
| pat gdpat [@where@ decls]
| & (empty alternative)
......
%
% $Header: /home/cvs/root/haskell-report/report/syntax-lexical.verb,v 1.9 2002/12/10 11:51:11 simonpj Exp $
% $Header: /home/cvs/root/haskell-report/report/syntax-lexical.verb,v 1.10 2003/01/13 13:08:56 simonpj Exp $
%
@@@
......@@ -22,7 +22,7 @@ space -> \tr{a space}
tab -> \tr{a horizontal tab}
uniWhite -> \tr{any Unicode character defined as whitespace}
comment -> dashes [ any_{\langle symbol\rangle} \{any\} ] newline
comment -> dashes [ any_{\langle{}symbol\rangle} \{any\} ] newline
dashes -> @--@ \{@-@\}
opencom -> @{-@
closecom -> @-}@
......@@ -39,7 +39,7 @@ uniSmall -> \tr{any Unicode lowercase letter}
large -> ascLarge | uniLarge
ascLarge -> @A@ | @B@ | ... | @Z@
uniLarge -> \tr{any uppercase or titlecase Unicode letter}
symbol -> ascSymbol | uniSymbol_{\langle{} special | @_@ | @:@ | @"@ | @'@ \rangle{}}
symbol -> ascSymbol | uniSymbol_{\langle{}special | @_@ | @:@ | @"@ | @'@\rangle{}}
ascSymbol -> @!@ | @#@ | @$@ | @%@ | @&@ | @*@ | @+@ | @.@ | @/@ | @<@ | @=@ | @>@ | @?@ | @@
| @\@ | @^@ | @|@ | @-@ | @~@
......@@ -66,7 +66,7 @@ hexit -> digit | @A@ | ... | @F@ | @a@ | ... | @f@
\indexsyn{vertab}%
\indexsyn{formfeed}%
\indexsyn{comment}%
\indexsyn{dashes1}%
\indexsyn{dashes}%
\indexsyn{ncomment}%
\indexsyn{opencom}%
\indexsyn{closecom}%
......
......@@ -6,7 +6,7 @@
\outline{
\inputHS{lib-hdrs/System}
}
\indextt{ExitCode}\indextt{ExitSuccess}\indextt{ExitFailure}
\indextycon{ExitCode}\indextt{ExitSuccess}\indextt{ExitFailure}
\indextt{getArgs}\indextt{getProgName}\indextt{getEnv}
\indextt{system}\indextt{exitWith}\indextt{exitFailure}
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment