This answer from a Category Theory perspective includes the following statement:...the truth is that there's no real distinction between co and contravariant functor, because every functor is just a covariant functor.

## What is the most efficient way to pass a non generic function?

I am learning functional programming in C++. My intention is to pass a non generic function as argument. I know about the template method, however I would like to restrict the function signature as part of the API design. I worked out 4 different methods example on cpp.sh:

## When using templates to support functor as arguments, what qualifier should I use?

Consider this code:Which version of foo should I use? foo1 is what I see most "in the wild" but I fear that it might introduce copies that I don't want. I have a custom functor that is kind of heavy to copy so I would like to avoid that. Currently...

## How is “a monoid on applicative functors” different than “a monoid in the category of endofunctors”?

Perhaps neither of these statements are categorically precise, but a monad is often defined as "a monoid in the category of endofunctors"; a Haskell Alternative is defined as "a monoid on applicative functors", where an applicative functor is a "strong lax monoidal functor". Now these two definitions sound pretty similar...