There is no such function at the moment, but such a contribution would be welcomed!
Arrow however does not recommend using Option unless absolutely necessary. The only use-case being nested nulls, which is the limitation for ReactiveX implementation of RxJava & Project Reactor. Both libraries don't allow null being used for their generic value A in Flowable, Flux, Mono, etc.
Analogue, you cannot use null as an empty signal for generic code in Kotlin. Unless A is constraint to be non-null by using A : Any.
Only in both cases should you use Arrow's Option, otherwise using Kotlin's nullable type is recommended by the Arrow maintainers.
There is no such function at the moment, but such a contribution would be welcomed!
Arrow however does not recommend using
Optionunless absolutely necessary. The only use-case being nested nulls, which is the limitation for ReactiveX implementation of RxJava & Project Reactor. Both libraries don't allownullbeing used for their generic valueAinFlowable,Flux,Mono, etc.Analogue, you cannot use
nullas an empty signal for generic code in Kotlin. UnlessAis constraint to be non-null by usingA : Any.Only in both cases should you use Arrow's Option, otherwise using Kotlin's nullable type is recommended by the Arrow maintainers.