I just saw Option is deprecated as it is promoting...
# arrow
d
I just saw Option is deprecated as it is promoting bad coding style. However I'm curious are there really more downsides than upsides to make that decision. What's the experience with it? It was very useful for filterMap (what will the alternative be in this case?) and when using RxJava, where nu values are not allowed
s
For filterMap, you could use mapNotNull instead, correct?
d
Not exactly, as filterMap lets you to map the values you want by returning some(myNewValue) and filter away the others for which you return none()
Ah, I get your point... 😃
s
But yes, the RxJava issue remains. You’d have to create your own ‘wrapper’. They tried so solve some issue about Java not being having a null-safe type system… still, this decision caused more issues than it solved, in my opinion. Kotlin’s `Flow`s don’t have that issue… they can just emit null values.
k
Option will be moved into a separate library you cans till use it with RxJava.
👍 1
☝️ 4
g
You could create a typealias for
Either<Unit, T>
as discussed here https://github.com/arrow-kt/arrow-core/issues/114
d
Yeah, that's not a bad idea actually