5 ms·
How would a functional language compiler deal with this case? like GHC?
by ww2 12y ago
How would a functional language compiler deal with this case? like GHC?
- skrebbel 12y agoYou could try it out!
- pascal_cuoq 12y agoIt doesn't. If we forget about FPU flags, floating-point multiplication is pure. That does not change anything to the fact that a * (b * c) is different from (a * b) * c. The problem is not side-effects in multiplication. The problem is that * is not associative.