pakoito
06/04/2019, 12:32 PMsuspend fun bla(): Int {
val ble = myIOCall().await()
ble + 2
}
pakoito
06/04/2019, 12:32 PMawait
right nowpakoito
06/04/2019, 12:32 PMsimon.vergauwen
06/04/2019, 12:33 PMsimon.vergauwen
06/04/2019, 12:33 PMsuspended()
but that’s no good I guess. Before that it was `val <A> IO<A>.suspended: suspend () -> A``simon.vergauwen
06/04/2019, 12:34 PMsuspend fun parallelProcessing(): Int = IO.parMapN(coroutineContext, ...).await()
in case you want to use complex concurrency combinators. Where you can even inherit coroutineContext
from the suspend environment if you don’t want to explicitly pass it.simon.vergauwen
06/04/2019, 12:35 PMpakoito
06/04/2019, 12:36 PMsam
06/04/2019, 12:36 PMsam
06/04/2019, 12:36 PMsimon.vergauwen
06/04/2019, 12:36 PMsam
06/04/2019, 12:37 PMsam
06/04/2019, 12:37 PMsimon.vergauwen
06/04/2019, 12:37 PMsuspend fun program(): Either<ErrorDomain, Result>
?sam
06/04/2019, 12:38 PMsam
06/04/2019, 12:39 PMsimon.vergauwen
06/04/2019, 12:39 PMarrow-core
, including the things well move their in 0.10 (NonEmptyList, ListK, AndThen, …) will be perfect usable in vanilla kotlinsam
06/04/2019, 12:39 PMsam
06/04/2019, 12:41 PMsam
06/04/2019, 12:41 PMpakoito
06/04/2019, 12:41 PMbinding
help?sam
06/04/2019, 12:42 PMsuspend fun foo() = binding {
val a = start().bind()
val b = bar(a).bind()
val c = update(b) // suspendable
result(c)
}
sam
06/04/2019, 12:42 PMpakoito
06/04/2019, 12:43 PMsuspend fun foo()
still doesn't allow yousam
06/04/2019, 12:43 PMsam
06/04/2019, 12:43 PMsam
06/04/2019, 12:43 PMpakoito
06/04/2019, 12:43 PMsam
06/04/2019, 12:43 PMpakoito
06/04/2019, 12:44 PMfx
does allow arbitrary suspension for MonadError, IIRC