-
Notifications
You must be signed in to change notification settings - Fork 449
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Revert "catch for EffectScope (#2746)"
This reverts commit 0c50804.
- Loading branch information
Showing
9 changed files
with
16 additions
and
251 deletions.
There are no files selected for viewing
Large diffs are not rendered by default.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
18 changes: 7 additions & 11 deletions
18
arrow-libs/core/arrow-core/src/jvmTest/kotlin/examples/example-eager-effect-scope-08.kt
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,20 +1,16 @@ | ||
// This file was automatically generated from EagerEffectScope.kt by Knit tool. Do not edit. | ||
package arrow.core.examples.exampleEagerEffectScope08 | ||
|
||
import arrow.core.Either | ||
import arrow.core.None | ||
import arrow.core.Option | ||
import arrow.core.Validated | ||
import arrow.core.continuations.eagerEffect | ||
import io.kotest.assertions.fail | ||
import arrow.core.continuations.ensureNotNull | ||
import arrow.core.left | ||
import arrow.core.right | ||
import io.kotest.matchers.shouldBe | ||
|
||
fun main() { | ||
val failure = "failed" | ||
val int: Int? = null | ||
eagerEffect<String, Int> { | ||
val x = Either.Right(1).bind() | ||
val y = Validated.Valid(2).bind() | ||
val z = | ||
attempt { None.bind { "Option was empty" } } catch { 0 } | ||
x + y + z | ||
}.fold({ fail("Shift can never be the result") }, { it shouldBe 3 }) | ||
ensureNotNull(int) { failure } | ||
}.toEither() shouldBe (int?.right() ?: failure.left()) | ||
} |
16 changes: 0 additions & 16 deletions
16
arrow-libs/core/arrow-core/src/jvmTest/kotlin/examples/example-eager-effect-scope-09.kt
This file was deleted.
Oops, something went wrong.
18 changes: 7 additions & 11 deletions
18
arrow-libs/core/arrow-core/src/jvmTest/kotlin/examples/example-effect-scope-09.kt
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,20 +1,16 @@ | ||
// This file was automatically generated from EffectScope.kt by Knit tool. Do not edit. | ||
package arrow.core.examples.exampleEffectScope09 | ||
|
||
import arrow.core.Either | ||
import arrow.core.None | ||
import arrow.core.Option | ||
import arrow.core.Validated | ||
import arrow.core.continuations.effect | ||
import io.kotest.assertions.fail | ||
import arrow.core.continuations.ensureNotNull | ||
import arrow.core.left | ||
import arrow.core.right | ||
import io.kotest.matchers.shouldBe | ||
|
||
suspend fun main() { | ||
val failure = "failed" | ||
val int: Int? = null | ||
effect<String, Int> { | ||
val x = Either.Right(1).bind() | ||
val y = Validated.Valid(2).bind() | ||
val z = | ||
attempt { None.bind { "Option was empty" } } catch { 0 } | ||
x + y + z | ||
}.fold({ fail("Shift can never be the result") }, { it shouldBe 3 }) | ||
ensureNotNull(int) { failure } | ||
}.toEither() shouldBe (int?.right() ?: failure.left()) | ||
} |
16 changes: 0 additions & 16 deletions
16
arrow-libs/core/arrow-core/src/jvmTest/kotlin/examples/example-effect-scope-10.kt
This file was deleted.
Oops, something went wrong.