I noticed by using Closure Compiler that a couple of functions from the Colors
library generated JS code that contained variable redeclarations.
I tested it further (not on 0.14 though) and got to this small function where the problem still occurs:
f :: Number → Number → Number
f s 0.0 = 1.0
f s' v' = s
where
s = s' + v'
Generates:
var f = function (v) {
return function (v1) {
var s = v;
if (v1 === 0.0) {
return 1.0;
};
var s = v + v1;
return s;
};
};
Renaming the s
function to anything else fixes the problem.
I was just wondering if anyone else is aware of this as I couldn’t find an open bug for it.