3 ms·
One such example is the Scala List data structure. It's fundamentally a linked list but the built in routines for Lists such as zip, reduceLeft, map make it eas
by deepGem 10y ago
One such example is the Scala List data structure. It's fundamentally a linked list but the built in routines for Lists such as zip, reduceLeft, map make it easier to transform List elements. By easier I mean, you write less code to do the same task as compared to an imperative program such as Java and without side effects.
- eudox 10y agoIn that case, though, the immutability is a property of the operations rather than the data. And you can have mutating versions of most of those operations that alter the data they are working on, e.g. a mutating map.