[m-dev.] Re: univ and functor/arg

Fergus Henderson fjh at cs.mu.oz.au
Fri May 2 14:19:41 AEST 1997


Tyson Richard DOWD, you wrote:
> 
> > Fergus wrote:
> >
> > [...]
> >
> > 		However, if you think of `univ' as conceptually defined
> > by
> > 
> > 	:- type univ == some [T] T.
> > 
> > then the current behaviour of functor/3 etc is correct.
> > I'm not sure if that conceptual definition of univ as an equivalence
> > type really makes any sense, but pragmatically it seems to work better,
> > so at least for the moment I think I will stick with the existing behaviour.
> 
> Given this, is the behaviour of type_ctor_and_args still correct?
> 
> 	% type_ctor_and_args(Type, TypeCtor, TypeArgs):
> 	%       True iff `TypeCtor' is a representation of the top-level
> 	%       type constructor for `Type', and `TypeArgs' is a list
> 	%       of the corresponding type arguments to `TypeCtor',
> 	%       and `TypeCtor' is not an equivalence type.

Nope.  When given a univ, the current implementation returns a representation
of the type constructor for univ, and so if we assume that univ is
conceptually defined as an equivalence type, the current implementation
does not match the specification.

The `mercury_compare_type_info()' function would also need to be changed.

-- 
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 developers mailing list