Original-Via: uk.ac.nsf; Sun, 10 Nov 91 18:58:02 GMT

I was originally going to stay out of this one, but here's why I'm
voting for explicit superclass declarations.

The problem I see is that allowing implicit class declarations is
bound to cause confusion when a user does not actually see an entity
which is part of the progam.  For example, consider

module A(T) where
data T =

instance Ord(T) where
   .....

module B where
import A

instance Eq(T) where
   .....


Here, the Eq instance in module B is in error since the Ord
declaration in A must implicitly declare Eq(T).  If the declaration in
A is made explicit, then the problem becomes much more obvious.  In
general, I feel that the syntactic presence of the instance
declaration is a good thing, especially since instances are not
referenced by name in import and export lists.  When an instance
conflicts with an automatically generated empty instance confusion is
bound to result.  Note that automatically generated methods in a class
cause no such problems.

      John





Reply via email to