Simon PJ wrote: 
> So, I now think that the existing rule (all class variables
> must appear in each class-operation type signature) is probably
> the right one, but on stylistic rather than technical grounds.

I feel very uneasy about this style of argument - a language 
designed this way becomes cluttered with all kinds of ad-hoc
restrictions.

It's ok for some compilers to have a warning that this may not be a
 very useful thing to do.  eg things like this

   Warning (Foo.hs, line 3) Exporting data constructor "Leaf"
     without exporting type constructor "Tree".

But I think it's a mistake to say you just aren't allowed to do it.


That said, Mark PJ then wrote:
> Even if you relaxed the restriction on ambiguously typed members in a
> class declaration, I don't think this definition of f would be accepted.
> [argument about principal types deleted]

This seems like a good basis on which to make language design
 decisions: we don't allow X because it doesn't make sense or because
 it conflicts with some other feature of the language.


Alastair


Reply via email to