【发布时间】:2021-02-20 13:30:15
【问题描述】:
我们可以在 Arrow monad 理解中 bind() 的一种方式是“大喊大叫”(第三个示例):
/**
* All possible approaches to running [Kind] in the context of [Fx]
*
* ```
* fx {
* val one = just(1).bind() // using bind
* val (two) = just(one + 1) // using destructuring
* val three = !just(two + 1) // yelling at it
* }
* ```
*/
由于 Kotlin 的 ! 运算符用于否定布尔值,您能解释一下它在 Arrow 中是如何以及为什么这样工作的吗?
【问题讨论】: