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
Alejandro Serrano.Mena
01/08/2024, 9:43 AM
unfortunately, right now there's no optic to access every field in the class
Alejandro Serrano.Mena
01/08/2024, 9:43 AM
this actually seems to be a perfect use case for reflection
k
kotlinforandroid
01/10/2024, 1:20 PM
Sadly, this requires
kotlin.reflection.full
, which is not available inside of commonMain. I wanted to write a KMP settings UI library 🙂