Fudge
06/21/2020, 5:16 PMdata class X(val name : String)
data class Y(val x1: X, x2: X, x3 :X, x4: X)
Is there an easy way to change the name
value of all ocurrences of X
instances in Y
? Using optics perhaps?
Something like this:
val y = Y(...)
val newY = changeAllNames(y) {it + "foo"}
raulraja
06/21/2020, 5:27 PMX.run {
(x1 compose x2 compose...).modify(..) { s ->
s.toUpperCase()
}
}