On 10/8/06, Bjorn Bringert
<bringert@cs.chalmers.se> wrote:

I agree that "derive" would be nicer, but as you say, the problem is
that it would add a new keyword. Since the declaration would then
start with "derive", I don't that think it could easily be made into
a special identifier. A deriving declaration would look like this:

derive Eq Foo

which looks just like the beginning of a declaration of a function
called "derive" which does some pattern matching, if derive can also
be an identifier.

That is why I suggested "derive instance." Then the only ambiguity comes when "derive" is used as a name immediately before an instance declaration. which should be really, really rare. It's not 100% backward compatible but it is a better compromise than using "deriving."

Regards,
Brian