<https://www.reddit.com/r/androiddev/comments/8n7c...
# arrow-contributors
r
I’ve not spent much time with the optics in Arrow, but is it possible to compose lenses? Pseudocode, so usual warnings apply:
@optics data class Thing(str: String, num:Int)
val mark = Thing.str.modify( it + "!")
val inc = Thing.num.modify( it + 1)
val combinedLens = mark.pipe(inc)
p
Yes, all of them have a
compose
method and have a composition table and everything. That’s their main use case 😄 See https://arrow-kt.io/docs/optics/optional/#composition for example
🎉 1
etc