mapAll method
user753 opened this issue · 1 comments
user753 commented
I would like to convert ok
to err
and err
to ok
mapAll(fn: (x: Result) => Result)
x.mapAll(x => x.isOk() && x.value == 1 ? err("x == 1") : x)
x.mapAll(x => x.isErr() && x.error == "error" ? ok(1) : x)
supermacro commented
Why not .orElse
or .andThen
?