Haskell 98 report; D Specification of Derived Instances

Olaf Chitil olaf@cs.york.ac.uk
Mon, 28 Jan 2002 16:17:02 +0000


Just before Section D.1 there is the sentence

When inferring the context for the derived instances, type synonyms must
be expanded out first. 

I don't understand it. Which type synonyms need expansion? All the u_n
are type variables.
Besides, this would make deriving even more horrible than it is. It
would require knowledge about type synonyms. I thought that it should be
possible to derive instances, only knowing the type definition with its
deriving clause.

Furthermore the next sentence in D reads:

Free names in the declarations d are all defined in the
Prelude; the qualifier `Prelude.' is implicit here.

Well, `Prelude' does not necessarily refer to the builtin prelude. I
suppose the sentence should actually be the same as the statement at the
beginning of Chapter 3 (Expressions).

Naturally this makes clear that it is actually impossible to correctly
build a tool like DrIft. There is no safe way in Haskell to refer to the
builtin prelude...

Ciao,
Olaf

-- 
OLAF CHITIL, 
 Dept. of Computer Science, The University of York, York YO10 5DD, UK. 
 URL: http://www.cs.york.ac.uk/~olaf/
 Tel: +44 1904 434756; Fax: +44 1904 432767