4 ms·
Pure functional programming does require immutable data. There are lots of FP languages that aren't pure, though.
by munchler 4y ago
Pure functional programming does require immutable data. There are lots of FP languages that aren't pure, though.
- thinkharderdev 4y agoNo, it doesn't. Pure FP is about pure functions, meaning only that they don't have side-effects (essentially just that you could replace the function call with it's return value without changing the semantics of the program). If a function mutates some global state then that would certainly make it impure but a function which takes an input, mutates it and returns the mutated value is absolutely pure.