John Hughes <[EMAIL PROTECTED]> wrote:
>
> Everybody agrees the monomorphism restriction is a pain:
> [...]
> So, let's make it visible, in the simplest possible way. Let there be TWO
> forms of binding: x = e, and x := e (say). A binding of the form `x = e' is
> interpreted using call-by-name, and may of course be overloaded: it makes `x'
> and `e' exactly equivalent. A binding of the form `x := e' is interpreted
> using call-by-need, and is monomorphic; `x' behaves as though it were
> lambda-bound.
>

This is a good idea, except for the use of ':='.
I'd hate to lose that symbol from the programmers' namespace
just to solve the MR problem.  (Am I the only one who's
never been bitten by the MR restriction?)

How about leaving the 'a = b' binding form as it is,
(monomorphism restriction and all) and using 'a = ~ b'
to indicate call-by-name.  '~' is already a reserved
symbol, and it can't currently appear on the RHS of
a binding, so this new syntax would't break any existing
programs.

This way call-by-need remains the default, and compilers
will still signal an error if the programmer accidentally
bumps into the MR.  If this happens you only need to
twiddle the code to fix it.  For people reading the code,
a ~ on the RHS of a binding is a signal that something
out-of-the-ordinary is going on operationally, the same as
when it appears on the LHS.


--Joe English

  [EMAIL PROTECTED]


Reply via email to