-
-
Notifications
You must be signed in to change notification settings - Fork 1k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Avoid confusing different meanings of the same word, eg Functor #62
Comments
I think defining all meanings will be more confusing to newcomers. For academic descriptions of these concepts there are other better sources. |
That makes some sense, however a person starting FP for the first time might hear a term used to mean one of the other meanings, if they check this glossary it could lead them to the wrong conclusion. This can be worse than having no glossary at all. Another approach may be to qualify the definitions with multiple meanings. Again with functor as an example, you could say "Functor has several meanings, in the context of Haskell functor usually means...". On reddit several people said that this appears to have a focus on Javascript. Perhaps all the definitions are intended to be in the context of Javascript and that I didn't understand that when I read this. |
Yeah all the examples are in JavaScript. It's not the best language for On Mon, Jul 25, 2016, 7:53 PM Paul Bone [email protected] wrote:
|
That's a good choice, I'm sure this will be a good resource for many. Although maybe something about the intended scope/context should be placed at the top of the file? |
Yeah the intro needs work On Mon, Jul 25, 2016, 8:11 PM Paul Bone [email protected] wrote:
|
Defining them in simple terms is the challenge? 🤔 |
It was indeed very confusing because the mathematical definition of functor actually means the transforming/mapping function, not the container object/category. But then I saw the explanation at the very beginning of the document which said all term definitions follow Fantasy Land Spec, so I guess that's it. |
This doc covers more topics than the fantasyland spec but it's using the On Tue, Jul 26, 2016, 1:21 AM G. Kay Lee [email protected] wrote:
|
I've been thinkin about this a bit. Maybe it is worthwhile to go into a little more detail on functor. Especially since map is endofunctor. We can then group the other morphisms under it |
Monad can go under there too ;) |
It would be sensible to at least acknowledge that somebody might read text that gives a word a different meaning by pointing out at the bottom of words that have multiple common definitions that the definition discussed is the FantasyLand spec one. You could even link to resources that could describe the other usages. Otherwise a beginner will read one of these words, and then go and check these docs and they could end up more confused than they would have been if otherwise. |
I've been considering reworking the functor section and grouping the On Thu, Jul 28, 2016, 4:44 AM Seb Insua [email protected] wrote:
|
It's worth remembering that this document is about FP, not math or category theory, and a functor in FP is a mappable structure. That definition is universal in programming so far as I can tell even if it has slightly different meanings in other contexts. Actually, it is my understanding that in CT you don't really separate the arrow from the objects it points to/from, so a functor represents a kind of relationship (or transformation) for a species of object without regard for its structure otherwise. So the functor as type class, which captures the transformation while abstracting the structure, is a pretty decent approximation, and an approximation is all it will ever be outside the world of Platonic forms. I've read functor described as a "function object" that simply generalizes how the arrow or |
Sorry, I realize I may be overly influenced by Haskell here, given what was pointed out about OCaml above. Still, everywhere else I've seen functors they have been more like the Haskell idea—using collections as a starting point. The OCaml idea still seems roughly the same sort of thing, though: overloading the morphism arrow within a given category. Now that I think of it, most languages that have them probably ditch the terminology. Like Swift. Rust, too. I guess the point of even using them here is to familiarize people with terms they may encounter or patterns they definitely will encounter and that are important to FP. Endofunctor may send them screaming for the hills, though most functors in programming contexts are endofunctors anyway. Names are so hard in CS and it's 7 am here so I give up for now. |
@sjsyrek That is exactly the problem with only acknowledging a single definition for overloaded terms. It's easy to be influenced by the use of this term in Haskell and that can lead you to make an incorrect assumption outside of that context. I'm not saying that every meaning should be defined but acknowledged maybe with a link is good enough. |
Indeed, it's equally tricky given the JS-orientation of this document since JS has no definition for things like functor. But how many other contexts define functor differently than "a structure to be mapped over" which is essentially overloading function application for a particular kind of thing (I hesitate to say object)? i.e. "objects" plus morphisms? I find myself in this weird position of trying to avoid semantic arguments and basically now creating one. So, I guess another problem would be trying to cover all possible contexts if there really are other contexts we ought to consider. By covering more than one, do we risk presenting a partially complete set as if it were a complete set? Or do we risk alienating newbies by putting disclaimers everywhere that our definitions are correct in these contexts, but not those, and by the way there may be more we don't mention or know about. @PaulBone hey I loved you on Functional Geekery! Made me almost not want to give up entirely on Mercury-like languages (Agda?) |
Just acknowledge the ones you know about, I'm sure other pedants like me will point out when you've missed one ;-) I'm glad you enjoyed it. In the next few weeks I'll add my other talks and things to my website. I have a new talk coming up at the end of August too. |
Hey maybe we need to add a podcasts section. Between Functional Geekery, the Haskell Cast, and the the new LambdaCast, there's plenty of material. Plus individual episodes of JS podcasts that cover FP in that world. |
@sjsyrek I like your intuition here. This really is a document for beginners, programmers, and JS programmers at that. Our goal should be to keep people reading without getting a mental stack overflow. A simple caveat like "This differs from [functors in mathematics]" where then we can link off to an article or wiki could be enough |
Even within FP there are multiple meanings of some terms, a good example is functor. You've covered one meaning and might not be aware of the other two meanings.
The text was updated successfully, but these errors were encountered: