docs.scala-lang
docs.scala-lang copied to clipboard
clarify wording on pure-functions overview to allow immutable hidden state, and add an example
Updates the "pure functions" overview at https://docs.scala-lang.org/scala3/book/fp-pure-functions.html
- adds clarification that accessing immutable hidden state is still considered pure
- adds an example of this in form of a closure
there are still some typos, sorry, marking it as draft until they are fixed