4 ms·
I really wanted to appreciate your post because I feel like you are knowledgeable and passionate about this topic, but having read through all of it, I feel you
by Kranar 5y ago
I really wanted to appreciate your post because I feel like you are knowledgeable and passionate about this topic, but having read through all of it, I feel you managed to explain next to nothing. Your post is like watching a movie that has all this interesting and amazing build up, gets you motivated to see where it's going to go... and then half way through it does a 180, pulls a Hancock and just completely falls apart. Like right when you prepare the reader to explain what a functor is, you basically give up saying "And now we're stuck, we can't go any further, a functor is just some vague abstract type that we can not explain further because of function pointers... here's some more complicated terminology like covariant functor and contrafunctor and roll end credits."
I say that as someone who is familiar with monads and functors but who also appreciates seeing new explanations to help reinforce the concept. I don't mean that to be rude, I feel like you are genuinely trying to explain it given the limited circumstances, but your explanation really does nothing to help someone understand what a functor is.
- Twisol 5y agoI'm not going to be able to explain functors and monads in one post. That's kind of what led to Brent Yorgey's famous post with burritos. [0] What I can do is try to work with somebody at the level they're prepared for, and at least try to show what functors are meant for. If you know what functors are, you're not really my target audience; I won't be able to meet your expectations. In the past, I've discussed functors as unary pipelines (applicatives are n-ary) [1] [5], as ways of viewing one world of widgets within another [2], as generalized "sources" (generic over whatever they produce) [3], and as what they are in the most abstract sense: a pair of morphisms [4]. I didn't think any of those explanations were suitable starting from a C/assembly level, since you cannot represent most forms of parametricity in the first place. Instead, I tried to take a concrete issue you might run into in C, and motivate the reason you'd want to use functors to solve it. You cannot represent functors in C; you can't even write a single generic `map`, which is the most visible witness of a functor in most languages. Discussing any form of concretized Functor trait would be putting the cart before the horse. Bonus primers on lenses [6] and monoids [7] if you like. [0] https://byorgey.wordpress.com/2009/01/12/abstraction-intuition-and-the-monad-tutorial-fallacy/ https://byorgey.wordpress.com/2009/01/12/abstraction-intuiti... [1] https://news.ycombinator.com/item?id=28476843 https://news.ycombinator.com/item?id=28476843 [2] https://news.ycombinator.com/item?id=28549934 https://news.ycombinator.com/item?id=28549934 [3] https://news.ycombinator.com/item?id=28479315 https://news.ycombinator.com/item?id=28479315 [4] https://news.ycombinator.com/item?id=28476667 https://news.ycombinator.com/item?id=28476667 [5] https://news.ycombinator.com/item?id=27649493 https://news.ycombinator.com/item?id=27649493 [6] https://news.ycombinator.com/item?id=26783570 https://news.ycombinator.com/item?id=26783570 [7] https://news.ycombinator.com/item?id=27180675 https://news.ycombinator.com/item?id=27180675