Skip to content

Commit

Permalink
Merge remote-tracking branch 'origin/master'
Browse files Browse the repository at this point in the history
  • Loading branch information
h0tk3y committed Feb 4, 2017
2 parents c2ad4e2 + e14a8fd commit 5ae9203
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@ Add as a dependency:
}

dependencies {
compile 'com.github.h0tk3y:kotlin-monads:0.3'
compile 'com.github.h0tk3y:kotlin-monads:0.3-1'
}

See the usage examples in [tests](https://github.com/h0tk3y/kotlin-monads/tree/master/src/test/kotlin/com/github/h0tk3y/kotlinMonads).
Expand Down Expand Up @@ -130,8 +130,8 @@ This problem is effectively solved using the Kotlin coroutines: the compiler per
code block under the hood. However, this coroutines use case is somewhat out of conventions: it might resume the same continuation
several times and uses quite a dirty hack to do that.

The result type parameter (`R` in `Monad<M, R`) is usually inferred, and the compiler controls the flow inside a *do block*, but still you need to
downcast the `Monad<M, R>` to your actual monad type (e.g. `Monad<Maybe<*>, R>` to `Maybe<R>`), because the type system doesn't seem to allow this to be done
The result type parameter (`R` in `Monad<M, R>`) is usually inferred, and the compiler controls the flow inside a *do block*, but still you need to
downcast the `Monad<M, R>` to your actual monad type (e.g. `Monad<Maybe<*>, R>` to `Maybe`), because the type system doesn't seem to allow this to be done
automatically (if you know a way, please tell me).

**Be careful with mutable state** in _do_ blocks, since all continuation calls will share it, sometimes resulting into counter-intuitive results:
Expand Down

0 comments on commit 5ae9203

Please sign in to comment.