Hacker News new | ask | show | jobs
by hacker_9 3440 days ago
If I add a new member to a type, because of immutability, if I change the member it means I have to think about creating new instances all the way up the chain. And then in turn handling how that change propagates out. It makes for more hassle and time needed to make changes compared to just having mutable instances.
3 comments

Not quite sure what you're talking about but it sounds like you want lenses.

Mutability is definitely not less hassle or time if you account for the dramatic difference in error rates and maintenance costs.

If you add a new member to a type aren't you usually describing new behavior? Isn't it sensible to have to implement that behavior everywhere?
What language don't you have to do that in where not doing so also won't change behavior and result in an error?