Monads are commonplace in computer science, and can be composed using Beck's distributive laws. Unfortunately, finding distributive laws can be extremely difficult and error-prone. The literature contains some general principles for constructing distributive laws. However, until now there have been no such techniques for establishing when no distributive law exists. We present three families of theorems for showing when there can be no distributive law between two monads. The first widely generalizes a counterexample attributed to Plotkin. It covers all the previous known no-go results for specific pairs of monads, and includes many new results. The second and third families are entirely novel, encompassing various new practical situations. For example, they negatively resolve the open question of whether the list monad distributes over itself, reveal a previously unobserved error in the literature, and confirm a conjecture made by Beck himself in his first paper on distributive laws. In addition, we establish conditions under which there can be at most one possible distributive law between two monads, proving various known distributive laws to be unique.
翻译:修饰品在计算机科学中司空见惯,可以使用Beck的分布法组成。 不幸的是,找到分配法可能非常困难,而且容易出错。文献中包含一些构建分配法的一般原则。 但是,到目前为止,还没有这种技术可以确定何时不存在分配法。 我们提出三个理论家族来显示两个寺院之间何时不能分配法。 第一个理论家族广泛概括了普洛特金的反推法。 它覆盖了以往已知的特定寺院夫妇之间所有不执行的结果,并包含许多新的结果。 第二和第三家族是全新的,包含各种新的实际情况。例如,它们消极地解决了单子是否分布在自己身上的开放问题,揭示了文献中以前未曾发现的错误,并确认了贝克本人在他的关于分配法的第一份论文中所作的推测。此外,我们确立了两个寺院之间最多可以存在一种可能的分配法,证明各种已知的分配法是独一无二的。