Warning: file_get_contents(/data/phpspider/zhask/data//catemap/5/ruby-on-rails-4/2.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Kotlin 为什么呢!运算符是否与Arrow Monad中的.bind()相同?_Kotlin_Arrow Kt - Fatal编程技术网

Kotlin 为什么呢!运算符是否与Arrow Monad中的.bind()相同?

Kotlin 为什么呢!运算符是否与Arrow Monad中的.bind()相同?,kotlin,arrow-kt,Kotlin,Arrow Kt,在Arrow monad压缩中,我们可以bind()的方法之一是“大叫”(第三个示例): 自从Kotlin的运算符用于否定布尔值,您能在Arrow中解释它是如何以及为什么以这种方式工作的吗?我在Kotlin的文档中找到了关于运算符重载的答案: BindSyntax覆盖not运算符: interface BindSyntax<F> { suspend fun <A> Kind<F, A>.bind(): A suspend operator fun

在Arrow monad压缩中,我们可以
bind()
的方法之一是“大叫”(第三个示例):


自从Kotlin的
运算符用于否定布尔值,您能在Arrow中解释它是如何以及为什么以这种方式工作的吗?

我在Kotlin的文档中找到了关于运算符重载的答案:

BindSyntax
覆盖not运算符:

interface BindSyntax<F> {

  suspend fun <A> Kind<F, A>.bind(): A

  suspend operator fun <A> Kind<F, A>.not(): A =
    bind()
}
接口绑定语法{
挂起fun Kind.bind():A
挂起运算符fun Kind.not():A=
绑定()
}
interface BindSyntax<F> {

  suspend fun <A> Kind<F, A>.bind(): A

  suspend operator fun <A> Kind<F, A>.not(): A =
    bind()
}