 Title page. Add the paragraph:
"Copyright (c) Simon Peyton Jones and John Hughes.
The authors intend this Report to belong to the entire Haskell
community, and so we grant permission to copy and
distribute it for any purpose, provided that it is
reproduced in its entireity, including this Notice. Modified
versions of this Report may also be copied and distributed for any purpose,
provided that the modified version is clearly presented as such,
and that it does not claim to be a definition of the language Haskell 98."
 Page 9, Section 2.6, Character and String Literals.
In the production for "cntrl" replace "ASClarge" by "ascLarge".
 Page 10, Section 2.7, Layout.
In the middle of the third paragraph, just before the sentence beginning
"A close brace is also inserted...", add the following sentence:
"If the indentation of the nonbrace lexeme immediately
following a where, let,
do or of is less than or equal to the current indentation level,
then instead of starting a layout, an empty list "{}" is inserted, and
layout processing occurs for the current level (i.e. insert a semicolon or close brace)."
 Page 11, Figures 1 and 2. In both figures the signature for size
should be
size :: Stack a > Int
 [Apr 2001] Page 14, Section 3.1, Errors. In the first sentence of
the section, after "indistinguishable" add "by a Haskell program".
 [Apr 2001] Page 20, Section 3.10, Arithmetic sequences.
In the second paragraph, in the sentence "For the type Integer,
arithmetic sequences have the following meaning...", replace "Integer"
with "Int".
 [Apr 2001] Page 21, Section 3.11, List Comprehensions; and Page 128.
 In the production for "aexp", change the "n >= 0" to "n >= 1".
 Remove the production for (empty qualifier)
 In the translation box lower down the page, rewrite the translation so
that it does not involve and empty list of qualifiers. (Unchanged semantics.)
This change ensures that there is at least one qualifier in list comprehension,
and no qualifier is empty. The translation lower down page 23 is then
not utterly rigorous, because Q can be empty, and when it is there is no preceding
comma, but I reckon it would make matters worse to "fix" it.
 [Apr 2001] Page 23, Section 3.14, Do Expressions;
and Page 128, Appendix B.4, Context Free Syntax.
That is, every list of statements must end in an expression, optionally
followed by a semicolon.
 [Apr 2001] Page 31,33, Figures 3 and 4, Semantics of Case Expressions.
Replace "completely new variable" by "new variable" in these two figures. (Some clauses
said "new" and some "completely new" which is misleadingly inconsistent.)
 [Apr 2001] Page 33, Figure 4, Semantics of Case Expressions Part 2.
In clause (r) replace "e0" by "v" throughout.
 Page 40, Section 4.2.1, Algebraic Datatype Declarations.
In the bottom paragraph on the page, before "The context in the data declaration
has no other effect whatsoever" add the following:
"Pattern matching against ConsSet also gives rise to an Eq a
constraint. For example:
f (ConsSet a s) = a
the function f has inferred type Eq a => Set a > a."
 Page 41, Section 4.2.1, subsection Labelled Fields.
At the end of the subsection, add a new paragraph:
"The pattern "F {}" matches any value built with constructor F,
whether or not F was declared with record syntax."
 [Apr 2001] Page 42, Section 4.2.1, subsection Labelled Fields.
Change "occurance" to "occurrence" in the translation box at the very end of
the section.
 Page 49, Section 4.3.4, Ambiguous Types...
In the third paragraph from the end of Section 4.3.4, replace "...an ambiguous
type variable is defaultable if at least one of its classes is a numeric class..."
by "...an ambiguous type variable, v, is defaultable if v appears only in constraints
of the form (C v), where C is a class, and if at least one of its classes is
a numeric class...".
The new phrase is "if v appears only in constraints of the
form (C v) where C is a class". Without this condition the rest of the
sentence does not make sense.
 [Apr 2001] Page 53, Section 4.3.3. Replace "For example, these two function
definitions are equivalent:", and the two lines of code that follow by:
"For example, these three function definitions are all equivalent:
plus x y z = x+y+z
x `plus` y = \ z > x+y+z
(x `plus` y) z = x+y+z
"
(This change makes explicit that an infix operator with more than two arguments
can have all of them on the LHS.)
 [Apr 2001] Page 54, Section 4.4.3, subsection Function Bindings.
