softwaremill/quicklens

Composing or extend PathModify[U,V]

omidb opened this issue · 1 comments

omidb commented

Is there any way to compose only PathModifies?

Something like following:

case class A(b:B)
case class B(c:C)
case class C(value:Int)
val a = A(B(C(0)))
val mod1 = a.modify(_.b)
val mod2 = mod1.somecomposefunction(_.c)
mod2.setTo(C(1))

I know that you can compose functions of U => PathModify[U, V] but I want to know if there is a way to compose PathModifys directly.

adamw commented

Currently, that's not possible. But of course possible to implement :)