daneko
03/10/2019, 9:02 AMobject Sample<ForDeferredK>, MonadThrow<ForDeferredK> by DeferredK.async()
interface Sample : MonadThrow<F> { // or MonadDefer , Async...
fun exec(...):Kind<F, ...> {
// 0.9.0, binding is deprecated...
return binding {
val a = method...().bind()
val b = method...().bind()
...
}
}
}
0.9.0
// I think that there are better way to write than ↓ .
object Sample<ForDeferredK>, MonadThrow<ForDeferredK> by DeferredK.async() {
override fun monadError(): MonadThrow<ForDeferredK> {
return DeferredK.async()
}
}
// is this correct way...?
interface Sample : MonadThrow<F>, Fx<F> {
fun exec(...):Kind<F, ...> {
return fx {
val a = !method...()
val b = !method...()
...
}
}
}
full sample code
https://gist.github.com/daneko/ef38e95fec2ae97de20973a5d006dc0f
so could you tell me your recommended code, and | or how to migration!