Nir
12/08/2020, 7:59 PMdata class State(val accumulator: Int, val index: Int)
The solution gets pretty ugly in places because mutating State is a pain. On the other hand, using var and doing mutation could very easily leave me with two State variables pointing at the same instance, and then I'd have surprising mutations. Nicer syntax (than copy) for "fake mutating" an immutable type like State would be helpful