Mittemuutuv
Mittemuutuv is the Estonian term for immutability, a property of data values or objects that cannot be altered after they are created. In practice, operations that would seem to modify a mittemuutuv value instead produce a new value with the requested changes while the original remains unchanged. This idea is central to many programming paradigms, especially functional programming, and is used to improve program reliability and predictability.
Key characteristics of mittemuutuv design include referential transparency, where expressions can be replaced by their values
- In many languages, strings are mittemuutuv by design; attempting to modify a string yields a new
- Functional languages such as Haskell, OCaml, and Clojure emphasize immutability as a default.
- In languages with mutable defaults, values can be made mittemuutuv via immutable APIs or by using
- Immutable data structures enable efficient copy-on-write and structural sharing, reducing the cost of creating modified versions.
Mittemuutuv design supports safer concurrency, easier caching and memoization, and clearer reasoning about program state. It
See also: referential transparency, persistent data structures, copy-on-write.