Can I use lenses to iterate over all properties of...
# arrow
k
Can I use lenses to iterate over all properties of data classes? Basically as a replacement for reflection at runtime? My use-case is a data class that represents user settings loaded from plugins. I want to iterate over the fields of said class and generate a compose settings UI from it dynamically.
a
unfortunately, right now there's no optic to access every field in the class
this actually seems to be a perfect use case for reflection
k
Sadly, this requires
kotlin.reflection.full
, which is not available inside of commonMain. I wanted to write a KMP settings UI library 🙂
a