Immutability
November 4, 2020 ยท View on GitHub
The Concept
The concept in which a value cannot be changed after having been created. The values are sometimes also referred to as constant or read-only values.
What to cover
- Explain what immutability is Short explanation of what immutability is, including some of its benefits.
- How can things be made immutable? Are there special keywords? Restrictions?
- Is immutability the default? Are things mutable or immutable by default?
Exercises
Lasagna cooking
This exercise deals with cooking a lasagna dish in the oven. The reference implementation (F#) teaches:
- What immutability is and some of its benefits
- How to define an immutable value
Implementations
| Track | Exercise | Changes |
|---|---|---|
| F# | lucians-luscious-lasagna | None |
| Scala | [basics][implementation-scala] | None |