dimsuz
08/01/2022, 3:27 PMval lens1: Lens<S, A>
val lens2: Lens<S, B>
how do I apply them one after another to change field A
then change field B
and return S
?
fun modify(s: S): S {
return lens1.modify { a.doStuff() } ?? lens2.modify { b.doStuff() }
}
i.e. I want not to compose them but to sequence them.simon.vergauwen
08/01/2022, 6:34 PMdimsuz
08/01/2022, 9:07 PMcopy
in this PR looks like haskell's do
🙂simon.vergauwen
08/01/2022, 9:09 PMvar
in the underlying impl and applies the transformations in sequence