Microsoft's Brian Beckman gives an hour-long, whiteboard-style walk through monads, building from function composition and monoids using school-level math. It is aimed at practicing programmers rather than category theorists.
Why Hacker News points people here: HN repeatedly recommends it as the clearest and most correct beginner explanation of monads, with several commenters saying it finally made them click.
“This video is all you, as a practicing programmer, need to know about monads and it's just 1 hour long.”HN comment, 2015
“This video is all you, as a practicing programmer, need to know about monads and it's just 1 hour long.”
One hour covering all a practicing programmer needs to know about monads.
Full comment
To be fair, (I think) you don't need to know category theory to successfully apply FP principles and/or use any functional language. I had a great (GREAT) success at using erlang not only not knowing what monad is, but even not knowing about existence of category theory at all, leave aside monads, monoids, functors, etc. You also don't need to know category theory to understand what monad is [0] This video is all you, as a practicing programmer, need to know about monads and it's just 1 hour long. [0] this video
Strongly recommendskikaApr 2016
“I urge people spend an hour of their life and get the explanation of all this from someone who knows the math”
Plain-English explanation of functors and monads from someone who knows the math.
Full comment
I don't know category theory, so I defer to more knowledgeable people here, but that sounds strange: "Functor it understands how to take doStuff and execute it on the value inside itself, then spit out a new Optional. You don't lose the int-ness or optional-ness." So if I map a function, that takes an int and returns a string over an array of ints, this array stops being a functor? Or is it just a Swift thing? And, as always, I urge people spend an hour of their life and get the explanation of all this from someone who knows the math but still able to explain this in plain English: this video To the best of my limited knowledge, it's all 100% correct.
RecommendschongliDec 2012
“Here's a nice video that explains monads fairly simply”
Fairly simple explanation of monads as composable computations.
Full comment
Apples and oranges. A monad is just an idea; that of storing computations as values. This is useful because these computations can be composed together in a manner not unlike that of a pipeline in shell scripting. Different monads define different ways of composing these computations leading to vastly different semantics. Here's a nice video that explains monads fairly simply: this video
RecommendsemotionalcodeOct 2014
“I found this introduction to the concepts of functional programming (functional composition) to be useful”
Useful introduction to functional composition concepts for newcomers.
Full comment
> and apparently I'm never going to understand Haskell I found this introduction to the concepts of functional programming (functional composition) to be useful: this video Otherwise, it's just a different way of thinking about problems. Instead of building things structurally as an object of objects, and then creating functions that relate, transform, or describe the relationships between the object structures (like taking a pixel object, altering it's x coordinate, and returning the new pixel object with only the x coordinate altered), one has functions that can be composed with other functions to produce more complex object structures. A single base unit with a sequence of functional compositions can describe a very fancy, complex unit, with many fancy, complex characteristics. >> Monads have also been explained with a physical metaphor as assembly lines, where a conveyor belt transports data between functional units that transform it one step at a time.[2] They can also be seen as a functional design pattern to build generic types.[3] link Otherwise, it's syntax and semantics, which I generally find annoying, but there's always google and books. link
Recommendsl4mbdaMar 2015
“This whole video is worth watching”
Whole talk worth watching; includes simple monoid overview.
Full comment
This whole video is worth watching, but a simple monoid overview is here: this video It's not a difficult concept.
Recommendszabi_raufMay 2015
“it helped me in understanding the use case of monad and ultimately monad”
Helped commenter understand the use case of monads.
Full comment
I've seen the same video before i knew what a monad was, it helped me in understanding the use case of monad and ultimately monad. Monad is just a generalization of that particular use case. Some resources that helped me in understanding monads 1. Brian Beckman: Don't fear the Monad - this video 2. Functors, Applicatives, And Monads In Pictures - link 3. Three Useful Monads - link So its been not just one resource but multiple resource before it hit me that it was such a simple concept. So i would suggest to go over them (in order) and also look at other resources (mentioned by others).
RecommendskikaApr 2016
“I'd suggest a longer (1 hour) but much more correct explanation.”
Longer, more correct monad explanation needing only school-level math.
Full comment
I'd suggest a longer (1 hour) but much more correct explanation. It doesn't use math beyond high (or even may be middle) school. Video, unfortunately. this video
RecommendsRossBencinaDec 2016
“Brian Beckman did a nice intro video to this at MS Channel 9 a few years back.[1]”
Nice intro to monoids and function composition.
Full comment
In a Group, every element has an inverse element. If you drop this property, you get a Monoid.[0] Functions under function composition form a Monoid (or Monoidal Category). Brian Beckman did a nice intro video to this at MS Channel 9 a few years back.[1] [0] link [1] "Brian Beckman: Don't fear the Monad" this video
RecommendsmitchtyMay 2018
“For a more soft introduction to the concepts this channel 9 video is probably a bit better”
Softer introduction to monad concepts than the papers.
Full comment
Thats me here too! >.< Yeah the hidden subtext here was my presumption in that suggestion was someone was learning monads in Haskell and has at least a basic understanding of Haskell. Sorry if those papers threw you into the deep end. Monads really were thrown into play due to trying to make a pure functional programming language useful. I found the more mathematical explanation a lot easier than any analogies involving say burritos or pipes etc... At first glance to imperative programmers I will admit all of this just looks like a bunch of navel gazing. I thought the same thing, but once you let go of thinking of computation as a series of steps and at a bit of a higher abstraction this makes a lot more sense. For a more soft introduction to the concepts this channel 9 video is probably a bit better: this video Another option might be to just get the haskell programming from first principles book: link Does a good job grounding you up to monads and gives copious amounts of reference material. Even though I already knew haskell when I read the book it helped clear up some gaps I didn't know I had. But monads are going to be really weird no matter if all you've ever seen is imperative programming. Despite the fact that you already use them and have probably discovered them without knowing you did. Much like learning stack based programming languages, sometimes the only way up is to climb off the computational hill you're familiar with to learn another way to the other hill side
RecommendsomginternetsJun 2022
“I found Brian Beckman's video Don't Fear the Monad was extremely helpful for understanding monads as a practical user.”
Helped understand monads as a practical user without category theory.
Full comment
this video I found Brian Beckman's video Don't Fear the Monad was extremely helpful for understanding monads as a practical user. I now use them everywhere. I don't know the first thing about category theory.
RecommendslkutyJun 2024
“watching "Don't fear the Monad”
Appreciated alongside a monad tutorial.
Full comment
Good tutorial I think and I also appreciated reading the beginning of link and watching "Don't fear the Monad" this video
Cites itplatzJan 2014
“The bottom-up people start with the hardware and only add abstractions and trade performance where necessary”
Beckman's aside on bottom-up versus top-down programmer camps.
Full comment
As Brian Beckman explained, as an aside, in "Don't fear the Monad" [1], these two differing views were born in the '70s and split two programmers into two camps: The bottom-up people, and the top-down people: - The bottom-up people start with the hardware and only add abstractions and trade performance where necessary (fortran, c, java) - The top-down people started with perfect abstraction/logic and reduced/removed abstraction to get access to the hardware and performance where necessary (lisp, ml, haskell) I don't think the two camps may ever get along. Kind of like our version of Conservative and Liberal. (nor should they, in the true spirit of democracy?) [1] this video
Cites itplatzJul 2014
“Brian Beckman explained one such axis, as an aside, in "Don't fear the Monad" [1]”
Beckman's aside on bottom-up versus top-down programmer camps.
Full comment
I think there are several different axes one can split programmer culture down (which may or may not be orthogonal). Brian Beckman explained one such axis, as an aside, in "Don't fear the Monad" [1], about two differing views that born in the '70s and split two programmers into two camps: The bottom-up people, and the top-down people: - The bottom-up people start with the hardware and only add abstractions and trade performance where necessary (fortran, c, java) - The top-down people started with perfect abstraction/logic and reduced/removed abstraction to get access to the hardware and performance where necessary (lisp, ml, haskell) What is interesting these days, is that these two camps are trying to steal more and more ideas from each other [2] [1] this video [2] link (previous discussion: link )
Cites itlkutyOct 2021
One item in a list of monad learning resources.
Full comment
I would complement it with: - Scott Wlaschin's Railway Oriented Programming (ROP): link and link - Scott Wlaschin's The "Map and Bind and Apply, Oh my!" series at link and its concept of an "elevated world". - And for Elixir Programmers, Zohaib Rauf's "Railway Oriented Programming in Elixir" at link based on Scott Wlaschin stuff. - link . The introductory part (7 first pages of the pdf). - Brian Beckman: Don't fear the Monad this video - Philip Wadler's "Monads for Functional Programming" at link - HN comment: link ROP is a good way to introduce the Either monad without ever talking about monads, functors and co. Moreover it is highly useful.
Cites itmwattsunDec 2021
“I watched Brian Beckman: Don't fear the Monad ( ) but couldn't make heads or tails of it.”
Full comment
Right, I understand where I wasn't clear. You're right, that idea has won and gone mainstream so I didn't think it was worth mentioning. I was emphasizing that I thought immutable data structures were inefficient and that it was the luxury of academics to abstract away stateful changes in the name of purity. I've got a couple of other ideas that I need to do more research on (I'm watching Erik Meijer videos today) 1) Class objects with methods and data are like small programs, so I don't get why people go on and on about having data structures with functions as being superior to class objects, which are essentially data structures with associated functions. 2) Similarly, Joe Armstrong seems to hate object oriented programming but Erlang instances are essentially class objects, albeit running in their own process so they have more isolation 3) From reading Erik Meijer's Confessions of a Used Programming Language Salesman, I'm assuming that Async/Await that he help put in C# and Dart are his attempt to bring Haskell continuation monads to the imperative world 4) I'm assuming Clojure Atoms and Actors are like Haskell monads but don't know that. I watched Brian Beckman: Don't fear the Monad ( this video ) but couldn't make heads or tails of it. Something about functions calling first order functions and pure first order effects with stateful second order effects, or something... That was a few years ago so I will give it another chance. I'm probably wrong about these ideas but they'
Critical88e282102ae2e5bJul 2015
“The guy basically goes on some pseudo-mathematical journey that has only a tangential relationship with programming.”
Full comment
Take videos like this: this video The guy basically goes on some pseudo-mathematical journey that has only a tangential relationship with programming. "It's easy to understand!" he claims multiple times. And it was! I understood everything he said. But I had NO idea how to apply anything he said to my application. And so it goes with virtually every article I've ever read about functional programming. The truth is out there, but it's hidden in such a dense forest of obfuscation that I'm not sure I'll ever know what a monad is. The search goes on, but I'm afraid all I'll ever discover is yet another blog post where all the functions are named f(), g() and h(), or something about prime numbers. So I suppose arrogance may be assumed from seeing this concept explained so badly so many times. It's like people who understand functional programming are gatekeepers and do such a horrible job at letting people in that it seems like we've been locked out on purpose.