Function-like objects terminology

Methods · The Julia Language says

Methods are associated with types, so it is possible to make any arbitrary Julia object “callable” by adding methods to its type. (Such “callable” objects are sometimes called “functors.”)

In Python, objects that can be called are termed “callables”. In functional programming, “functor” means something, but I’m not seeing if they’re somehow the same concept or just a name coincidence?

1 Like

I can’t speak for the choice of terminology in the docs, but there is a library for the category theoretical definition of Functors: GitHub - FluxML/Functors.jl: Parameterise all the things

Good question. I’ve also wondered about that…

Julia uses pretty much the C++ definition of Functor. But functional languages also seem to use a few different meanings for Functor. It’s a vague word.

The C++ community is one of only a few programming communities that does not use this meaning.

Seems like “callable” is a clearer word for this concept. I wonder if Julia could start using it instead.

1 Like