diff --git a/src/main/kotlin/com/mikebull94/result/Map.kt b/src/main/kotlin/com/mikebull94/result/Map.kt index 856e225..5042639 100644 --- a/src/main/kotlin/com/mikebull94/result/Map.kt +++ b/src/main/kotlin/com/mikebull94/result/Map.kt @@ -17,7 +17,7 @@ infix inline fun Result.map(transform: (V) -> U): Result { * - Haskell: [Data.Bifunctor.right](https://hackage.haskell.org/package/base-4.10.0.0/docs/Data-Bifunctor.html#v:second) * - Rust: [Result.map_err](https://doc.rust-lang.org/std/result/enum.Result.html#method.map_err) */ -infix inline fun Result.mapError(transform: (E) -> U): Result { +infix inline fun Result.mapError(transform: (E) -> F): Result { return when (this) { is Ok -> ok(value) is Error -> err(transform(error))