Proposal for stand-alone deriving declarations?

Brian Smith brianlsmith at gmail.com
Sun Oct 8 14:11:23 EDT 2006


On 10/8/06, Bjorn Bringert <bringert at 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
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://www.haskell.org/pipermail/haskell-prime/attachments/20061008/06cabd05/attachment.htm


More information about the Haskell-prime mailing list