Commit 7aab6ed2 authored by Simon Peyton Jones's avatar Simon Peyton Jones
Browse files

End Sept

parent 9bf2dd23
......@@ -199,6 +199,25 @@ In clause (r) replace "e0" by "v" throughout.
First paragraph, last sentence. After "infix type constructors are not allowed",
add "(other than <tt>(->)</tt>)".
<p><li> [Late Sept 2001] <strong>Page 38, Section 4.1.2, Algebraic Datatype Declarations.</strong>
Replace the sentence
"Although the tuple, list, and function types have special syntax, they
are not different from user-defined types with equivalent
functionality."
with
<p>
"These special syntactic forms always denote the built-in type constructors
for functions, tuples, and lists, regardless of what is in scope.
In a similar way, the prefix type constructors <tt>(->),</tt>, <tt>[]</tt>, <tt>()</tt>, <tt>(,)</tt>,
and so on, always denote the built-in type constructors; they
cannot be qualified, nor mentioned in import or export lists (Section 5).
(Hence the special production, <em>gtycon</em>, above.)
<p>
"Although the tuple and list types have special syntax, their semantics
is the same as the equivalent user-defined algebraic data types."
<p>
(This stuff is clarification only.)
<p><li> <strong>Page 40, Section 4.2.1, Algebraic Datatype Declarations.</strong>
In the bottom paragraph on the page, before "The context in the data declaration
has no other effect whatsoever" add the following:
......@@ -337,12 +356,9 @@ be imported...".
Delete the two sentences "The hiding clause only applies to unqualified
names... A hiding clause has no effect....".
<p><li> [Aug 2001] <strong>Page 66, Section 5.3, Import Declarations, numbered item 2.</strong>
Add "It is not an error to hide an entity that is not, in fact, exported by
the imported module, although compilers are encouraged to flag a warning in this case."
(This is different from what I proposed by email, which made this case an error,
but it allow a bit more flexibility
as modules change.)
<p><li> [Late Sept 2001] <strong>Page 66, Section 5.3, Import Declarations, numbered item 2.</strong>
Add "It is an error to hide an entity that is not, in fact, exported by
the imported module."
<p><li> [July 2001] <strong>Page 66, Section 5.3.1, Qualified Import.</strong> [This section
becomes 5.3.2.] Replace the first sentence with:
......@@ -506,6 +522,15 @@ After the above signature for <tt>userError</tt>, add the following:
fail s = ioError (userError s)
</pre>"
<p><li> [Late Sept 2001] <strong>Page 93, Appendix A, Standard Prelude.</strong>
Replace the fixity declaration for <tt>(:)</tt> by the following comments:
<pre>
-- The (:) operator is built-in syntax, and cannot legally be given
-- a fixtity declaration; but its fixity is given by:
-- infixr 5 :
</pre>
<p><li><strong>Page 94, Appendix A, Standard Prelude, class <tt>Enum</tt>.</strong>
After the default method for <tt>enumFromTo</tt> add
<pre>
......@@ -739,16 +764,17 @@ Add the following equation to the laws listed just before Section 5.1:
</pre>
This documents an invariant that was previously only implicit.
<p><li> [May 2001] <strong>Page 17, Section 5, Indexing operations</strong>.
This significant item (a) removes <tt>Ord</tt> from <tt>Ix</tt>'s superclasses, and
(b) make <tt>rangeSize</tt> into a method of <tt>Ix</tt> rather than a free-standing declaration.
Though these changes are
visible to the programmer, all existing Haskell 98 programs will continue to work.
<p><li> [Late Sept 2001] <strong>Page 17, Section 5, Indexing operations</strong>.
This significant item makes <tt>rangeSize</tt> into a method of
<tt>Ix</tt> rather than a free-standing declaration. Though this
change is visible to the programmer, all existing Haskell 98
programs will continue to work.
<ul>
<li> <strong>Page 17, Section 5, Indexing operations, boxed text</strong>. Replace the <tt>Ix</tt>
change the class declaration, and the type signature for <tt>rangeSize</tt> with:
<pre>
class Ix a where
class Ord a => Ix a where
range :: (a,a) -> [a]
index :: (a,a) -> a -> Int
inRange :: (a,a) -> a -> Bool
......@@ -757,7 +783,7 @@ change the class declaration, and the type signature for <tt>rangeSize</tt> with
<li> <strong>Section 5.2, pages 19, line 3</strong>. Replace the <tt>Ix</tt>
class declaration, and the <tt>rangeSize</tt> declaration, with:
<pre>
class Ix a where
class Ord a => Ix a where
range :: (a,a) -> [a]
index :: (a,a) -> a -> Int
inRange :: (a,a) -> a -> Bool
......@@ -789,32 +815,6 @@ 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> [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>
<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>
</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).
......
......@@ -12,6 +12,11 @@ makeindex, and dvips.
To generate the html library report you need Hugs 1.4 (probably any Haskell
1.4 compiler will do).
To chage the date on the report, you must change:
* haskell.verb (line 415-ish)
* index.html (line 8-ish)
* html.config (~foot item)
Source files:
library.verb -- Top level of the library report
......
......@@ -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, index b i == index b j] of
(\j -> case [v | (i,v) <- ivs, i == j] of
[v] -> v
[] -> error "Array.!: \
\undefined array element"
......@@ -41,12 +41,11 @@ 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 // new_ivs = array b (old_ivs ++ new_ivs)
a // new_ivs = array (bounds a) (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]
i `notElem` new_is]
new_is = [i | (i,_) <- new_ivs]
accum :: (Ix a) => (b -> c -> b) -> Array a b -> [(a,c)]
-> Array a b
......@@ -63,10 +62,10 @@ ixmap b f a = array b [(i, a ! f i) | i <- range b]
instance (Ix a) => Functor (Array a) where
fmap fn (MkArray b f) = MkArray b (fn . f)
instance (Ix a, Eq a, Eq b) => Eq (Array a b) where
instance (Ix a, Eq b) => Eq (Array a b) where
a == a' = assocs a == assocs a'
instance (Ix a, Ord a, Ord b) => Ord (Array a b) where
instance (Ix a, Ord b) => Ord (Array a b) where
a <= a' = assocs a <= assocs a'
instance (Ix a, Show a, Show b) => Show (Array a b) where
......
......@@ -33,7 +33,7 @@ style=article
~back=<a href="~prev.html">back</a>
~nxt=<a href="~next.html">next</a>
~contents=<a href="libindex.html">contents</a>
~foot=<br><font size=2>1 February, 1999</font>
~foot=<br><font size=2>September 2001</font>
~footer=<hr>~id~top | ~back | ~nxt | ~contents ~foot
~sfooter=<hr>~id~top | back | ~nxt | ~contents ~foot
~efooter=<hr>~id~top | ~back | next | ~contents ~foot
......
......@@ -7,7 +7,7 @@
<img src="h98-libs.gif" alt="Haskell 98 Libraries">
<h3 align="center">Standard Libraries for Haskell 98</h3>
<h3 align="center">Revised: July 2001</h3>
<h3 align="center">Revised: September 2001</h3>
</div>
<hr>
<h3>Table of Contents</h3>
......
%
% $Header: /home/cvs/root/haskell-report/libraries/library.verb,v 1.9 2001/08/31 16:03:08 simonpj Exp $
% $Header: /home/cvs/root/haskell-report/libraries/library.verb,v 1.10 2001/09/24 14:40:47 simonpj Exp $
%
% NOTE:--------------------------------------------------------------
% The formatting of this report and the ``new font selection scheme''
......@@ -412,7 +412,7 @@
{\Large\bf for the} \\[.1in]
{\huge\bf Haskell 98} \\[.3in]
{\LARGE\bf Programming Language} \\[.3in]
{\large\bf Revised: July 2001}
{\large\bf Revised: September 2001}
\end{center}
\vspace{.15in}
......
......@@ -5,10 +5,15 @@ module Prelude (
Either(Left, Right),
Ordering(LT, EQ, GT),
Char, String, Int, Integer, Float, Double, Rational, IO,
-- These built-in types are defined in the Prelude, but
-- are denoted by built-in syntax, and cannot legally
-- appear in an export list.
-- List type: []((:), [])
-- Tuple types: (,), (,,), etc.
-- Trivial type: ()
-- Functions: (->)
Eq((==), (/=)),
Ord(compare, (<), (<=), (>=), (>), max, min),
Enum(succ, pred, toEnum, fromEnum, enumFrom, enumFromThen,
......@@ -46,7 +51,11 @@ infixr 9 .
infixr 8 ^, ^^, **
infixl 7 *, /, `quot`, `rem`, `div`, `mod`
infixl 6 +, -
infixr 5 :
-- The (:) operator is built-in syntax, and cannot legally be given
-- a fixtity declaration; but its fixity is given by:
-- infixr 5 :
infix 4 ==, /=, <, <=, >=, >
infixr 3 &&
infixr 2 ||
......
......@@ -13,8 +13,8 @@ To generate the html report you need Hugs 1.4 (probably any Haskell
1.4 compiler will do).
To chage the date on the report, you must change:
* haskell.verb
* index.html
* haskell.verb (line 429-ish)
* index.html (line 8-ish)
* html.config (~foot item)
......
%
% $Header: /home/cvs/root/haskell-report/report/decls.verb,v 1.10 2001/09/10 11:06:23 simonpj Exp $
% $Header: /home/cvs/root/haskell-report/report/decls.verb,v 1.11 2001/09/24 14:40:47 simonpj Exp $
%
%**<title>The Haskell 98 Report: Declarations</title>
%*section 4
......@@ -288,18 +288,25 @@ It denotes the type of lists with elements of type "t" (see
Sections~\ref{lists} and \ref{basic-lists}).
\end{enumerate}
Although the tuple, list, and function types have special syntax, they
are not different from user-defined types with equivalent
functionality.
These special syntactic forms always denote the built-in type constructors
for functions, tuples, and lists, regardless of what is in scope.
In a similar way, the prefix type constructors @(->)@, @[]@, @()@, @(,)@,
and so on, always denote the built-in type constructors; they
cannot be qualified, nor mentioned in import or export lists (Section~\ref{modules}).
(Hence the special production, ``gtycon'', above.)
Expressions and types have a consistent syntax.
Although the list and tuple types have special syntax, their semantics
is the same as the equivalent user-defined algebraic data types.
Notice that expressions and types have a consistent syntax.
If "t_i" is the type of
expression or pattern "e_i", then the expressions "@(\@ e_1 @->@ e_2@)@",
"@[@e_1@]@", and "@(@e_1,e_2@)@" have the types "@(@t_1 @->@ t_2@)@",
"@[@t_1@]@", and "@(@t_1,t_2@)@", respectively.
\index{quantification}
With one exception, the
With one exception (that of the distinguished type variable
in a class declaration (Section~\ref{class-decls})), the
type variables in a \Haskell{} type expression
are all assumed to be universally quantified; there is no explicit
syntax for universal quantification~\cite{damas-milner82}.
......@@ -312,9 +319,6 @@ explicitly quantified type, the scope of the "\forall" extends as far
to the right as possible; for example, "\forall a.~a \rightarrow a" means
"\forall a.~(a \rightarrow a)".
The exception referred to is that of the distinguished type variable
in a class declaration (Section~\ref{class-decls}).
%Every type variable appearing in a signature
%is universally quantified over that signature. This last
%constraint implies that signatures such as:
......
%
% $Header: /home/cvs/root/haskell-report/report/exps.verb,v 1.9 2001/09/11 13:04:27 simonpj Exp $
% $Header: /home/cvs/root/haskell-report/report/exps.verb,v 1.10 2001/09/24 14:40:47 simonpj Exp $
%
%*section 3
%**<title>The Haskell 98 Report: Expressions</title>
......@@ -7,25 +7,17 @@
\section{Expressions}\index{expression}
\label{expressions}
In this section, we describe the syntax and informal semantics of \Haskell{}
{\em expressions}, including their translations into the
In this section, we describe the syntax and informal semantics of
\Haskell{} {\em expressions}, including their translations into the
\Haskell{} kernel, where appropriate. Except in the case of @let@
expressions, these translations preserve both the static and dynamic
semantics.
Free variables and constructors used in these translations refer to
entities
defined by the Prelude. To avoid clutter,
\index{Prelude}
we use @True@ instead of
@Prelude.True@ or @map@ instead of @Prelude.map@. (@Prelude.True@ is a
"qualified name" as described in Section~\ref{import}.)
Free variables and constructors used in these translations
always refer to entities defined by the @Prelude@.
For example, ``@concatMap@'' used in the translation of list comprehensions
(Section~\ref{list-comprehensions})
means the @concatMap@ defined by the @Prelude@, regardless of what is in scope
where the list comprehension is used.
semantics. Free variables and constructors used in these translations
always refer to entities defined by the @Prelude@. For example,
``@concatMap@'' used in the translation of list comprehensions
(Section~\ref{list-comprehensions}) means the @concatMap@ defined by
the @Prelude@, regardless of whether or not the identifier ``@concatMap@'' is in
scope where the list comprehension is used, and (if it is in scope)
what it is bound to.
In the syntax that follows, there are some families of nonterminals
indexed by precedence levels (written as a superscript). Similarly, the
......
%
% $Header: /home/cvs/root/haskell-report/report/haskell.verb,v 1.9 2001/08/31 16:03:08 simonpj Exp $
% $Header: /home/cvs/root/haskell-report/report/haskell.verb,v 1.10 2001/09/24 14:40:47 simonpj Exp $
%
% NOTE:--------------------------------------------------------------
......@@ -426,7 +426,7 @@
{\LARGE\bf Programming Language} \\[.3in]
{\huge\bf Haskell 98} \\[.3in]
{\Large\bf A Non-strict, Purely Functional Language} \\[.3in]
{\large\bf Revised: FILL IN DATE!!}
{\large\bf Revised: September 2001}
\end{center}
\vspace{.15in}
\begin{center} \large
......
......@@ -26,7 +26,7 @@ style=article
~nxt=<a href="~next.html">next</a>
~funct=<a href="prelude-index.html">function index</a>
~contents=<a href="index98.html">contents</a>
~foot=<br><font size=2>1 February, 1999</font>
~foot=<br><font size=2>September 2001</font>
~footer=<hr>~id~top | ~back | ~nxt | ~contents | ~funct ~foot
~sfooter=<hr>~id~top | back | ~nxt | ~contents | ~funct ~foot
~efooter=<hr>~id~top | ~back | next | ~contents | ~funct ~foot
......
......@@ -5,7 +5,7 @@
<img src="h98.gif" alt="Haskell 98">
<h3>Haskell 98: A Non-strict, Purely Functional Language</h3>
<h3 align="center">Revised: July 2001</h3>
<h3 align="center">Revised: September 2001</h3>
</div>
<hr>
<h3>Brief Table of Contents</h3>
......
%
% $Header: /home/cvs/root/haskell-report/report/modules.verb,v 1.11 2001/09/13 13:29:08 simonpj Exp $
% $Header: /home/cvs/root/haskell-report/report/modules.verb,v 1.12 2001/09/24 14:40:48 simonpj Exp $
%
%**<title>The Haskell 98 Report: Modules</title>
%*section 5
......@@ -195,37 +195,39 @@ that are in scope (whether qualified or not).
\end{itemize}
\item
The form `"@module@ M"' abbreviates the set of all entities whose
names are brought into scope by one or more {\em unqualified} @import@ declarations
of the form `"@import@~M~[impspec]"' or `"@import@~A~@as@~M~[impspec]"'. This set may be empty.
The form ``@module M@'' abbreviates the set of all entities whose
{\em unqualified} name, $e$, is in scope, and for which the {\em qualified} name
$M.e$ is also in scope and refers to the same entity as $e$. This set
may be empty.
For example:
\bprog
@
module Queue( module Stack, enqueue, dequeue ) where
import Stack
...
module Queue( module Stack, enqueue, dequeue ) where
import Stack
...
@
\eprog
Here the module @Queue@ uses the module name @Stack@ in its export
list to abbreviate all the entities imported from @Stack@.
\item
Additionally, a module can name its own local definitions in its export
list using its name in the `"@module@" m' syntax. For example:
A module can name its own local definitions in its export
list using its own name in the ``@module M@'' syntax, because a local
declaration brings into scope both a qualified and unqualified name (Section~\ref{qualifiers}).
For example:
\bprog
@
module Mod1(module Mod1, module Mod2) where
import Mod2
import Mod3
module Mod1( module Mod1, module Mod2 ) where
import Mod2
import Mod3
@
\eprog
Here module @Mod1@ exports all local definitions as well as those
imported from @Mod2@ but not those imported from @Mod3@. Note that
@module M where@ is the same as using @module M(module M) where@.
\end{enumerate}
It is an error to use "@module@~M" in an export list unless $M$ is the
module bearing the export list, or $M$ is imported
by at least one @import@ declaration (qualified or unqualified).
imported from @Mod2@ but not those imported from @Mod3@.
It is an error to use @module M@ in an export list unless @M@ is
the module bearing the export list, or @M@ is imported by at
least one import declaration (qualified or unqualified).
\end{enumerate}
Exports lists are cumulative: the set of entities exported by an export
list is the union of the entities exported by the individual items of the list.
......@@ -329,8 +331,8 @@ associated type. Thus, in
any constructor, class, or type named @C@ is excluded. In contrast,
using @C@ in an import list names only a class or type.
It is not an error to hide an entity that is not, in fact, exported by
the imported module, although compilers are encouraged to flag a warning in this case.
It is an error to hide an entity that is not, in fact, exported by
the imported module.
\item
Finally, if "impspec" is omitted then
......
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