DEV Community

loading...

Discussion on: Why I don't believe in pure functional programming anymore

Collapse
maan2003 profile image
Maan2003 • Edited

You can modify an immutable data structure, you'll just end up with a modified copy of it instead of modifying the original, and THAT is what the immutability is about: not about making your life hard by making it cumbersome to modify a data structure, but by having you be very explicit about who gets to see and operate on that modified structure

collections are not language feature. So there are immutable collections in rust.

Collapse
maan2003 profile image
Maan2003

As soon as you modified a variable, everything you ever gave this variable to now implicitly has this modified version.

If you gave this variable to something, how can you mutate it? the variable has moved.
I tried my best