In the first translation scheme ("The general binding form for functions..."),
the xn should be xk (suitably subscripted in both cases!),
and all three m subscripts should be n.
 Page 57, Section 4.5.3, Context reduction errors.
The example
f :: (Monad m, Eq (m a)) => a > m a > Bool
f x y = x == return y
is wrong; it should read
f x y = return x == y
 [May 2001] Page 62, Section 5, Modules.
In paragraph 4, add a footnote to the sentence "A multimodule Haskell
program can be converted into a singlemodule program by ...", namely:
"There are two minor exceptions to this statement.
First, default declarations scope over a single module (Section 4.3.4).
Second, Rule 2 of the monomorphism restriction (Section 4.5.5)
is affected by module boundaries."
This footnote qualifies the otherwise overstrong statement.
 Page 66, Section 5.3, Import Declarations, numbered item 2.
Start a new paragraph before the sentence "The hiding clause only applies to unqualified
names...".
 Page 67, Section 5.3.2, Local aliases.
The the last example in the section should read:
import Foo as A(f)
 Page 69, Section 5.5.2, Name clashes.
At the very end of the section, add the following clarification:
"The name occurring in a type signature or fixity declarations is always
unqualified, and unambiguously refers to another declaration in the
same declaration list (except that the fixity declaration for a class method
can occur at top level  Section 4.4.2). For example, the following
module is legal:
module F where
sin :: Float > Float
sin x = (x::Float)
f x = Prelude.sin (F.sin x)
The local declaration for sin is legal, even though
the Prelude function sin is implicitly in scope.
The references to
Prelude.sin and F.sin must both be qualified to make
it unambigous which sin is meant.
However, the unqualified name "sin" in the type
signature in the first line of F unambiguously refers to the
local declaration for sin."
 Page 71, Section 5.6.2, Shadowing Prelude Names.
Replace the example at the beginning of the section, and the entire
following paragraph, with the following
"
module A( null, nonNull ) where
import Prelude hiding( null )
null, nonNull :: Int > Bool
null x = x == 0
nonNull x = not (null x)
Module A redefines null, and contains an unqualified reference
to null on the right hand side of nonNull.
The latter would be ambiguous without the "hiding(null)" on the
"import Prelude" statement.
Every module that imports A unqualified, and then makes an unqualified
reference to null must also resolve the ambiguous use of null
just as A does. Thus there is little danger of accidentally shadowing
Prelude names."
 [May 2001] Page 74, Section 6.1.6, Tuples.
Replace the first paragraph of this section with:
"Tuples are algebraic datatypes with special syntax, as defined
in Section 3.8. Each tuple type has a single constructor.
All tuples are instances of Eq, Ord, Bounded, Read,
Show, and Ix (provided, of course, that all their component types are).
There is no upper bound on the size of a tuple, but some Haskell
implementations may restrict the size of tuples, and limit the
instances associated with larger tuples. However, every Haskell
implementation must support tuples up to size 15, together with their instances
for Eq, Ord, Bounded, Read,
Show, and Ix. The Prelude and
libraries define tuple functions such as zip for tuples up to a size
of 7."
 [Apr 2001] Page 74, Section 6.1.6, Function Types.
Delete the sentence "Functions are an instance of the Show class but not Read".
 [Apr 2001] Page 76, Section 6.3, Standard Haskell classes.
There is a formatting error in the example. There should be a new line
after "the declaration of Class Eq is:", and before the sentence beginning
"This declaration gives default method declarations...".
 [Apr 2001] Page 78, Section 6.3.3, The Read and Show Classes.
After "The Read and Show classes are used to convert values
to and from strings." add the sentence:
"The Int argument to showsPrec and readsPrec gives the operator
precedence of the enclosing context (see Appendix D.4)."
(Clarification only.)
 Page 80, Section 6.3.6, Class Monad.
Right at the bottom of the page, replace "However, for IO, the fail
method invokes error." by "For IO, the fail method raises a user
exception in the IO monad (see Section 7.3)."
 [Apr 2001] Page 84, Section 6.4, Fig 7; and bottom of page 86, Section 6.4.6.
fromRealFrac :: (RealFrac a, Fractional b) => a > b
should be replaced by
realToFrac :: (Real a, Fractional b) => a > b
 Page 90, Section 7.3, Exception handling in the IO monad.
After the first paragraph give the following type signature:
userError :: String > IOError
Also add an index entry for userError on this page.
(These changes are purely presentational.)
 [Apr 2001] Page 90, Section 7.3, Exception handling in the IO monad.
After the above signature for userError, add the following:
"The fail method of the IO instance of the Monad class (Section 6.3.6) raises a
userError, thus:
instance Monad IO where
...bindings for return, (>>=), (>>)
fail s = ioError (userError s)
"
 Page 94, Appendix A, Standard Prelude, class Enum.
After the default method for enumFromTo add
enumFromThen x y = map toEnum [fromEnum x, fromEnum y ..]
 [Apr 2001] Page 101, Appendix A, instance Monad IO.
Replace the definition of fail in instance Monad IO by
fail s = ioError (userError s)
 Page 102, Appendix A, comments immediately before
instance Enum Float.
Replace "1.0" by "0.95".
 [Apr 2001] Page 105, Appendix A.1, line 11.
In the module header for PreludeList replace "Sum" by "sum".
 Page 105, Appendix A.1 (PreludeList), line 19.
Correct the type of map to
map :: (a > b) > [a] > [b]
 Page 106, definition of (!!).
Replace the definition of (!!) with the following:
 List index (subscript) operator, 0origin
(!!) :: [a] > Int > a
xs !! n  n < 0 = error "Prelude.!!: negative index"
[] !! _ = error "Prelude.!!: index too large"
(x:_) !! 0 = x
(_:xs) !! n = xs !! (n1)
(The original version had the property that ([] !! 100)
reported "index too large".)
 [Apr 2001] Page 107, definition of scanl1 and scanr1.
Replace the definitions of scanl1 and scanr1 with these:
scanl :: (a > b > a) > a > [b] > [a]
scanl f q xs = q : (case xs of
[] > []
x:xs > scanl f (f q x) xs)
scanl1 :: (a > a > a) > [a] > [a]
scanl1 f (x:xs) = scanl f x xs
scanl1 _ [] = []
scanr1 :: (a > a > a) > [a] > [a]
scanr1 f [] = []
scanr1 f [x] = [x]
scanr1 f (x:xs) = f x q : qs
where qs@(q:_) = scanr1 f xs
The effect is to make both functions defined on the empty list.
 [Apr 2001] Page 108, definition of take, drop, and splitAt.
Replace the definitions of take, drop, and splitAt with these:
take :: Int > [a] > [a]
take n _  n <= 0 = []
take _ [] = []
take n (x:xs) = x : take (n1) xs
drop :: Int > [a] > [a]
drop n xs  n <= 0 = xs
drop _ [] = []
drop n (_:xs) = drop (n1) xs
splitAt :: Int > [a] > ([a],[a])
splitAt n xs = (take n xs, drop n xs)
The effect is that all three functions are defined on negative arguments. This
is a semantic change.
 [May 2001] Page 115, instances Show Int and Read Int.
Replace the instances for Show Int and Read Int with
instance Show Int where
showsPrec = showsPrec . toInteger
 Converting to Integer avoids
 possible difficulty with minInt
instance Read Int where
readsPrec p r = [(fromInteger i, t)  (i,t) < readsPrec p r]
 Reading at the Integer type avoids
 possible difficulty with minInt
The previous definitions (which are simply specifications, remember) failed on minInt.
 [May 2001] Page 132, Appendix D, Specification of Derived Instances.
In numbered item 3, replace
``(all constructors must by nullary)'' with
``(all constructors must be nullary)''.
 [June 2001] Page 134, Appendix D.4, Derived instances of Read and Show.
In the displayed equation starting fst (head (...)) == x, replace "r" by
the empty string, resulting in the following:
fst (head (readsPrec d (showsPrec d x ""))) == x
(The old, stronger, equation is simply false.)
 [Apr 2001] Page 141, Bibliograpy.
Citation [4] should read "JR Hindley".
 Page 141, Bibliograpy.
