3 ms·
This is not true at all. That's the whole point of functional data structures: they prevent copying for doing work on immutable data.
by hellofunk 9y ago
This is not true at all. That's the whole point of functional data structures: they prevent copying for doing work on immutable data.
- sidlls 9y agoIf you need a writable version of the data a copy must be made. Now, you might argue such needs ought not arise. In practice, due to resource constraints, however, they often do.
- hellofunk 9y agoThat is not how functional data structures work. Check out Okasaki's book "Purely functional data structures" if you want to know what we are talking about here. There is not a whole copy of data being made. They use structural sharing and there is almost never a need for the implementation to make a data copy. You can have a piece of data that "changes" as it passes through the data flow, but in reality very tiny changes are actually happening behind the scenes, even if the perception to the programmer is that large changes are happening.
- sidlls 9y agoI know what you're talking about. I simply disagree with you. Not about "purely functional data structures", but about implementation details and how computation occurs in actual practice, in the context of their use.
- hellofunk 9y agoThe reason you disagree about implementation details is because you do not understand the implementations.