Alex Ferguson <[EMAIL PROTECTED]> wrote:
> Joe English:
> > How about leaving the 'a = b' binding form as it is,
> > (monomorphism restriction and all) and using 'a = ~ b'
> > to indicate call-by-name. [...]

> I like that much less [...]  because I consider it
> (still) to be the wrong 'default'.

> > 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.
>
> I dispute that there's anything 'operationally out-of-the-ordinary'
> about an overloaded function definition, which is almost invariably
> what the MR is (silently) complaining at me for doing when I fall
> over it.  It's only out-of-the-ordinary if you were depending on
> it being operationally a CAF, so having some sort of special CAF
> syntax seems reasonable to me.

I was thinking of the example from the Haskell Report:

    let { len = genericLength xs } in (len, len)

which, without the MR, computes 'len' twice.
Operationally I expect that in "let x = f y in ... x ... x",
'f y' is only evaluated once, no matter what type it is.

Also John Hughes' warning that:

> * When converting Haskell 1.x to Haskell 2, many := would need to be inserted.
>   Failure to do so could make programs much less efficient.

That's why I'd prefer to keep call-by-need the default
and use new syntax for call-by-name/overloading.


> This way bizarre type errors remain the default, and compilers
> will signal an error _somewhere else_ in the program when you
> bump into the MR, if my experience is anything to go by.

Could you provide an example?  Every instance of the MR
I've been able to come up with winds up giving an error message
right at the definition that would need to have a ~ or an
explicit type signature added.


--Joe English

  [EMAIL PROTECTED]


Reply via email to