Monads and Gonads

Channel:Google TechTalks · Length:49:47 · Published:2013-01-16 · Views:148121

Watch on YouTube

Summary

Douglas Crockford's Google Tech Talk explains monads without category theory or Haskell, implementing them in JavaScript and tying them to Ajax and promises. He also touches on odd asides such as coloring code by scope.

Why HN recommends it

Often recommended as a demystifying monad talk in plain JavaScript, though some find it light on definitions.

what I thought to be one of DC's greatest talks — HN, 2016

Functional programming · Web development

Subtitles (excerpt)

DOUGLAS CROCKFORD: So I'm going to show you some code today. Ordinarily, I don't like talks with a lot of code in them, because I think they're tedious and boring. And this talk promises to be no exception. But code is the story. And so it's not possible to tell this otherwise. So the topic this morning is monads. Monads, what are monads? Monads are this strange, mysterious, weird, but powerful, expressive pattern that we can use for doing programming. And they come with a curse. The monadic curse is that once someone learns what monads are and how to use them, they lose the ability to explain it to other people. There's lots of evidence of this on the web. Go and search for monads tutorials, burritos, any of those things, and you're going to find a lot of really confusing material. So today I'm going to attempt to break that curse, and show you monads for what they actually are. So we're going to start with functional programming. If you can't do functional programming, then none of the rest of this is going to make sense. But I'm assuming you're all professionals, and this should not be difficult material. So there are two senses of the term functional programming. One of them simply means to program with functions, so we'll look at that first.

On Hacker News

The one thing that made monads clearer for me was this thing [VIDEO] Monads and Gonads It's probably condescending for haskellers because it shows that monads are not some enshrined primary concept but just a kind of dumb wrapper you can write in any language and you do when it's useful for you. — scotty79, 2019-10
also, this indirectly reminded me of what I thought to be one of DC's greatest talks: Monads and Gonads ( [VIDEO] ) — nnq, 2016-09
combobulate (alpha quality as of 10/22): source code outline/cliff notes. from github README.rst "Emacs package that provides a standardized framework for manipulating and navigating your source code using tree sitter's concrete syntax tree " -> [LINK] [LINK] with [LINK] then write a iterator/loop query for language(s) editing per [LINK] tad less installation heavy (sorta) but also makes use of t… — sargstuff, 2022-10
Javascript promises are a kind of monad. Douglas Crockford talks about this in his talk "Monads and Gonads" [1] [1] [VIDEO] — wenc, 2018-06
>The biggest real problem I’ve found with large “where” clauses is that they tend to have a lot of implicit dependencies on variables from the enclosing scope. For me it's always a toss up. I like to make things local where possible to give some indication that the definitions need not be looked over with a fine-toothed comb -- they aren't used extensively. On the other hand, it does often lead t… — clusmore, 2016-11

Related videos