[mercury-users] Type inheritance?

Fergus Henderson fjh at cs.mu.oz.au
Wed Sep 24 16:38:57 AEST 1997


Bart Demoen wrote:
> 
> Lee wrote:
> 
> > The implementation of your carefully designed 234 tree data type can
> > be affected by some far off declaration which includes it in union
> 
> There is probably no need for this long-range effect. It is the module that
> defines and uses the union type that is going to pay a price, not the
> others.

If you go for that approach, you get an effect that is IMHO
significantly worse: now your implicit type conversions are O(N).
For example, consider what happens when you convert a `list(tree234)'
to a `list(some_union_type)'.

This really plays havoc with any attempt to give your language a simple
performance model.

-- 
Fergus Henderson <fjh at cs.mu.oz.au>   |  "I have always known that the pursuit
WWW: <http://www.cs.mu.oz.au/~fjh>   |  of excellence is a lethal habit"
PGP: finger fjh at 128.250.37.3         |     -- the last words of T. S. Garp.



More information about the users mailing list