Haskell Report Bugs, Version 1.4

Report any new bugs to John Peterson

Semantic Bugs

These bugs are numbered so that they may be referenced in messages and manuals. We won't be changing any of these numbers in the future. Proposed changes to the report are included when available. Prelude bugs that would pass through the typechecker are here; others are considered typos.

1. Qualified names in instance declarations

You ought to be able to use qualified names in the patterns for instance declarations, as in
instance Num Foo where
  x Prelude.+ y = ...
This is currently forbidden by the syntax. No concrete proposal for changing the report has been submitted yet.

2. Enum instances

The report never clearly states what [1..0] ought to be. The instance declarations for Float and Double define this as [], which is the intended behavior for all types. Aside from the toEnum and fromEnum methods, the Enuminstances for Int and Integer should be the same as those for Float

No concrete proposal has been submitted yet but the changes are simple: add instances for Int and Integer and a line or two clarifying the behavior.

3. Bug in the definition of span

The definition in the Prelude is wrong. It ought to be
span p []            = ([],[])
span p xs@(x:xs') 
            | p x       =  (x:ys,zs) 
            | otherwise =  ([],xs)
                           where (ys,zs) = span p xs'

4. Bug in the definition of Eq

The definition in the Prelude should have a default for == :
class  Eq a  where
    (==), (/=)       :: a -> a -> Bool

    x /= y           =  not (x == y)
    x == y           =  not (x /= y)

5. Unicode problems

Things are rather vague about the width of a unicode character with respect to the layout rule. Implementations probably assume each 16-bit value is of unit width.

6. Module Layout

On page 3, mention of the placement of keyword `module' in column 0 is not needed and can be removed. Strike the entire paragraph.

6. Lexical Syntax

The definition of non-breaking space has been added and it is now part of the whitechar production.

7. Instance Enum Char

The definition of enumFromThen is missing a map toEnum:
    enumFromThen c c' =  map toEnum [fromEnum c,
                                     fromEnum c' .. fromEnum lastChar]
                         where lastChar :: Char
                               lastChar | c' < c    = minBound
                                        | otherwise = maxBound

8. Missing parens in numericEnumFromToThen

numericEnumFromThenTo n n' m
			=  takeWhile (if n' >= n then (<= m) else (>= m))
				     (numericEnumFromThen n n')

9. Bug in definition of PreludeList.span

span p []               =  ([],[])
span p xs@(x:xs') 
            | p x       =  (x:ys,zs) 

            | otherwise =  ([],xs)
                           where (ys,zs) = span p xs'

10. Clarification of derived Text instances

Derived instances should not add unnecessary spaces. Since a formal description of the derived Show instances are not in the report this could perhaps be stated informally somewhere.

Typography Bugs

1. Spurious import on page 103

2. Strike Ord a as a superclass of Enum (p 70)

3. Bad Translation (p 47)

The x x1 x2 ... xk = case should be x = \x1 x2 ... xk -> case

4. Lexical syntax renamings

In the lexical syntax, the strings UNI and ASC have changed to uni and asc: UNIspace is now uniSpace and so on.

5. Repeated definition of constr (page 116)

6. Unused defintion of fbinds (page 118)

7. Typo in comments before "any", "lookup" in PreludeList

8. Typo in "lex": isAlphanum should be isAlphaNum

9. Typo in "instance Show Float" and "instance Show Double": needs parameter p

10. Bug in "instance Read Char"

Should be:
    readsPrec p      = readParen False
                            (\r -> [(c,t) | ('\'':s,t)<- lex r,
                                            (c,"\'")  <- readLitChar s])

11. Obsolete use of readLine

All references to readLine on page 79 should be to readLn.

12. Missing subscripts (p 24)

The superscript C to pick in the first box needs a subscript.

13. Minor wording change (p 21)

Changed ok is not free in s to ok is a fresh identifier.

14. Minor wording change (p 24)

Removed reference to `hidden constructors'. New text:
The
constructors @C1'@ and @C2'@ are constructors defined by the
translation in Section \ref{datatype-decls}.

15. Page 20, last line but one: `expr' should be `exp'.