From: Andreas R. <ros...@ps...> - 2001-10-12 14:32:35
|
Dave Berry wrote: > > At 18:51 08/10/2001, Andreas Rossberg wrote: > > IMHO abstype in > >its current form is simply broken. That is another reason why I would > >like to see it removed from the language -- or turned into a derived > >form: > > > > abstype t = conbind with dec end ---> > > local datatype t = conbind in type t = t dec end > > > >AFAICS, the only difference with the current definition would be that > >equality of t is transparent - but that is exactly what is required to > >avoid the current problems of non-principality and type structures not > >respecting equality. And it is a conservative change, not breaking any > >legal program (I think). > > It doesn't break any legal program, but it could break a library, Not in the sense that client code could violate invariants of the library, e.g. by enabling it to construct bogus values or turn library state inconsistent. It just gives clients one additional operation that does not have a useful meaning. So the effect is rather harmless, IMHO. The only danger is that newly written client code might accidently use polymorphic equality on the lib type, but you should double check all uses of equality anyway. Moreover, I believe there are very few libs around that still use abstype, and newly written code based on such libs will be even rarer. > and also render books obsolete. True, but when we speak about evolving the language this has to be taken care of anyway. - Andreas |