Wow, I'm trying to write camera control code for A...
# arrow
m
Wow, I'm trying to write camera control code for Android in a functional style...but using Optics/Lenses is hard without running into name clashes/ambiguities 😛
s
What kind of issues are you running into?
m
Not a serious issue really, just funny ones. Is a CameraStateLens a functional Lens for the state of a camera? Or is it an object describing something about the state of the physical lens of the camera?
😄 5
f
I have yet to dive into optics... mostly because I struggle to find a use case for them in Kotlin where I can hide and safely call get, copy etc on immutable data classes... can anyone elaborate on on what the benefits are aside from learning optics? (learning is always good!)
s
there is a good example in the Arrow docs...
copy
has a lot of boilerplate for nested data types.... lenses on the other hand compose really well https://arrow-kt.io/docs/optics/lens/