Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Where does the name "section" come from for a partially applied infix operator?

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

and

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

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

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.

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

like image 514
chepner Avatar asked Nov 10 '16 20:11

chepner


1 Answers

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.

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.

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

like image 142
augustss Avatar answered Oct 29 '22 15:10

augustss