From eb4aecaab87b71a9e23234caa2befb17ae1806a4 Mon Sep 17 00:00:00 2001 From: Michael Bull Date: Sat, 21 Oct 2017 18:52:14 +0100 Subject: [PATCH] Correct generic type identifier on mapError --- src/main/kotlin/com/mikebull94/result/Map.kt | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) 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))