The library report citation [8] is out of date. It should read:
"Simon Peyton Jones and John Hughes (editors), Standard Libraries for the
Haskell 98 Programming Language, 1 February 1999".
 Page 147, Index. Remove the entry for "monad comprehension".
 [Apr 2001] Index of the Haskell 98 Prelude (HTML version only)
 Remove Eval as a superclass of Num
 Correct type of seq to seq :: a > b > b.
 Title page. Add the paragraph:
"Copyright (c) Simon Peyton Jones and John Hughes.
The authors intend this Report to belong to the entire Haskell
community, and so we grant permission to copy and
distribute it for any purpose, provided that it is
reproduced in its entireity, including this Notice. Modified
versions of this Report may also be copied and distributed for any purpose,
provided that the modified version is clearly presented as such,
and that it does not claim to be a definition of the Haskell 98 libraries."
 [Apr 2001] Page 5, Section 2.1, Library Ratio.
Replace the definition of recip on line 3 by the following
recip (x:%y) = y % x
The effect of this change is to use the "smart constructor", %, instead
doing it by hand. In particular, an error will be raised if y is zero.
 Page 17, Section 5, first text line. Replace "continuous" by "contiguous".
 [May 2001] Page 17, Section 5, Indexing operations.
Add the following equation to the laws listed just before Section 5.1:
map index (range (l,u)) == [0..rangeSize (l,u)]
This documents an invariant that was previously only implicit.
 [May 2001] Page 17, Section 5, Indexing operations.
This significant item (a) removes Ord from Ix's superclasses, and
(b) make rangeSize into a method of Ix rather than a freestanding declaration.
Though these changes are
visible to the programmer, all existing Haskell 98 programs will continue to work.
 Page 17, Section 5, Indexing operations, boxed text. Replace the Ix
change the class declaration, and the type signature for rangeSize with:
class Ix a where
range :: (a,a) > [a]
index :: (a,a) > a > Int
inRange :: (a,a) > a > Bool
rangeSize :: (a,a) > Int
 Section 5.2, pages 19, line 3. Replace the Ix
class declaration, and the rangeSize declaration, with:
class Ix a where
range :: (a,a) > [a]
index :: (a,a) > a > Int
inRange :: (a,a) > a > Bool
rangeSize :: (a,a) > Int
rangeSize b@(l,h)  null (range b) = 0
 otherwise = index b h + 1
 NB: replacing "null (range b)" by "not (l <= h)"
 fails if the bounds are tuples. For example,
 (1,2) <= (2,1)
 but the range is nevertheless empty
 range ((1,2),(2,1)) = []
(Note: the comment has changed too; it was misleading before.)
 [May 2001] Page 24, Section 6.6.
Add Eq a to the context for instance Eq (Array a b), thus:
instance (Ix a, Eq a, Eq b) => Eq (Array a b) ...
Similarly, add Ord a to the context for instance Ord (Array a b), thus:
instance (Ix a, Ord a, Ord b) => Ord (Array a b) ...
(Both consequences of removing Ord as a superclass of Ix.)
 Page 22, Section 6.3; and Page 23, Fig 3:
Replace "map" by "fmap" (two occurrences in 6.3, one in Fig 3).
 [May 2001] Page 23, Figure 3.
In the definition of diag, delete the guard `` l==l' && u==u'''.
(The original intent was presumably to check for a square array, but
simply makes the definition recursive and hence divergent.)
 Page 29, Section 7.2. Add a new bullet for nub.
Add an index entry for nub.
 Page 29, Section 7.2, second bullet.
Introduce a new bullet just before "union is list union".
 [May 2001] Page 30, Section 7.4, unfoldr.
Replace the first lineandahalf paragraph with:
"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:
iterate f == unfoldr (\x > Just (x, f x))
In some cases, unfoldr can undo a foldr operation:"
(Followed by the existing displayed equation.)
 [Apr 2001] Page 34, Section 7.8, Library List.
Replace the definition of partition by
partition :: (a > Bool) > [a] > ([a],[a])
partition p xs = (filter p xs, filter (not . p) xs)
This simply makes it agree with the definition on page 30 (Section 7.3).
 [Apr 2001] Page 35, Section 7.8.
