Implict parameters and monomorphism

Erik Meijer erik@meijcrosoft.com
Wed, 2 May 2001 17:57:34 -0700


> [...many lines deleted...]
> I think it's important to have a simple model of how many times
expressions
> are evaluated. Function bodies are clearly evaluated many times, once for
each
> call, but non-function bindings should be evaluated at most once to
respect
> call-by-need semantics. Breaking the monomorphism restriction in ANY case
> makes both space and time cost of evaluation unpredictable, and brittle
when
> program changes elsewhere introduce or remove an implicit parameter. It
isn't
> good enough to say `the chances are' that a program has, for example,
linear
> time and constant space complexity: the programmer should be able to
convince
> himself of such properties.

But a term with an "implicit" argument is a function no matter how you turn
it, you just don't write the argument explicitely.

> As far as what one would `expect', it's in the very nature of dynamic
binding
> that it makes the meaning of an expression depend on its context. I for
one
> would certainly not expect that inlining a definition bound to such an
> expression should preserve its meaning! Inlining changes the context, so
> `of course' can change the meaning. So I strongly prefer (B)!
>
> John Hughes
>
> _______________________________________________
> Haskell mailing list
> Haskell@haskell.org
> http://www.haskell.org/mailman/listinfo/haskell