应用(和朋友)方法是否有人性化的名称? [英] Are there human-friendly names for applicative (and friends) methods?
问题描述
函数名称
而不是 star thing
代替< * GT;
。因此,与>> =
读取 bind
几乎一样,是否还有更多人性化的名称如下所示: -
<>
- apply? -
< *
&*>
- 左右适用? -
< $>
- fmap? -
< |>
同样来自箭头
-
***
- 分割 -
&&&
- fanout?
如果有这些名称,我的搜索没有发现它们。我知道这里可能没有公认的条款,但是如果有的话我很想知道它们。
,< $>
是 fmap
的同义词。此外,应用这个名字让我想到应用的东西。既然<>
是做这件事的主要操作符,我想我把它与单词apply松散地联系起来。上下文与正常的函数应用稍有不同,所以可能会对这个单词产生一些混淆,但上下文通常足够清楚,所以对我来说很有用。 <>
也是Control.Monad的 ap
函数的同义词,所以这证实了我使用单词apply。 <>布伦特Yorgey的 Typeclassopedia 是我学到的大部分内容。这是一个出色的资源。
I've been using applicative (and alternative) a fair bit lately, and one thing that has been frustrating me is my lack of knowledge of the nomenclature. As an example, I'd like to be able to say function name
instead of star thing
for <*>
. So, in much the same way that >>=
is read bind
, are there more human-friendly names for the following:
<*>
- apply?<*
&*>
- left and right apply?<$>
- fmap?<|>
and likewise from arrows
***
- split?&&&
- fanout?
If there are names for these, my searches haven't uncovered them. I understand that there might not be accepted terms for these, but if there are I'd love to know them.
Well, <$>
is a synonym for fmap
. Also, the name "applicative" makes me think of applying things. Since <*>
is the main operator for doing that, I think I associate it loosely with the word "apply". The context is slightly different from normal function application so there could be some confusion with that word, but the context usually makes it clear enough, so it works for me. <*>
is also a synonym for the ap
function from Control.Monad, so this confirms my use of the word "apply".
Brent Yorgey's Typeclassopedia is where I learned most of this. It's an outstanding resource.
这篇关于应用(和朋友)方法是否有人性化的名称?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!