[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: 'deriving' in Haskell 'interface's



Original-Via: 
To: haskell@cs.glasgow.ac.uk
Subject: Re: 'deriving' in Haskell 'interface's 
Date: Mon, 22 Oct 90 11:28:14 +0100
From: Simon L Peyton Jones <simonpj@cs.glasgow.ac.uk>
Sender: haskell-request@cs.glasgow.ac.uk


| From: Kent Karlsson <kent@cs.chalmers.se>
| 
| 
| 		DERIVING IN INTERFACES
| 		======================
| 
| The report says on p. 42 that data declarations (where the
| constructors are exported...) that have derived instances should
| retain the 'deriving' part in the interface.
| 

Kent suggests using a pragma instead.  He didn't give the main 
reason for doing this, namely that "efficiency-improving" things shouldn't
be allowed to clutter the language itself; that is what pragmas are for.

I suggest that interfaces should be ALLOWED to use deriving clauses to
abbreviate the instance declarations, which may become quite bulky.

As things stand, nothing will go wrong with an implementation that
always uses separate instance decls in interfaces.


Kent also suggests some further annotations for instance declarations.
I think these should not be part of the language design, but part of
some "pragma supplement".  At Glasgow we are currently developing such
a supplement (which is non-mandatory, since pragmas are comments),
and we'll think further on Kent's suggestion.

(KEVIN: nota bene.)

Cheers

Simon