Monads and Gonads

Google TechTalks · 148K views · 2013 · 49:47

Open on YouTube

Functional programmingWeb developmenttalk

Why Hacker News recommends it

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

What it is

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.

Recommended by 2 HN commenters across 2 different months, 2013 to 2022.

What Hacker News said

Strong rec nnq · 2016-09 · on “In defence of Douglas Crockford”

also, this indirectly reminded me of what I thought to be one of DC's greatest talks: Monads and Gonads ( [this video] )

Strong rec scotty79 · 2019-10 · on “Learning Haskell is no harder than learning any other programming language”

The one thing that made monads clearer for me was this thing [this 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.

Cites pandler · 2015-08 · on “Show HN: Glow – Syntax highlighting for Clojure source code”

I'm unfamiliar with Clojure, but I rather liked Douglas Crockfords comment on code coloring (Lisp) based on scope rather than syntax. [this video]

Cites nnq · 2015-08 · on “The Beauty of Clojure”

...that's how chaining method calls end up working in most OO languages (take the Scala example in OP's article). And also in Javascript (I can't remember if there is something like `range` in js right now...): [1,2,3,4,5,6,7,8,9,10] .map(function (x) { return x + 2 }) .reduce(function (a, b) { return a + b }) so the "." in OOP ends up working like "->" or "->>". Heck, you can make the dot in OOP code behave like anything, even like monadic bind (`>>=` or `do` notation in Haskell), if you do OOP-style-monads in JS: [this video] (off-topic: this is also my main problem with OOP... the "." can actually end up meaning anything practically, as program logic is concerned, it's like some kind of "infin

Cites fizixer · 2016-01 · on “The Monad Challenges: Jump start your understanding of monads”

> Do I need to know Haskell? Yes. This is enough for me to reject this blogpost. No you don't need a specific language to implement any functionality that can be implemented by a turing-complete language. I watched Crockford's monad talk [1]. He used javascript. The only problem with that talk is that he spent about 10 seconds or less explaining what a monad is (and the rest of the talk on implementation issues and his own perspective, etc, etc). I'm still waiting for a good monad discussion without CT or Haskell. (this [2] and this [3] look promising, both in python) [1] [this video] [2] [LINK] [3] [LINK]

Cites clusmore · 2016-11 · on “Using Haskell to Find Unused Spring MVC Code”

>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 to implicit dependencies. It would be nice to have scope highlighting - color every identifier based on the distance from the scope it's defined in. This idea shamelessly stolen from Doug Crockford in [this video]

Cites wenc · 2018-06 · on “Railway-Oriented Programming (2015)”

Javascript promises are a kind of monad. Douglas Crockford talks about this in his talk "Monads and Gonads" [1] [1] [this video]

Cites sargstuff · 2022-10 · on “Ask HN: S/W development text editor have feature colorizing every iteration?”

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 tree-sitter syntax queries : [LINK] (neovim with treesitter syntax) blockman usage examples: [LINK] Alternative examples / takes (per user interface): ### embedding a block of source code in a document: ** carrotsearch.gethub.io/apidocs/code-blocks ** [LINK] ### 'colorize blocking' (vs space endenting