every time I assign the object back to a copy of i...
# getting-started
o
every time I assign the object back to a copy of itself with the changed fields?
b
Sounds like an optics library would do the trick - see Arrow & Arrow Optics. (I am not sure how production-ready those tools are, though.)
o
you sure you got what I mean?
how do I avoid having to do
object.field2 = value
ah, you are right, thank you
lol @ this NASA wording, wtf
Prism
 is a lossless invertible optic that can see into a structure and optionally find its focus.
too fancy, pass
d
Hmhm, can you give us a more detailed example? I don't understand currently. Do you want to have immutable fields (then best look into the
copy()
of data classes) or do you want fields to appear immutable to the outside but change them from inside the class?
👆 1