map Both
inline fun <V, E, U> Result<V, E>.mapBoth(success: (V) -> U, failure: (E) -> U): U
Content copied to clipboard
Maps this Result to U by applying either the success function if this Result is Ok, or the failure function if this Result is an Err. Both of these functions must return the same type (U).
Elm: Result.Extra.mapBoth
Haskell: Data.Either.either