4 ms·
How would a functional language compiler deal with this case? like GHC?
by ww2 13y ago
How would a functional language compiler deal with this case? like GHC?
- skrebbel 13y agoYou could try it out!
- pascal_cuoq 13y 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.