Hacker News new | ask | show | jobs
by jw- 3731 days ago
The problem doesn't really have anything to do with immutability; the problem is dependency and composition. E.g.

f :: A -> B

g :: B -> C

will let me write g(f(x)), but not f(g(x)). It does not matter if f and g are 'pure', the point is that f must come before g. I think the mistake is to think that functional programming is about immutability, and that immutability solves the problems. Immutability is there to keep the types honest, it is fine to have effects aslong as we are upfront about them, and don't conceal them under false names such as "int" and "bool".