10 Sep
2005
10 Sep
'05
4:18 p.m.
On Sat, Sep 10, 2005 at 03:18:16PM -0000, fool@sdf-eu.org wrote:
I previously thought that rewriting
let <a> = <b> <c> = <d> in <e>
as
let (<a>,<c>) = (<b>,<d>) in <e>
is harmless, but section 3.12 of the Report says different.
Yes, you'd have to write it as let (~<a>,~<c>) = (<b>,<d>) in <e>
I still don't understand why
main = print (let (x,(q,_)) = (1,divMod x x) in q)
and
main = print (let (x,(q,_)) = (1,divmod x x) in q) divmod x y = (div x y,mod x y)
behave differently.
In both cases, to for x is to ask for the rhs to be reduced to the form (<a>,(<b>,<c>)). In the former case this can't be done without knowing the value of x; in the latter it can.