名称“节"在哪里?来自部分应用的中缀运算符? [英] Where does the name "section" come from for a partially applied infix operator?

查看:79
本文介绍了名称“节"在哪里?来自部分应用的中缀运算符?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

在Haskell中,我们使用术语节"来表示在中缀位置使用的部分应用功能.例如,对于函数foo :: a -> b -> c和值x :: ay :: b,我们有两个部分

In Haskell, we use the term "section" to indicate a partially applied function used in infix position. For instance, for a function foo :: a -> b -> c and values x :: a and y :: b, we have the two sections

s1 = (x `foo`) :: b -> c == \b -> foo x b

s2 = (`foo` y) :: a -> c == \a -> foo a y

但是,在范畴论中,fg部分被定义为f的右逆(因此,f . g == id).

In category theory, however, a section g of f is defined as a right inverse of f (so that f . g == id).

我没有看到两个定义之间的明显联系.例如,s1显然不是foo的倒数,至少不是在 Hask 中.我想s1甚至不必必须倒置 Hask .

I don't see an obvious connection between the two definitions. For instance, s1 is clearly not an inverse of foo, at least not in Hask. I suppose s1 doesn't even have to have an inverse in Hask.

类别理论定义是Haskell定义的来源吗?如果是,怎么办?

Is the category-theoretical definition the source of the Haskell definition, and if so, how?

推荐答案

正如评论中指出的那样,Haskell从Miranda(和Orwell)那里获得了这些部分.大卫·特纳说,他是从理查德·伯德和大卫·威勒那里得到这个想法的.

As has been pointed out in the comments, Haskell got the sections from Miranda (and Orwell). David Turner says he got the idea from Richard Bird and David Wile.

我刚刚与理查德·伯德(Richard Bird)聊天.他说他不记得这个名字的来历,但他认为是David Wile创造了这个名字.不幸的是,大卫·威勒(David Wile)于去年去世,所以我们可能永远不会知道.但是,理查德确实承认他是说服戴维·特纳和菲尔·沃德勒添加其语言版块的人.

I have just chatted with Richard Bird. He says he doesn't remember where the name came from, but he thinks it was David Wile who coined it. Unfortunately, David Wile died last year, so we will probably never know. But, Richard did admit that he was the one who convinced David Turner and Phil Wadler to add sections in their languages.

这是Wile论文的第一页,该页是第一个已知的部分". http://imgur.com/a/cQDlu

Here's the page from Wile's thesis that is the first know mention of "section". http://imgur.com/a/cQDlu

这篇关于名称“节"在哪里?来自部分应用的中缀运算符?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