X-Comment1: #############################################################
X-Comment2: # uk.ac.glasgow.cs has changed to uk.ac.glasgow.dcs #
X-Comment3: # If this address does not work please ask your mail #
X-Comment4: # administrator to update your NRS & mailer tables. #
X-Comment5: #############################################################
Folks
Here's a clarification to add to your V1.1 Haskell Report. On page
38, Section 4.5.4, second-last line, just after "generalised",
add the clause
"in the generalisation step for that group"
[Will: can you add this to the errata sheet.]
You need only read the rest of this if you are interested in the
Dreaded Monomorphism Restriction.
The modification is intended to clear up an ambiguity I hadn't thought of.
Consider
f x = x + y where y = factorial 10000
The declaration of y is "restricted" (in the sense defined in 4.5.4), and
hence, y's type is not polymorphic. But the declaration of f is not
restricted, so Rule 1 does not affect the generalisation of f. So f
has the polymorphic type
forall a. Num a => a -> a
(It is just possible to interpret the unmodified report as saying that
f should be monomorphic too, which isn't the intention at all!)
Simon