Replace the definitions of maximumBy and minimumBy by the following
maximumBy :: (a > a > Ordering) > [a] > a
maximumBy cmp [] = error "List.maximumBy: empty list"
maximumBy cmp xs = foldl1 max xs
where
max x y = case cmp x y of
GT > x
_ > y
minimumBy :: (a > a > Ordering) > [a] > a
minimumBy cmp [] = error "List.minimumBy: empty list"
minimumBy cmp xs = foldl1 min xs
where
min x y = case cmp x y of
GT > y
_ > x
NOTE: this is a semantic change, but it makes the definitions
consistent with the other "By" functions, and with the signatures given on page 28.
 Page 54, Section 11.
The signature for try should be
try :: IO a > IO (Either IOError a)
 [May 2001] Page 57, Section 11.2.1 Semiclosed handles.
Replace the sentence "Once a semiclosed handle becomes closed..." with
"Once a semiclosed handle becomes closed, the contents of the
associated list becomes fixed. The contents of this final list is
only partially specified: it will contain at least all the items of
the stream that were evalutated prior to the handle becoming closed."
This change attempts to clarify the (murky) meaning of hGetContents followed by
hClose.
 [Apr 2001] Page 5658, Section 11.2, Files and Handles.
Add a section 11.2.3 to clarify the filelocking issue. It says:
"Implementations should enforce as far as possible, locally to the
Haskell process, multiplereader singlewriter locking on files.
That is, there may either be many handles on the same file which manage
input, or just one handle on the file which manages output. If any
open or semiclosed handle is managing a file for output, no new
handle can be allocated for that file. If any open or semiclosed
handle is managing a file for input, new handles can only be allocated
if they do not manage output. Whether two files are the same is
implementationdependent, but they should normally be the same if they
have the same absolute path name and neither has been renamed, for
example.
Warning: the readFile operation (Section 7.1 of the Haskell Language Report)
holds a semiclosed handle on the file until the entire contents of the file have been
consumed. It follows that an attempt to write to a file (using writeFile, for example)
that was earlier opened by readFile will usually result in
failure with isAlreadyInUseError."
 [May 2001] Page 59, Section 11.4.2.
Before "The buffer is emptied as soon as it has been written out." add:
"An implementation is free to flush the buffer more frequently, but not
less frequently, than
specified above." (Clarification only.)
 [May 2001] Page 59, Section 11.4.2.
In the second nobuffering bullet (sixth bullet in the subsection) add the
sentence: "The hLookAhead operation implies that
even a nobuffered handle may require a onecharacter buffer. " (Clarification only.)
 Page 62, Section 11.7.2.
 Add a new section heading "11.7.3 Reading the entire input"
just before the paragraph about hGetContents.

Add a new section heading "11.7.4 Text output" before the
paragraph about hPutChar.
 Page 63, definition of main in Section 11.8.1.
Replace the definition of "readNum" with
where readNum :: IO Integer
 Need a type signature for readLn to avoid ambiguity
readNum = readLn
(This change merely advertises the generally useful function readLn.)
 Page 64, Section 12, Directory functions.
(More an editor's blunder than a typo.)

Replace the abstract definition of Permissions, and the four instances
of Permissions with
data Permissions
= Permissions {
readable, writable, executable, searchable :: Bool
}
deriving ( Eq, Ord, Read, Show )
 Remove readable, writable, executable, searchable both from
the module header, and from the module body.
 Change Permissions to Permissions(readable, writable, executable, searchable)
in the module header.
 [Apr 2001] Page 78, Section 16, The CPUTime library.
Add cpuTimePrecision to the export list.
 [Apr 2001] Page 81, Section 17.1, The RandomGen class.
This sigificant semantic change adds a method genRange to the RandomGen
class. (Extensive discussion on the Haskell mailing list made it clear that this change
is essential to make the RandomGen class useful.) The following summarises the changes
but not in the detailed linebyline form used for the rest of the errata.
 Add a method genRange :: g > (Int,Int) to class RandomGen.
 Give it the default method genRange g = (minBound,maxBound)
 Add a specification of genRange
 Change the header on page 80 to match.
 [Apr 2001] Page 81, Section 17.1, The RandomGen class.
Specify more precisely that split must deliver independent generators.
 Page 81, Section 17.1, The RandomGen class.
Bottom line on page 81: replace "show/Read instances" with
"Show/Read instances" (i.e. capitalise Show).
 Page 83, Section 17.3, The global random number generator.
In the first paragraph, replace "kernal" by "kernel".