Skip to content

Commit e2a771d

Browse files
authored
Remove references to shift in Either.kt (#3105)
1 parent 9286176 commit e2a771d

File tree

3 files changed

+4
-4
lines changed

3 files changed

+4
-4
lines changed

arrow-libs/core/arrow-core/src/commonMain/kotlin/arrow/core/Either.kt

+2-2
Original file line numberDiff line numberDiff line change
@@ -2428,7 +2428,7 @@ public fun <E> E.leftNel(): EitherNel<E, Nothing> =
24282428
*
24292429
* fun test() {
24302430
* val error: Either<String, Int> = Either.Left("error")
2431-
* val listOfErrors: Either<List<Char>, Int> = error.recover { shift(it.toList()) }
2431+
* val listOfErrors: Either<List<Char>, Int> = error.recover { raise(it.toList()) }
24322432
* listOfErrors shouldBe Either.Left(listOf('e', 'r', 'r', 'o', 'r'))
24332433
* }
24342434
* ```
@@ -2459,7 +2459,7 @@ public inline fun <E, EE, A> Either<E, A>.recover(@BuilderInference recover: Rai
24592459
* val left: Either<Throwable, Int> = Either.catch { throw RuntimeException("Boom!") }
24602460
*
24612461
* val caught: Either<Nothing, Int> = left.catch { _: RuntimeException -> 1 }
2462-
* val failure: Either<String, Int> = left.catch { _: RuntimeException -> shift("failure") }
2462+
* val failure: Either<String, Int> = left.catch { _: RuntimeException -> raise("failure") }
24632463
*
24642464
* shouldThrowUnit<RuntimeException> {
24652465
* val caught2: Either<Nothing, Int> = left.catch { _: IllegalStateException -> 1 }

arrow-libs/core/arrow-core/src/jvmTest/kotlin/examples/example-either-46.kt

+1-1
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,6 @@ import io.kotest.matchers.shouldBe
77

88
fun test() {
99
val error: Either<String, Int> = Either.Left("error")
10-
val listOfErrors: Either<List<Char>, Int> = error.recover { shift(it.toList()) }
10+
val listOfErrors: Either<List<Char>, Int> = error.recover { raise(it.toList()) }
1111
listOfErrors shouldBe Either.Left(listOf('e', 'r', 'r', 'o', 'r'))
1212
}

arrow-libs/core/arrow-core/src/jvmTest/kotlin/examples/example-either-47.kt

+1-1
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@ fun test() {
1010
val left: Either<Throwable, Int> = Either.catch { throw RuntimeException("Boom!") }
1111

1212
val caught: Either<Nothing, Int> = left.catch { _: RuntimeException -> 1 }
13-
val failure: Either<String, Int> = left.catch { _: RuntimeException -> shift("failure") }
13+
val failure: Either<String, Int> = left.catch { _: RuntimeException -> raise("failure") }
1414

1515
shouldThrowUnit<RuntimeException> {
1616
val caught2: Either<Nothing, Int> = left.catch { _: IllegalStateException -> 1 }

0 commit comments

Comments
 (0)