If I'm fetching an array from a server, and need to find an element in the array before returning the result, I would expect that I could return Result<Option<Elem>>, but instead R.map(A.getBy(/*...*/)) fails to pass type-checks because R.map expects a non-nullable result from its parameter.
Am I misunderstanding how I'm supposed to be achieving this? Is there something wrong with having an Option inside a Result?
@alphashuro thanks for reporting this issue, I believe it's been already fixed in v4.0.0 (RC), please install it with the next tag (yarn add @mobily/ts-belt@next)
If I'm fetching an array from a server, and need to find an element in the array before returning the result, I would expect that I could return
Result<Option<Elem>>
, but insteadR.map(A.getBy(/*...*/))
fails to pass type-checks because R.map expects a non-nullable result from its parameter.Am I misunderstanding how I'm supposed to be achieving this? Is there something wrong with having an
Option
inside aResult
?