Fergus Henderson <[EMAIL PROTECTED]> writes:

> On 22-Feb-1999, Nick Kallen <[EMAIL PROTECTED]> wrote:
> > If this is true, then what I'm doing is horrible. But I don't see how this
> > leads to nondeterminism or broken referential transparency. min2 returns the
> > same value for the same list, but it's simply more efficient if we happen to
> > know some more information about the list.
> 
> In this particular case that happens to be so.  But it's not true in
> general.  What if the body of min2 were defined so that it returned
> something different in the two cases?  Your code has no proof that the
> code for the two cases is equivalent.  If it's not, then the behaviour
> would depend on whether the compiler could deduce that a particular
> argument had type Sorted or not.  And that in turn could depend on the
> amount of inlining etc. that the compiler does.

I would assume that any language with this feature would have a
precise specification of type inference sufficient to determine which
of the two cases was used.  Without such a specification, portable
programming with dependent types is impossible; programs would compile
under one "smart" compiler (which does more inference) and fail with a
type error on another.

Carl Witty
[EMAIL PROTECTED]


Reply via email to