You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
What would you like to see?
As per arrow-kt/arrow-optics#5 which seems to have been lost when things were consolidated in this repo, with a sealed class of the following shape:
sealed class Example {
abstract val name: String
data class One(override val name: String, val int: Int) : Example()
data class Two(override val name: String, val long: Long) : Example()
data class Three(override val name: String, val double: Double) : Example()
}
I would love seeing a generated val name: Lens<Example, String>, which would look like this:
val name: Lens<Example, String> = Lens(
get = { it.name },
set = { example, name ->
when (example) {
is One -> example.copy(name = name)
is Two -> example.copy(name = name)
is Three -> example.copy(name = name)
}
},
)
This is a bit boilerplate-y, and needs updating whenever a sub-type is added. It seems like a good candidate for code generation.
The text was updated successfully, but these errors were encountered:
What version are you currently using?
1.1.3
What would you like to see?
As per arrow-kt/arrow-optics#5 which seems to have been lost when things were consolidated in this repo, with a sealed class of the following shape:
I would love seeing a generated
val name: Lens<Example, String>
, which would look like this:This is a bit boilerplate-y, and needs updating whenever a sub-type is added. It seems like a good candidate for code generation.
The text was updated successfully, but these errors were encountered: