【发布时间】:2019-04-27 09:29:32
【问题描述】:
我正在尝试扩展我对 Haskell 中符号的理解:
$ : Function Application operator (Allow you to apply arguments over a function)
& : flipped version of Function Application Operator? (&) = flip ($)
<> : associative operator (You'll find it in Semigroups and Monoids)
<$> : function application ($) lifted over a Functor structure
<&> : flipped functor map
<*> : applicative operator
我们可以在<> 和这个家庭<*>,<$>,<&> 之间建立联系吗?仅查看<*>,<$>,<&> 时,我很快得出结论,<..> 与结构上的某些东西有关,但是结构和关联运算符之间的联系是什么?
【问题讨论】:
-
我认为最好将
<>视为与其他<...>运算符无关。 (但也许有一些我看不到的联系) -
我认为这是对
<...>本身是其他运算符上的某种运算符的想法的一种半开玩笑的引用。如果您认为<x>对运算符x执行某种常见的提升操作,那么通用关联运算符“提升”没有特定的运算符,因此<...>“包装”空运算符以产生<>。 -
@chi Applicative 是(就像著名的 monad 一样)适当类别中的幺半群。 arxiv.org/abs/1406.4823 但我非常怀疑这是决定名称的理由。
标签: haskell naming-conventions category-theory monoids