christophsturm
04/27/2022, 1:15 PMsimon.vergauwen
04/27/2022, 2:36 PMcopy
twice.simon.vergauwen
04/27/2022, 2:36 PMsimon.vergauwen
04/28/2022, 4:20 PMchristophsturm
04/28/2022, 5:15 PMsimon.vergauwen
04/29/2022, 8:07 AMcopy
twice. The only other way is to write a custom Optic, or to use modify
+ copy
.
For example:
Employee.company.address.street.name
.aside(Employee.company.address.street.number)
.modify(json) { Pair("", 5) }
Employee.company.address.street.modify(json) {
it.copy(name = "", number = 5)
}
simon.vergauwen
04/29/2022, 8:08 AMcopy
can still give you the benefit without having to write a custom Optic.
Not that it only works if you are "focusing" on a data class.christophsturm
05/06/2022, 1:21 PMmodify
+ copy
is really useful, thanks!