14

I found this exciting gem today. This tag has 1,542 questions, at the time of writing. The excerpt for the tag starts with

The term 'functor' has several common meanings: 1. Function object. In object-oriented languages, it is a feature that allows objects to be used as if they were ordinary functions. 2. A mathematical structure which deals with mappings between categories. This concept is a useful abstraction in some programming languages, notably Haskell, where it is implemented as a type class. 3. In OCaml, a module that takes another module as an argument.

I see at least three separate meanings here. And in the full tag wiki page, a fourth meaning is listed.

  1. The term "functor" in C++, which means "an object that can be called like a function". This use is pretty well-captured by if you ask me. 737 of the -tagged questions are also tagged .

  2. Functors in OCaml, which are modules parameterized by other modules. Basically, in OCaml, a functor is a function from modules to modules. 83 questions tagged with are also tagged , though several of those are "why doesn't OCaml have Haskell-like functors" or similar.

  3. Functors in Haskell, which provide the fmap higher-order function for lifting functions to operate over some given datatype. 460 questions tagged are also tagged , and 64 more are tagged , where usage is similar.

  4. In Prolog, the word "functor" refers to the head of an M-expression, so in foo(bar, baz), we call foo the "functor" of the expression. 15 questions tagged are also tagged .

And then there are functors in category theory (i.e. homomorphisms between categories). This is very similar to the Haskell usage, but could also be considered its own thing.

That leaves 185 questions tagged with and none of the mentioned languages, which seem to be a mix of (1) and (3) from people trying to apply one of those two definitions of functor to their favorite language.

I don't think we should simply get rid of the tag, because it does provide value. But something does need to be done, because right now the tag means at least four distinct things.

For completeness, the burnination criteria. As I said, I don't think burnination is the right solution, but nonetheless

  1. Does it describe the contents of the questions to which it is applied? and is it unambiguous? No, it is quite ambiguous, which is the problem.

  2. Is the concept described even on-topic for the site? Certainly. The C++, OCaml, and Haskell meanings are clearly on-topic. The Prolog meaning is of questionable value but is fairly niche to begin with.

  3. Does the tag add any meaningful information to the post? Right now, not really. At a glance, it means multiple completely distinct things. But I believe that it could, if disambiguated.

  4. Does it mean the same thing in all common contexts? This is fundamentally the problem here. We've got several meanings under one massive umbrella.

7
  • 6
    Not all tags need to make sense stand-alone. When combined with a programming language tag, it's no longer ambiguous. I honestly don't see any problem with this tag as it is. We can flesh out a tag usage guidance for it and clarify how it should be used in relation to various programming language tags.
    – Lundin
    Commented May 13, 2022 at 6:51
  • 4
    @Lundin [citation needed] The hallmark of a dependent tag is that it can't standalone, and dependent tags are not allowed. That became policy in 2010.
    – Braiam
    Commented May 13, 2022 at 12:01
  • 1
    @Braiam In that case some 90% of all tags on the site needs to go.
    – Lundin
    Commented May 13, 2022 at 12:36
  • 1
    A stretch, but "This tag is dys[functor]inal" Commented May 13, 2022 at 14:02
  • 4
    @Braiam [citation does not support claim] That's a ban on meta-tags like "beginner", "subjective", and "best-practices". functor is not a meta-tag. Commented May 13, 2022 at 18:49
  • @Lundin well, 90% of everything is crap, so yeah, I support that view.
    – Braiam
    Commented May 13, 2022 at 19:28
  • People need to understand that there is a difference between meta tags and dependent tags. Commented May 14, 2022 at 17:31

1 Answer 1

3

Here is my proposal for dealing with this, but I want to get the community's input for such a massive tag before taking any action.

I propose we keep the tag and clarify its Wiki to match the Haskell meaning, i.e. a functor is a means of lifting functions to operate on values of some given datatype. Although the C++ meaning has more questions to it at a glance, we already have a valid tag for that (namely, ). If we're really worried about ambiguity continuing to be an issue, we could rename it to or something, but I'm not sure that's quite necessary at this point.

Under this proposal, we would

  • Retag functor questions to , which is a perfectly good tag that already works for the C++ definition.
  • Leave and questions alone, as they match our proposed clarified definition. I also suggest we leave the category theory ones alone, as that's similar enough in nature that I don't see a problem with having one tag for the two concepts.
  • The questions should be retagged with a new tag, called something like or . Open to suggestions on the name.
  • The questions should simply have the tag removed. I feel "this question is about the head of an M-expression" adds no value to the post and does not warrant its own tag.
  • The roughly 200 questions tagged with none of the above languages can be hand-sorted into one of the above categories on an individual basis.
3
  • 9
    "Retag c++ functor questions to function-object, which is a perfectly good tag that already works for the C++ definition." This won't work since it won't prevent new posts to get tagged with c++ functor.
    – Lundin
    Commented May 13, 2022 at 6:52
  • 2
    Any disambiguation that keeps the disambiguated tag as is, is not disambiguation.
    – Braiam
    Commented May 13, 2022 at 12:01
  • 2
    I'd remark that the notion of functor in Haskell, but also the one in standard ML / OCaml, stems from the perfectly established functors in category theory. It applies to any language that can abstract over simple category-theoretic concepts. By contrast, the function-object use of the term is rather obscure and seems to be only widespread in the C++ community. Granted, that's a big community, but I'd say this is still just a misnomer. I would base the functor tag on the category theory definition, which still includes OCaml. Commented May 16, 2022 at 11:45

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .