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

End August

parent 525d949c
......@@ -246,6 +246,14 @@ is wrong; it should read
f x y = return x == y
</pre>
<p><li> [Sept 2001] <strong>Page 58, Section 4.5.5, Momomorphism.</strong>
In the boxed text entitled "The monomorphism restriction", replace
"The usual Hindley-Milner restriction on polymorphism is that only
type variables free in the environment may be generalized" by
<p>
"The usual Hindley-Milner restriction on polymorphism is that only
type variables that do not occur free in the environment may be generalized."
<p><li> [May 2001] <strong>Page 62, Section 5, Modules.</strong>
In paragraph 4, add a footnote to the sentence "A multi-module Haskell
program can be converted into a single-module program by ...", namely:
......@@ -554,11 +562,12 @@ Replace the definitions of <tt>take</tt>, <tt>drop</tt>, and <tt>splitAt</tt> wi
The effect is that all three functions are defined on negative arguments. This
is a semantic change.
<p><li> [May 2001] <strong>Page 115, instances <tt>Show Int</tt> and <tt>Read Int</tt></strong>.
<p><li> [May 2001; showsPrec corrected Sept 2001]
<strong>Page 115, instances <tt>Show Int</tt> and <tt>Read Int</tt></strong>.
Replace the instances for <tt>Show Int</tt> and <tt>Read Int</tt> with
<pre>
instance Show Int where
showsPrec = showsPrec . toInteger
showsPrec n = showsPrec n . toInteger
-- Converting to Integer avoids
-- possible difficulty with minInt
......@@ -659,6 +668,15 @@ doing it by hand. In particular, an error will be raised if y is zero.
</pre>
</ul>
<p><li> [Sept 2001] <strong>Page 16, Section 4, Numeric library</strong>. In the definition
of <tt>readFloat</tt>, after "... <tt>(k,t) <- readExp s]</tt>" add
<pre>
++ [ (0/0, t) | ("NaN",t) <- lex r]
++ [ (1/0, t) | ("Infinity",t) <- lex r]
</pre>
(This makes <tt>readFloat</tt> able to read "Infinity" and "NaN", which <tt>formatRealFloat</tt>
can produce.)
<p><li> <strong>Page 17, Section 5, first text line</strong>. Replace "continuous" by "contiguous".
<p><li> [May 2001] <strong>Page 17, Section 5, Indexing operations</strong>.
......@@ -718,16 +736,31 @@ must provide <tt>Ix</tt> instances for tuples up to at least size 15."
[This change just clarifies, and propagates the "instances up to size 15" change from
Section 6.1.6 of the Language Report.]
<p><li> [May 2001] <strong>Page 24, Section 6.6</strong>.
Add <tt>Eq a</tt> to the context for <tt>instance Eq (Array a b)</tt>, thus:
<p><li> [Sept 2001] <strong>Page 23,24, Section 6.4</strong>.
<ul>
<li> In the definition of <tt>array</tt> on page 23, replace "<tt>i == j</tt>" by
"<tt>index b i == index b j</tt>".
<li> Replace the definition of <tt>(//)</tt> on page 24 with:
<pre>
a // new_ivs = array b (old_ivs ++ new_ivs)
where
b = bounds a
old_ivs = [(i,a!i) | i <- indices a,
index b i `notElem` new_is]
new_is = [index b j | (j,_) <- new_ivs]
</pre>
<li> Add <tt>Eq a</tt> to the context for <tt>instance Eq (Array a b)</tt>, thus:
<pre>
instance (Ix a, Eq a, Eq b) => Eq (Array a b) ...
</pre>
Similarly, add <tt>Ord a</tt> to the context for <tt>instance Ord (Array a b)</tt>, thus:
<li> Add <tt>Ord a</tt> to the context for <tt>instance Ord (Array a b)</tt>, thus:
<pre>
instance (Ix a, Ord a, Ord b) => Ord (Array a b) ...
</pre>
(Both consequences of removing <tt>Ord</tt> as a superclass of <tt>Ix</tt>.)
</ul>
(All consequences of removing <tt>Ord</tt> as a superclass of <tt>Ix</tt>.)
<p><li> <strong>Page 22, Section 6.3; and Page 23, Fig 3</strong>:
Replace "<tt>map</tt>" by "<tt>fmap</tt>" (two occurrences in 6.3, one in Fig 3).
......@@ -877,7 +910,7 @@ of <tt>Permissions</tt> with
</pre>
<li> Remove <tt>readable, writable, executable, searchable</tt> both from
the module header, and from the module body.
<li> Change <tt>Permissions</tt> to <tt>Permissions(readable, writable, executable, searchable)</tt>
<li> Change <tt>Permissions</tt> to <tt>Permissions(Permissions, readable, writable, executable, searchable)</tt>
in the module header.
</ul>
......
......@@ -14,7 +14,7 @@ array :: (Ix a) => (a,a) -> [(a,b)] -> Array a b
array b ivs =
if and [inRange b i | (i,_) <- ivs]
then MkArray b
(\j -> case [v | (i,v) <- ivs, i == j] of
(\j -> case [v | (i,v) <- ivs, index b i == index b j] of
[v] -> v
[] -> error "Array.!: \
\undefined array element"
......@@ -41,9 +41,12 @@ assocs :: (Ix a) => Array a b -> [(a,b)]
assocs a = [(i, a!i) | i <- indices a]
(//) :: (Ix a) => Array a b -> [(a,b)] -> Array a b
a // us = array (bounds a)
([(i,a!i) | i <- indices a \\ [i | (i,_) <- us]]
++ us)
a // new_ivs = array b (old_ivs ++ new_ivs)
where
b = bounds a
old_ivs = [(i,a!i) | i <- indices a,
index b i `notElem` new_is]
new_is = [index b j | (j,_) <- new_ivs]
accum :: (Ix a) => (b -> c -> b) -> Array a b -> [(a,c)]
-> Array a b
......
......@@ -277,7 +277,9 @@ floatToDigits base x =
readFloat :: (RealFloat a) => ReadS a
readFloat r = [(fromRational ((n%1)*10^^(k-d)),t) | (n,d,s) <- readFix r,
(k,t) <- readExp s]
(k,t) <- readExp s] ++
[ (0/0, t) | ("NaN",t) <- lex r] ++
[ (1/0, t) | ("Infinity",t) <- lex r]
where readFix r = [(read (ds++ds'), length ds', t)
| (ds,d) <- lexDigits r,
(ds',t) <- lexFrac d ]
......
module Directory (
Permissions( readable, writable, executable, searchable ),
Permissions( Permissions, readable, writable, executable, searchable ),
createDirectory, removeDirectory, removeFile,
renameDirectory, renameFile, getDirectoryContents,
getCurrentDirectory, setCurrentDirectory,
......
......@@ -31,6 +31,7 @@ We would like to express our thanks to those who have contributed
directly or indirectly to this report without being named as authors,
including
Olaf Chitil,
Mark Carroll,
Tony Davie,
Sigbjorn Finne,
Andy Gill,
......
%
% $Header: /home/cvs/root/haskell-report/libraries/library.verb,v 1.8 2001/08/23 16:41:41 simonpj Exp $
% $Header: /home/cvs/root/haskell-report/libraries/library.verb,v 1.9 2001/08/31 16:03:08 simonpj Exp $
%
% NOTE:--------------------------------------------------------------
% The formatting of this report and the ``new font selection scheme''
......@@ -74,7 +74,7 @@
\makeindex
% an extra thing for makeindex
\newcommand{\seealso}[2]{{\em see also\/} #1}
\newcommand{\hseealso}[2]{{\em see also\/} #1}
% NEWCOMMANDS
......
......@@ -128,7 +128,7 @@ lex (c:s) | isSingle c = [([c],s)]
lexExp s = [("",s)]
instance Show Int where
showsPrec = showsPrec . toInteger
showsPrec n = showsPrec n . toInteger
-- Converting to Integer avoids
-- possible difficulty with minInt
......
%
% $Header: /home/cvs/root/haskell-report/report/decls.verb,v 1.7 2001/08/23 16:41:41 simonpj Exp $
% $Header: /home/cvs/root/haskell-report/report/decls.verb,v 1.8 2001/08/31 16:03:08 simonpj Exp $
%
%**<title>The Haskell 98 Report: Declarations</title>
%*section 4
......@@ -403,20 +403,18 @@ valid types:
In the third type, the constraint @Eq (f a)@ cannot be made
simpler because @f@ is universally quantified.
The type of an expression "e"
depends on a {\em type environment}
\index{type environment}
that gives types for the free variables in "e", and a
{\em class environment}
\index{class environment}
that declares which types are instances of which classes (a type becomes
The type of an expression "e" depends
on a {\em type environment}\index{type environment} that gives types
for the free variables in "e", and a
{\em class environment}\index{class environment} that
declares which types are instances of which classes (a type becomes
an instance of a class only via the presence of an
@instance@ declaration or a @deriving@ clause).
Types are related by a generalization order
Types are related by a generalization preorder
\index{generalization preorder}
(specified below);
the most general type, up to the equivalence induced by the generalisation preorder,
the most general type, up to the equivalence induced by the generalization preorder,
that can be assigned to a particular
expression (in a given environment) is called its {\em
principal type}.
......@@ -431,8 +429,8 @@ are usually optional (see
Sections~\ref{expression-type-sigs} and~\ref{type-signatures}).
The type "\forall \overline{u}.~cx_1 \Rightarrow t_1" is
{\em more general than}
the type "\forall \overline{w}.~cx_2 \Rightarrow t_2" if and only if there is
{\em more general than} the
type "\forall \overline{w}.~cx_2 \Rightarrow t_2" if and only if there is
a substitution "S" whose domain is "\overline{u}" such that:
\begin{itemize}
\item "t_2" is identical to "S(t_1)".
......@@ -1901,7 +1899,7 @@ an explicit type signature is given for every variable in the group
that is bound by simple pattern binding.
\end{description}
The usual Hindley-Milner restriction on polymorphism is that
only type variables free in the environment may be generalized.
only type variables that do not occur free in the environment may be generalized.
In addition, {\em the constrained type variables of
a restricted declaration group may not be generalized}
in the generalization step for that group.
......
%
% $Header: /home/cvs/root/haskell-report/report/exps.verb,v 1.6 2001/08/23 16:16:57 simonpj Exp $
% $Header: /home/cvs/root/haskell-report/report/exps.verb,v 1.7 2001/08/31 16:03:08 simonpj Exp $
%
%*section 3
%**<title>The Haskell 98 Report: Expressions</title>
......@@ -348,7 +348,7 @@ pattern fails to match, then the result is "\bot".
\subsection{Operator Applications}
\index{operator application}
%\index{operator application|seealso{application}}
%\index{operator application|hseealso{application}}
\label{operators}
%
@@@
......@@ -399,7 +399,7 @@ The following identities hold:
\subsection{Sections}
\index{section}
%\index{section|seealso{operator application}}
%\index{section|hseealso{operator application}}
\label{sections}
%
@@@
......
%
% $Header: /home/cvs/root/haskell-report/report/haskell.verb,v 1.8 2001/08/23 16:41:41 simonpj Exp $
% $Header: /home/cvs/root/haskell-report/report/haskell.verb,v 1.9 2001/08/31 16:03:08 simonpj Exp $
%
% NOTE:--------------------------------------------------------------
......@@ -431,14 +431,14 @@
\vspace{.15in}
\begin{center} \large
\begin{tabular}{l@@{\hspace{5mm}}l}
Simon Peyton Jones$^8$ [editor] & John Hughes$^3$ [editor] \\
Lennart Augustsson$^3$ & Dave Barton$^7$ \\
Brian Boutel$^4$ & Warren Burton$^5$ \\
Joseph Fasel$^6$ & Kevin Hammond$^2$ \\
Ralf Hinze$^{12}$ & Paul Hudak$^1$ \\
Thomas Johnsson$^3$ & Mark Jones$^9$ \\
Simon Peyton Jones$^8$ [editor] & Lennart Augustsson$^9$ \\
Dave Barton$^7$ & Brian Boutel$^4$ \\
Warren Burton$^5$ & Joseph Fasel$^6$ \\
Kevin Hammond$^2$ & Ralf Hinze$^{12}$ \\
Paul Hudak$^1$ & John Hughes$^3$ \\
Thomas Johnsson$^3$ & Mark Jones$^{14}$ \\
John Launchbury$^{14}$ & Erik Meijer$^{10}$ \\
John Peterson$^1$ & Alastair Reid$^1$ \\
John Peterson$^1$ & Alastair Reid$^{15}$ \\
Colin Runciman$^{13}$ & Philip Wadler$^{11}$
\end{tabular}
\end{center}
......
%
% $Header: /home/cvs/root/haskell-report/report/modules.verb,v 1.8 2001/08/23 16:41:41 simonpj Exp $
% $Header: /home/cvs/root/haskell-report/report/modules.verb,v 1.9 2001/08/31 16:03:08 simonpj Exp $
%
%**<title>The Haskell 98 Report: Modules</title>
%*section 5
......@@ -106,12 +106,9 @@ A module
begins with a header: the keyword
@module@, the module name, and a list of entities (enclosed in round
parentheses) to be exported. The header is followed by an optional
list of @import@ declarations that specify modules to be imported,
optionally restricting
the imported bindings. This is
followed by the module
body. The module body is simply a list of import declarations ("impdecls", Section~\ref{import}) and
top-level declarations ("topdecls", Section~\ref{declarations}).
list of @import@ declarations ("impdecls", Section~\ref{import}) that specify modules to be imported,
optionally restricting the imported bindings.
This is followed by a list of top-level declarations ("topdecls", Section~\ref{declarations}).
An abbreviated form of module, consisting only
of\index{abbreviated module}
......@@ -239,7 +236,7 @@ The {\em unqualified} names of the entities exported by a module must all be dis
(within their respective namespace). For example
\bprog
@
module A ( module B, C.f, g ) where -- an invalid module
module A ( B.f, C.f, g ) where -- an invalid module
import qualified B(f,g)
import qualified C(f)
g = True
......@@ -426,7 +423,7 @@ Import declaration & Names brought into scope \\
@import qualified A hiding ()@ & @A.x@, @A.y@ \\
@import qualified A hiding (x)@ & @A.y@ \\
@import A as B@ & @x@, @y@, @B.x@, @B.y@ \\
@import A(x) as B@ & @B.x@ \\
@import A as B(x)@ & @B.x@ \\
@import qualified A as B@ & @B.x@, @B.y@ \\
\hline
\end{tabular}
......
%
% $Header: /home/cvs/root/haskell-report/report/preface-13.verb,v 1.5 2001/08/20 07:57:53 simonpj Exp $
% $Header: /home/cvs/root/haskell-report/report/preface-13.verb,v 1.6 2001/08/31 16:03:08 simonpj Exp $
%
%**<title>The Haskell 98 Report: Preface</title>
%*section
......@@ -304,8 +304,10 @@ Michael Marte,
Jim Mattson,
Sergey Mechveliani,
Erik Meijer,
Gary Memovich,
Randy Michelsen,
Rick Mohr,
Andy Moran,
Arthur Norman,
Nick North,
Chris Okasaki,
......
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