[m-dev.] Re: for review: big rats

Peter Schachte pets at students.cs.mu.OZ.AU
Fri Apr 10 12:43:25 AEST 1998

On Fri, 10 Apr 1998, Fergus Henderson wrote:

> > This is interesting:  there are actually two potential problems with types: 
> > 1) when the type is not canonical (two distinct objects represent the same
> > value), and 2) when the type is not total (some instances of the type are
> > not admissible).  Unfortunately, 'where equality is ...' only solves the
> > first problem.
> What exactly is the problem in case (2)?

Oh, just the usual:  sometimes regular types don't fully specify what is and
isn't a term of the /intended/ type.  Eg, the sets-as-sorted-lists type. 
The algorithms go badly wrong if the lists aren't sorted, but the language
gives no support for ensuring that they are (other than to insert tests
wherever terms of that type are used, and that's not usually very
practical).  Basically, you just have to be careful.

> But it seems to me that in practice you can get along OK
> without any additional language support for this case.

Of course.  But then in practice you can get along with assembly langauge
if you have to ;-).

-Peter Schachte               | I disapprove of what you say, but I will
mailto:pets at cs.mu.OZ.AU       | defend to the death your right to say it.
http://www.cs.mu.oz.au/~pets/ |     -- Voltaire 
PGP: finger pets at | 

More information about the developers mailing list