Randall Perry
09/07/2021, 3:56 PMval ns2: State<RNG, List<Int>> =
State.fx(Id.monad()) {
val x: Int = int.bind()
val y: Int = int.bind()
val xs: List<Int> = ints(x).bind()
xs.map { it % y }
}
Using latest Arrow libs, the above snippet fails syntax checker in Idea. ‘Id’ is not recognized, and Arrow docs say it was slated for deprecation.
Wondering if anyone can help refactor this to current Arrow version, or recommend previous version this will work with?
Asked on Manning forum, but got no reply.raulraja
09/07/2021, 4:08 PMraulraja
09/07/2021, 4:13 PMAtomic
https://arrow-kt.io/docs/apidocs/arrow-fx-coroutines/arrow.fx.coroutines/-atomic/ you can thread an Atomic reference through any suspend computation as argument or keeping a scoped reference to it and use its api to update its state inside suspensionRandall Perry
09/07/2021, 4:14 PMraulraja
09/07/2021, 4:26 PMmarc0der
09/07/2021, 4:39 PMmarc0der
09/07/2021, 4:42 PMRandall Perry
09/07/2021, 4:50 PM