Hacker News new | past | comments | ask | show | jobs | submit login
On Functors (catonmat.net)
57 points by pkrumins on May 17, 2010 | hide | past | favorite | 6 comments



Uses in Haskell and ML seem to follow its math origin, but why in C++ they have come to call it functor?


If you think of a C++ functor as a class, i.e. a factory for function objects, it makes a little bit more sense.

(However, that is not the common usage of the word in C++ world. For most C++ guys, "functor" and "function object" mean the exact same thing.)


Because functor is kinda-sorta a portmanteau of function object and people wanted to sound clever, I guess.


I always thought it was 'FUNCTion operatOR".


In C++ it's customary to call a constructor "ctor"; they probably thought "function constructor, riight, functor".


At least these words aren't used in colloquial English. Physics has the problem that it tries to describe many things in terms of fairly regular words like energy and wave, when they really aren't quite the same as the non-physics use of those words. It has been the source of much undergraduate confusion over the centuries.

A problem with using esoteric terms is that it can be hard to find two people who have the exact same definition of them, and different fields will have different definitions for the same term. They also raise the barrier to entry when there is a full vocabulary to learn in addition to new meanings.

I'm not sure if we should keep overloading terms or try to come up with new silly words for everything. I'm not sure what to think of functors, but in my head they are always homomorphisms.




Consider applying for YC's W25 batch! Applications are open till Nov 12.

Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: