6 ms·
Functors – What Are They?
- selbekk 7y agoI love when functional programming is explained via languages like JavaScript - it's very approachable. Even the detour into Elm was very understandable.
- tutfbhuf 7y agoI would like to see more articles like this.
- l0lpalme 7y agoCool! Have you checked out other articles in functional.christmas? I am thinking about writing a followup to this one later so you might get what you want.
- lidHanteyk 7y agoCompletely missing the categorical perspective here. Where are the functor laws? Additionally, we're missing the functors which aren't containers, like continuation-oriented functors, or which have monoidal summaries rather than mapping every point. Elm was a terrible choice for an ML with which to illustrate functors. Something like OCaml or Haskell, where polymorphic abstractions are available, would have been a better choice. JS is right out. I don't know what this is supposed to teach, but the poor choice of language perverts it. (On the other hand, I wonder to what degree the poor choice of language is related to the idea that this post is actually bitten, ripped off from many other community posts, including ones with pictures and categorical ideas. [0][1][2]) It's too bad that HN doesn't ban spammers like Lobsters does. This post is yet another in a series of lightweight low-effort marketing snow, posted by a member of a spamming ring. [0] http://adit.io/posts/2013-04-17-functors,_applicatives,_and_monads_in_pictures.html http://adit.io/posts/2013-04-17-functors,_applicatives,_and_... [1] https://toast.al/posts/code/2017-01-01-anatomy-of-maybe-part-ii-functor.html https://toast.al/posts/code/2017-01-01-anatomy-of-maybe-part... [2] https://dev.to/drbearhands/functors-monads-and-better-functions-26f3 https://dev.to/drbearhands/functors-monads-and-better-functi...
- karmakaze 7y agoIt's good to know what Functors and Applicatives are, and how they're different from Monads. This should be in the practical context that Monads do the daily heavy-lifting.