10 ms·
Functors, Applicatives, and Monads in Pictures (2013)
- xashor 5y ago(a -> b) -> T a -> T b T (a -> b) -> T a -> T b (a -> T b) -> T a -> T b
- bspammer 5y agoThat’s a very pretty way to lay it out. I’ve never thought of reversing the order of arguments in the monad before, but it makes sense when you see it next to the others. What about this? Is this even possible? (T a -> b) -> T a -> T b I guess to complete the set you can also add this one which is not very interesting, it’s just “apply the function” (T a -> T b) -> T a -> T b
- Twisol 5y ago> What about this? Is this even possible? > (T a -> b) -> T a -> T b Yep; that's the signature for the "extend" method of a comonad. https://hackage.haskell.org/package/comonad-5.0.8/docs/Control-Comonad.html#v:extend https://hackage.haskell.org/package/comonad-5.0.8/docs/Contr... Though I prefer the presentation with `duplicate :: w a -> w (w a)`, which is just the signature of Monad's `join` but flipped around.
- WastingMyTime89 5y ago> (T a -> b) -> T a -> T b That’s just a normal function application followed by return.
- bradrn 5y agoNot at all. There’s sensible implementations which aren’t like that. (You might as well say that (>>=) is just function application proceeded by ‘unwrap’.) My favourite example is cellular automata: if you have a data structure containing a grid along with a position on that grid, then that function signature corresponds precisely to running a cellular automaton on that grid. The idea is that the initial ‘T a -> b’ function is run for every single position, then all the results are combined into a single ‘T b’ grid.
- WastingMyTime89 5y agoExcept of course there is no unwrap in the actual definition while both application and return are sure to be there. It’s not like any of this is relevant anyway. The usual abstractions liked by Haskellers are utterly pointless as this whole discussion nicely demonstrate.
- Twisol 5y ago> Except of course there is no unwrap in the actual definition while both application and return are sure to be there. The actual definition of what? `return` is not part of the Comonad class, while `unwrap` (alternatively called `extract`) is not part of the Monad class. No matter what your preferred way of designing abstractions, it seems a strange complaint to say "feature X is useless with abstraction Y" if you don't have a Y in the first place. > It’s not like any of this is relevant anyway. The usual abstractions liked by Haskellers are utterly pointless as this whole discussion nicely demonstrate. Well, okay then. You may not find value in this way of thinking, but other software developers -- many of whom, yes, ship actual software with actual business value -- find these ideas extremely valuable in organizing their thoughts about the problem domain. I'm open to sharing that mindset with anyone of a curious mind, but most of us aren't going to shove it down your throat. You're welcome to do what works for you.
- thewakalix 5y agoYou might as well say that `(a -> T b) -> T a -> T b` is extract followed by normal function application.
- bradrn 5y agoHuh, interesting how we came up with nearly identical comments at the same time! (Though I somehow managed to get the function name wrong…)
- Twisol 5y agoThe important missing context is that a monad has `(return, bind)`, while a comonad has `(extract, extend)`, and both have their own respective laws letting you reason about combinations of those operations. You can certainly do what you describe if you have a monad, but since you can't even try to unwrap a value if you don't know what the monad is concretely, you have no way to write a function `T a -> b` that's generic over T. Functions `T a -> b` only really make sense for comonads, which give you the `extract` and `extend` functions as primitive.
- Twisol 5y agoI would classify this as a pun, not an explanation. That said, I prefer a presentation using `times` and `join` rather than `ap` and `bind`: map :: (a -> b) -> (f a -> f b) times :: (f a, f b) -> f (a, b) join :: f (f a) -> f a Reason being, `ap` and `bind` are just `times` and `join` composed with `map`; it's easier (for me) to think about what `ap` and `bind` bring to the table separately from the behavior of `map`. `times` lets you take a pair of sources and turn it into a source of pairs. This lets you build pipelines that flow together from multiple sources into a single result; with just `map` you can only assemble a unary pipeline with one source. `join` lets you take a source of sources and meld the layered structures together into a single source. This lets you create pipelines whose contents dynamically extend the pipeline. Without `join`, you can only construct pipelines whose stages are fixed up-front. (As a bonus, the presentation with `times` leads to the idea that an "applicative functor" is a monoidal functor. If you don't know what a monoid is, maybe it's a toss-up in terminology, but the term "monoid" is vastly more common than the term "applicative".)
- Zababa 5y agoThank you for that, the explanation about `times` makes a lot of sense. However I can't really understand your explanation for `join`. Do you have any example or longer explanation about "pipelines whose contents dynamically extend the pipeline" and how they are different from "pipelines whose stages are fixed up-front"?
- Twisol 5y agoAre you familiar with promises, particularly in the JavaScript ecosystem? A Promise<A> represents a pending interaction; you'll get an A when the interaction has finished, but you don't have an A now. But even while you don't have the A, you can prepare a pipeline now that will process it later. Promise<_> is a functor because we can write a function `map : (Promise<A>, A -> B) -> Promise<B>` that takes a pipeline stage to run, and promises to run it on the A when it arrives. That stage produces a B, but we don't have it yet, either (since it needs that A). Just having a `Promise<B>` doesn't tell us how many pipeline stages it's built -- the fact that we called `map` isn't evidenced in the type itself -- but we know that there's a fixed number, and that all of the stages have already been given to it. After all, we call `map` in the current timestep; the stages are known long before they get to run. Promise<_> is a monoidal functor because we can write a function `times : (Promise<A>, Promise<B>) -> Promise<(A, B)>` (but see note^). We don't necessarily have either the A or the B, and the interactions that produce them may not complete at the same time; but eventually we will have both of them, so we can wait until then and pair them together. Because we can wait for two pending interactions at once, we can wait for any number of them at once; think about how to write a function `[Promise<A>] -> Promise<[A]>` using `times`. With `times`, we're just combining all of the stages in the existing promises together. Unlike `map`, which applies stages sequentially, `times` applies them concurrently -- like a branching series of pipes with Y-bends where `times` is used. With this, a `Promise<A>` still has a fixed number of stages known up-front -- all stages are still provided through `map,` which we still call before we ever have an actual `A` to run them with -- but we also now have a fixed number of forks/branches, where before it was a straight-line series of stages. Promise<_> is a monad because we can write a function `join : Promise<Promise<A>> -> Promise<A>`. The nested promise means that we need to wait for one pending interaction, and then wait for another pending interaction, before we can get an A. This often happens because we interact sequentially with a backend service; we need to log in before we query the system, so if we try to put together pipeline stages like `(Username, Password) -> Promise<Session>` and `Session -> Promise<SensitiveInfo>`, we'll end up with a `Promise<Promise<SensitiveInfo>>`. This type only lets us make up to two interactions; if we can't get `SensitiveInfo` within two interactions, we simply can't write the program at all. The `join` function lets us collapse two interactions within a single Promise; and just like `times`, if we can collapse two interactions, we can collapse any number of them. With `join`, a type like `Promise<SensitiveInfo>` may take an arbitrary number of interactions before we finally get the result. However, this is a lot more powerful than you might expect: those inner promises don't exist yet! They will exist, as each interaction completes; but now a single `Promise<A>` includes both the stages we've set now, and any stages that future interactions may generate. We can no longer tell how many stages it will take until the final `A` is computed, nor how many interactions it will take. We'll only know when it actually happens. (^) Well, we also need a function `pure : A -> Promise<A>`, which lets us pretend we don't have an `A` yet. Or, put differently, it puts an A behind a "no-op" interaction that completes immediately and makes the A available to any downstream stages as soon as it's needed. Something like an echo server.
- tsimionescu 5y agoI wonder why auto-curried function syntax has become so ubiquitous in explaining this. For anyone coming from a more traditional CS background, it's just extra cognitive overhead in understanding the meat of the argument. For example, (a -> b,T a) -> T b (a -> b,T<a>) -> T<b> Is just as good in explaining what bind means as the curried version, but more familiar to the vast majority of programmers and CS graduates. Note: I do understand why auto-currying is extremely useful for doing functional programming, and I have no objections to teaching it. I just don't think it's important for teaching functors, applicatives and monads. In a separate nit-pick, these three function definitions don't mean much on their own, and there are many pure functions that satisfy them without forming a functor/applicative/monad.
- Twisol 5y ago> I wonder why auto-curried function syntax has become so ubiquitous in explaining this. I think it's primarily because this is the form you use them in in a language like Haskell. Most explanations are exported from Haskell in one way or another, so they're deeply colored by Haskellisms. It's the same reason why `ap` and `bind` are generally preferred over `times` and `join` -- in Haskell you can even use `f <$> a <*> b`, which is a deeply clever use of infix `fmap` and `ap` that drives a syntactic analogy with regular function application, `f a b`. Try doing that in another language and you'll barf. And do-notation desugars most cleanly into >>=, so that's where Haskell-oriented explanations start from. If you implement these in Java (which you can, you just can't abstract over T), it looks like this: class List<A> { <B> List<A> map(Function<A, B> f) { ... } <B, C> List<C> map2(List<B> other, BiFunction<A, B, C> f) { ... } <B> List<B> flatMap(Function<A, List<B>> f) { ... } // bonus; note that these make more sense static static <A, B> List<Pair<A, B>> times(List<A> as, List<B> bs) { ... } // in fact, this one has to be static static <A> List<A> join(List<List<A>> aas) { ... } } That is, the second argument `T a` in the top poster's comment becomes the implicit `this` parameter for instance methods. I find the `static` alternatives often make more syntactic sense in context; just goes to show that one language's norms don't always transfer.
- dunefox 5y ago
- rkangel 5y agoOnly Haskell programmers would consider the type signature a replacement for an explanation. I don't mean to be rude to you personally - this is endemic to the culture of Haskell. Possibly once you're immersed in the world and up to speed with Haskell type signatures are all you need. Unfortunately for people coming to the language we need more context to fit the pieces together, and the vast majority of documentation I found lacked that context.
- acchow 5y agoThis is not an explanation. But it's handy to keep up on a post-it not next to your monitor after you already understand the concepts but are still getting comfortable with them.
- Zababa 5y agoThe type signature and the laws are all functors, applicative and monads are. It's just that these type signatures happen often "in the wild", so we give them names to make reasoning easier. To take another example, an iterator could be something like: next :: T a -> a hasNext :: T a -> bool That's all an iterator is. The cool thing is that if you implement next and hasNext for a list, an array, a tree and a graph, you can all use them with the same code. That's what monads, functors and applicatives are. As for the culture part, I think Rust is the sweet spot. Types are here, but you also have explanations. I personally find explanations without types worse than types without explanations, but ideally you should have both. Of course that's assuming meaningful types.
- Twisol 5y agoStrictly speaking, in an immutable world, your iterator only gives you access to the head of your collection. I think this is a fairly standard functional representation of iterable entities: next :: T a -> Maybe a rest :: T a -> Maybe (T a) We could (and you should) argue that this is correct by intuition, but it's also possible to sketch a proof that these structures all "behave" the same as lists would. We can first combine `next` and `rest` into a single function -- note that we can always interconvert between (next, rest) and step: step :: T a -> Maybe (a, T a) This has the form of something called a "co-algebra", which consists of (1) a functor `F`, (2) a type `k`, and (3) and a function `k -> F k`. In this case, `k = T a` and `F = Maybe (a, -)`. The interesting thing is that the functor `Maybe (a, -)` can have many co-algebras, depending on which type and step function you pick. The type [a] -- that is, picking T to be [] -- gives a particularly special co-algebra, called the "terminal" coalgebra for `Maybe (a, -)`. In short, while any other choice of coalgebra may support additional operations, you can convert any one of them to a list without disturbing a process that only makes use of the nominated `step` function. They're observationally equivalent to lists.
- lkuty 5y agoI would complement it with: - Scott Wlaschin's Railway Oriented Programming (ROP): https://fsharpforfunandprofit.com/rop/ https://fsharpforfunandprofit.com/rop/ and https://fsharpforfunandprofit.com/posts/recipe-part2/ https://fsharpforfunandprofit.com/posts/recipe-part2/ - Scott Wlaschin's The "Map and Bind and Apply, Oh my!" series at https://fsharpforfunandprofit.com/series/map-and-bind-and-apply-oh-my.html https://fsharpforfunandprofit.com/series/map-and-bind-and-ap... and its concept of an "elevated world". - And for Elixir Programmers, Zohaib Rauf's "Railway Oriented Programming in Elixir" at https://zohaib.me/railway-programming-pattern-in-elixir/ https://zohaib.me/railway-programming-pattern-in-elixir/ based on Scott Wlaschin stuff. - https://wiki.haskell.org/All_About_Monads https://wiki.haskell.org/All_About_Monads. The introductory part (7 first pages of the pdf). - Brian Beckman: Don't fear the Monad https://www.youtube.com/watch?v=ZhuHCtR3xq8 https://www.youtube.com/watch?v=ZhuHCtR3xq8 - Philip Wadler's "Monads for Functional Programming" at http://homepages.inf.ed.ac.uk/wadler/papers/marktoberdorf/baastad.pdf http://homepages.inf.ed.ac.uk/wadler/papers/marktoberdorf/ba... - HN comment: https://news.ycombinator.com/item?id=16446139 https://news.ycombinator.com/item?id=16446139 ROP is a good way to introduce the Either monad without ever talking about monads, functors and co. Moreover it is highly useful.
- cabalamat 5y agoMy takeaway from all this is that monads are kinda hard to explain. If something is hard to explain, that further suggests to me that it's probably the wrong abstraction. (Personally I find the railway abstraction makes a lot of sense, but maybe that's just me.)
- SquishyPanda23 5y agoThere is an element of truth to this, but they are easier to use than explain. Part of the hardness comes from people wanting to use monads as an entry point to category theory.
- ModernMech 5y agoPeople get hung up on the terminology, but I’ve found if you don’t use the words functor and monad and just focus on the actual use case, second year college students learning functional programming for the first time can grok this concept. The way I have found success is to have them write a program first where a monad would be useful, and then ask them to implement it without monads. They will identify the need for a monad themselves, and then you can show them the tool they want. Then they use it to solve the problem, and at that point you start giving them a more rigorous theory.
- armchairhacker 5y agoThis is basically exactly how I understand functor/applicative/monad. I wonder how well it explains to someone whose not as familiar.
- ninkendo 5y agoI'm someone who doesn't understand monads, and the tutorial basically lost me at "Just what is a Functor, really? Functor is a typeclass. Here's the definition" Where typeclass links to this other massive tutorial and then my eyes started to glaze over. (Side note, this is probably the 50th or so Monad tutorial I've read and I still don't understand them. For context, I've been programming professionally for nearly 20 years now. My only conclusion at this point is either Monads aren't actually that important, or I actually do understand some useful subset of what Monads are and I just don't know it, and I just never had a need to use them "fully".) Edited to add: I think my problem with Monad tutorials is that they all tend to explain the concepts using Haskell, and I can't read Haskell. It syntax is utterly impenetrable to me and I have no idea what any of the silly symbols mean. And any tutorial that tries to teach Monads using other languages ultimately feels like it's teaching me something I don't need to know... (how to do side effects in a pure functional language, when I don't code in pure functional languages and likely never will.)
- handsaway 5y agoThere are a good deal of resources explaining these concepts in non-Haskell languages. This one is quite good and in javascript: https://github.com/MostlyAdequate/mostly-adequate-guide https://github.com/MostlyAdequate/mostly-adequate-guide As far as functors this could be rephrased more comprehensibly to those unfamiliar with Haskell as "What is a Functor, really? Functor is an interface here are some definitions:" (typescript) interface ArrayFunctor<A, B> { map: (f: ((a: A) -> B), arr: Array<A>) -> Array<B> } interface PromiseFunctor<A, B> { map: (f: ((a: A) -> B), arr: Promise<A>) -> Promise<B> } interface ObservableFunctor<A, B> { map: (f: ((a: A) -> B), arr: Observable<A>) -> Observable<B> } "definitions" is plural here because typescript doesn't support higher-kinded types or else it might look like this: interface Functor<F, A, B> { map: (f: ((a: A) -> B), arr: F<A>) -> F<B> } (note, there are ways around this used in the fp-ts library, see here: https://www.matechs.com/blog/encoding-hkts-in-ts4-1 https://www.matechs.com/blog/encoding-hkts-in-ts4-1) > I actually do understand some useful subset of what Monads are and I just don't know it This is certainly the case if you have ever used flatMap on an array or chained Promises (or other async structures like futures in other langs).
- tromp 5y agoI cringed a little when, in the example of fmap (+3) (Just 2), they call (Just 2) a functor. After just having explained that a functor is a typeclass. So Maybe is a functor, but it feels weird to call values of type (Maybe a) functors as well. Monad tutorials often avoid this problem by talking about monadic values, so perhaps in this example it could be called a functoric value?!
- TheMatten 5y agoI think "functorial" may be the right word - try https://en.m.wikipedia.org/wiki/Functoriality https://en.m.wikipedia.org/wiki/Functoriality
- tromp 5y agoWould that make "monadial" the right word for monadic values?!
- TheMatten 5y agoI usually see "monadic" - I mean, I don't think that spelling of words in general tends to be tied to their meaning in specific contexts.
- tel 5y agoMonadic/functorial are the adjective forms of monad/functor. You might say that "List has a monadic nature". This is hinting at the idea that List by itself isn't really a Monad, but instead (List, pure, bind) is. The op is talking about something different, though. What is a term for List Int, a concrete type instead of a type constructor. We cannot call List Int a Monad, we cannot even call (List Int, pure_Int, bind_Int) a Monad. The definition really requires polymorphism. But, obviously, List Int is closely related to the List-Monad. I've also heard "monadic value" used. I tend to just use "monad" even though I know it's an even greater abuse of language.
- throwaway81523 5y ago
- hardwaresofton 5y agoThis absolutely takes me back -- this is one of the best easily-approachable guides to Monads I've ever seen. Similar to Learn You A Haskell For Great Good (colloquially "LYAH"), even if it's not the most in-depth or complete, it's the first thing I often send
- dailyanchovy 5y agoSo in the last illustration with all three concepts in a row, why does the monad change the wrapped 2 to a 3 that gets shoved into the function? What makes the 2 turn into a 3?
- Twisol 5y agoThat looks like a... whatever the graphical analogue of a typo is. It seems they mostly reused assets from earlier in the page for that summary.
- dailyanchovy 5y agoAhh, thanks for the reassurance!
- Zababa 5y agoI wish people would say map instead of fmap, as fmap is Haskell-specific, and map exists in lots of other languages.
- wlamartin 5y agoSeems like this would be a bit confusing though? `fmap` (flatMap) corresponds to `bind` or `chain` (Monad) rather than `map` (Functor) right?
- Twisol 5y agoNo, "fmap" is actually the name in Haskell given to the function defined by the Functor typeclass. It was named "fmap" ("f"unctor map) because "map" was already taken by the map specialized to lists.
- pwm 5y agoNope, `fmap` is indeed short for functor map. It's a historical accident in Haskell as `map` was specialised for lists (ie. `[]`) from the start and later, when mapping would be generalised to all things Functorial, it needed a new name so as to not break everything, hence `fmap`.
- wlamartin 5y agoAwesome thank you for the clarification. I extra agree with the confusion then since `fmap` sounded exactly like `flatMap` to me!
- sfvisser 5y ago`flatMap` is actually called `concatMap` in Haskell, or more generically the monadic bind operator `>>=`.
- cabalamat 5y agoIf the examples are in Haskell, it should definitely use the Haskell term, so that people can then run the code. An alternate might be to have examples in multiple languages, colour-coded.
- k__ 5y agoI read this example years ago, and it didn't clear anything up for me. After half a year of trying to understand monads, I saw a video by MPJ/Funfunfunction [0] and it finally made sense. [0] https://www.youtube.com/watch?v=9QveBbn7t_c https://www.youtube.com/watch?v=9QveBbn7t_c
- dogsandcats 5y agoHonest beginner question: Why wouldn't I just unwrap the values first and then do computation with the unwrapped values? I get how Maybe types can be useful for parsing something or doing IO but once you get your Maybe value, wouldn't be the first action to unwrap it? If it is Nothing you can either provide a default value or just stop right there. I don't see the sense of dragging the Nothing further done with you and having to deal with potential nothingness further done the stack even if you have the tools to make it look nice. Maybe there are other functors where this makes more practical sense?
- tel 5y agoIn general, the monad use case doesn't assume that there's the possibility of "unwrapping". For Maybe it's fine and can be used to replicate monadic functionality. But there are other functors/monads, as you suggest, which make less sense. Here's a pretty odd one: data Needs r a = Needs { execute :: (a -> r) -> r } In other words, a value x :: Needs Int String is a computation which can return an Int if you provide it a means to convert a String into an Int. You might conceptually say that it will give us a "complex" or composite "view" into values of type String given a "simple" or "atomic" view. For instance, length (execute x) length :: Int This type seems as though it almost certainly "contains" a value of type a (or String in the concrete example above). It might actually contain many such values. Here are three examples, the first two are the cases mentioned above. The third is similar to the None case with Maybes. ex1 :: Needs (\view -> view "Hello, world") -- contains one string ex2 :: Needs (\view -> view "Hello, " + view "world") -- contains two strings ex3 :: Needs (\view -> 0) -- contains no strings We could also imagine more exotic manipulations occurring inside of the Needs. For example ex4 :: Needs (\view -> let n = view "Hello" in view (repeat n "world, ") \* n + 10) It should also be clear that there's no way to "unwrap" a value of type Needs R A. This is obviously true if R and A are different types. You actually could imagine using mutable state, like a mutable vector v, to view all the As stored inside of a Needs (execute ex4) (\a -> { push v a; () }) -- not really Haskell syntax But this throws away all of that repeat and * and + nonsense in ex4. It's not really the same as a true "unwrap". But Needs is still a monad. pure :: a -> Needs r a pure a = Needs (\view -> view a) (>>=) :: Needs r a -> (a -> Needs r b) -> Needs r b m >>= f = Needs (\view -> execute m (\a -> execute (f a) view)) So, Needs is an example of a Monad which cannot in general be unwrapped. Working with it is a little complex in most cases, but the monad operations help to consolidate a couple very common, useful operations on Needs. Finally, I'll give up the ghost and note that Needs is known as the Continuation-Passing Monad. It helps you write code in CPS style without having to actually, deliberately pass continuations all around. This can be really useful for a few dumb-programmer tricks, but it's also a pretty useful framework for building embedded domain-specific languages.
- bern4444 5y agoI recently wrote an article[0] about implementing a new Monad. It starts off with a simple premise and solution that slowly builds up the use case to the point where something more complex is needed to satisfy additional capabilities but also a more ergonomic system which eventually leads into creating a new type of monad. I find this approach can make understanding the intuition behind monads more approachable. [0] https://sambernheim.com/#/blog/building-a-monad https://sambernheim.com/#/blog/building-a-monad
- s_dev 5y agohttp://learnyouahaskell.com/chapters http://learnyouahaskell.com/chapters
- chobytes 5y agoI dont think I understand how this concept has acquired such gravity... but I think Im coming around to appreciating that it does. Almost anything that inspires this many people to be interested in learning, teaching, and talking about math cant be a bad thing.
- Zababa 5y agoMonads aren't really about math, just like OO isn't really about objects in the real life, it's just inspired by them. Learning more about object in real life doesn't help much when doing OO, just like learning more about math doesn't help much when using monads in programming.
- chobytes 5y agoI agree that in principle one ought to be able to do without thinking explicitly about logic, algebra, etc... but is that how it really goes in practice?
- Zababa 5y agoIt's not, and I think that's why some people take a long time "getting" monads. Lots of tutorials online spend a lot of time talking about category theory to introduce monads. You can see the opposite view in things like this: http://dev.stephendiehl.com/hask/#eightfold-path-to-monad-satori http://dev.stephendiehl.com/hask/#eightfold-path-to-monad-sa....
- coldtea 5y agoIs this a mistake/typo in the article? > Just 20 >>= half >>= half >>= half Nothing
- bradrn 5y agoNo: it goes Just 20 → Just 10 → Just 5 → Nothing, because 5/2 can’t be represented as an integer.
- coldtea 5y agoAh, it's integral division. I'd expect some kind of expection in that case. This sounds like a dangerous example of monads (since you don't know if you had a Nothing value up in the chain or a valid value that can't be representated)!
- bradrn 5y ago> I'd expect some kind of expection in that case. Sorry, what exactly do you mean by ‘expectation’ here? > This sounds like a dangerous example of monads (since you don't know if you had a Nothing value up in the chain or a valid value that can't be representated)! Well, this particular case is of course oversimplified. There’s plenty of ways of dealing with different kinds of errors. The easiest is to define a sum type of errors: data DivisionError = ValueMissing | NonIntegralValue Then redefine the function to return an ‘Either DivisionError Int’: half x | even x = Right (x `div` 2) | otherwise = Left NonIntegralValue Now chaining several calls to ‘half’ will abort at the first error.
- xojoc 5y agoOther threads: https://news.ycombinator.com/item?id=10265013 https://news.ycombinator.com/item?id=10265013 [2015-09-23] (53 comments) https://news.ycombinator.com/item?id=5731164 https://news.ycombinator.com/item?id=5731164 [2013-05-19] (125 comments) https://www.reddit.com/r/programming/comments/1cobpl https://www.reddit.com/r/programming/comments/1cobpl [2013-04-19] (87 comments) https://www.reddit.com/r/haskell/comments/1co0s5 https://www.reddit.com/r/haskell/comments/1co0s5 [2013-04-19] (67 comments) All discussions: https://discussions.xojoc.pw/q/https%3A//adit.io/posts/2013-04-17-functors%2C_applicatives%2C_and_monads_in_pictures.html https://discussions.xojoc.pw/q/https%3A//adit.io/posts/2013-... Discussions with similar title: https://discussions.xojoc.pw/q/Functors%2C%20Applicatives%2C%20and%20Monads%20in%20Pictures%20%282013%29 https://discussions.xojoc.pw/q/Functors%2C%20Applicatives%2C... Archive: https://archive.md/newest/https://adit.io/posts/2013-04-17-functors,_applicatives,_and_monads_in_pictures.html https://archive.md/newest/https://adit.io/posts/2013-04-17-f...