diff --git a/kotlin-result/src/commonMain/kotlin/com/github/michaelbull/result/Iterable.kt b/kotlin-result/src/commonMain/kotlin/com/github/michaelbull/result/Iterable.kt index ad484b3..c68d950 100644 --- a/kotlin-result/src/commonMain/kotlin/com/github/michaelbull/result/Iterable.kt +++ b/kotlin-result/src/commonMain/kotlin/com/github/michaelbull/result/Iterable.kt @@ -169,8 +169,12 @@ public fun > getAll(vararg results: R): List { * * - Haskell: [Data.Either.lefts](https://hackage.haskell.org/package/base-4.10.0.0/docs/Data-Either.html#v:lefts) */ +@Deprecated( + message = "Use filterValues instead", + replaceWith = ReplaceWith("filterValues()") +) public fun Iterable>.getAll(): List { - return filterIsInstance>().map { it.value } + return filterValues() } /** @@ -189,8 +193,12 @@ public fun > getAllErrors(vararg results: R): List { * * - Haskell: [Data.Either.rights](https://hackage.haskell.org/package/base-4.10.0.0/docs/Data-Either.html#v:rights) */ +@Deprecated( + message = "Use filterErrors instead", + replaceWith = ReplaceWith("filterErrors()") +) public fun Iterable>.getAllErrors(): List { - return filterIsInstance>().map { it.error } + return filterErrors() } /**