5 ms·
Something that doesn't help the Math->CS understanding of Functors is, for example, that languages like C++ use "Functor" to mean other things (function pointer
by LukeHoersten 11y ago
Something that doesn't help the Math->CS understanding of Functors is, for example, that languages like C++ use "Functor" to mean other things (function pointer in this case).
- Profan 11y agoIt's not though, in C++ a functor is generally something which defines the operator which lets you treat it as a callable. (a thing which acts like a function) Though the suppose the dissonance in naming point still applies.
- jfarmer 11y ago> a functor is generally something which defines the operator which lets you treat it as a callable In mathematics, those things are just called "functions". :P
- zmmmmm 11y agoI'm curious to know which came first? In any case it's annoying to have different languages adopting the same word to mean vaguely related but actually completely different things. I suspect that is why a lot of tutorials about Monads skip talking about Functors altogether which ends up making the whole thing more confusing.
- archgoon 11y ago> I'm curious to know which came first? The math definitions. These were invented by Saunders Mac Lane and Samuel Eilenberg back in 1945ish, about a year before ENIAC was built.
- kyllo 11y agoFunctors also mean something different in OCaml than they do in Haskell. Two different applications of the same abstract concept.
- Chinjut 11y agoThe C++ use of the word "functor" goes back to the original use of the word "functor" by Rudolf Carnap (to mean something like a word which combines with other words as arguments to produce a full term; a word that acts function-like, basically). Saunders Mac Lane took the word "functor" from Carnap and gave it a particular definition in category theory (when founding category theory with Samuel Eilenberg). The ML languages and Haskell use the word "functor" in reference to this category theory sense of the word. But category theory is not actually where the word "functor" originated. So perhaps we shouldn't say that C++ got its use of the word wrong, but rather, that there were simply two independent paths of evolution of technical uses of the word since its original creation by Rudolf Carnap for use in philosophy of language.