Skip to content
This repository has been archived by the owner on Feb 24, 2021. It is now read-only.

Commit

Permalink
Removed (almost) all Try examples in documentation/comment blocks (#69)
Browse files Browse the repository at this point in the history
* Remove Try from fx in documentation/comment blocks

Co-authored-by: Alberto Ballano <aballano@users.noreply.github.com>
  • Loading branch information
danimontoya and aballano authored Mar 3, 2020
1 parent 1636d27 commit 129b8ad
Show file tree
Hide file tree
Showing 3 changed files with 15 additions and 11 deletions.
10 changes: 5 additions & 5 deletions arrow-docs/docs/fx/polymorphism/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -85,16 +85,16 @@ fun main() {
}
```

*Fx over `Try`*
*Fx over `Either`*
```kotlin:ank:playground
import arrow.core.Try
import arrow.core.Either
import arrow.core.extensions.fx
//sampleStart
val result =
Try.fx {
val (one) = Try { 1 }
val (two) = Try { one + one }
Either.fx<Throwable, Int> {
val (one) = Either.right(1)
val (two) = Either.right(one + one)
two
}
//sampleEnd
Expand Down
6 changes: 3 additions & 3 deletions arrow-docs/docs/integrations/reactor/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -154,14 +154,14 @@ fun main() {
```

```kotlin:ank:fail
import arrow.core.Try
import arrow.fx.IO
// This will result in a stack overflow
Try {
IO {
MonoK.monad().fx.monad {
(1..50000).fold(just(0)) { acc: Kind<ForMonoK, Int>, x: Int ->
just(acc.bind() + 1)
}.bind()
}.fix().mono.block()
}
}.attempt().unsafeRunSync()
```
10 changes: 7 additions & 3 deletions arrow-docs/docs/integrations/rx2/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -217,14 +217,18 @@ fun main() {
```

```kotlin:ank:fail
import arrow.core.Try
import arrow.Kind
import arrow.fx.IO
import arrow.fx.rx2.*
import arrow.fx.rx2.extensions.flowablek.monad.monad
// This will result in a stack overflow
Try {
IO {
FlowableK.monad().fx.monad {
(1..50000).fold(just(0)) { acc: Kind<ForFlowableK, Int>, x: Int ->
just(acc.bind() + 1)
}.bind()
}.fix().flowable.blockingFirst()
}
}.attempt().unsafeRunSync()
```

0 comments on commit 129b8ad

Please sign in to comment.