Skip to content
TopicTracker
From HackerNewsView original
TranslationTranslation

Incorporate Monads and Category Theory

This GitHub issue discusses incorporating monads and category theory concepts into the Promises/A+ specification, with community debate about their relevance and applicability to the JavaScript promises standard.

Background

- Promises/A+ is the spec behind JavaScript Promises, the standard async mechanism in JS (browsers, Node.js). This GitHub issue is a famous early-2010s design debate. - "Monads" and "Category Theory" are abstract math concepts that some programmers use as design patterns. The question: should JS Promises be strict monads (guaranteeing algebraic properties like associativity of `.then()`)? - The debate reflects a larger split: formal mathematical rigor vs. pragmatic ease of use for working engineers. Promises/A+ chose the latter — Promises are "monad-like" but not strict monads. - Key participants: Brian McKenna (pushing for Haskell-style monadic purity) vs. Domenic Denicola and other spec authors (defending practical flexibility). The outcome shaped how millions of JS developers write async code.