i´m trying Arrow Optics, and i have a nullable field, but I can´t modify it with a null value, I have to make the field
Option<S>
Since we are kotlin syntax friends, i wonder if isn´t possible to set/modify nullable types
s
simon.vergauwen
10/17/2022, 5:28 AM
Good morning @carbaj0,
Could you share a snippet of your domain?
c
carbaj0
10/17/2022, 7:06 AM
Copy code
@optics
data class Test(
val other: Option<String> = None
) {
companion object
}
@optics
data class Test2(
val other: String? = null
) {
companion object
}
fun main() {
val test2 = Test2()
Test2.other.modify(test2) { null } -> not compile
val test = Test()
Test.other.modify(test) { None }
}