April 2, 2026
Just DO it or <*> keep it?
Prefer do notation over Applicative operators when assembling records (2024)
Haskell fans feud: step-by-step “do” vs symbol soup — readability riot
TLDR: A blog advises using step‑by‑step “do” code to build records in Haskell for clarity, safer field ordering, and better error messages. The comments split: some want human‑readable steps and names, others prefer concise operator chains that highlight data structure—turning a tiny tip into a readability vs brevity showdown.
A tiny Haskell tip just detonated a big feelings bomb: the post says “use step-by-step ‘do’ code when building records,” not a one-liner full of operators. Translation: use the clear, named, line‑by‑line approach over the punctuation parade. Supporters cheer that ‘do’ reads like a recipe, survives field reordering, and gives friendlier errors. Critics say sometimes the structure matters more than the steps, and the operator style makes that crystal clear.
The thread split into two camps fast. Team Do framed it as compassion for future humans: fewer symbols, easier prompts, and fewer “oops, fields changed order” surprises. Team Applicative fired back: when you’re just assembling data, the constructor’s shape is the star and names are noise. One commenter even compared it to Swift’s named parameters—if names matter, spell them out; if not, keep it tight.
Drama highlights? People dunked on “operator soup” with jokes about needing a decoder ring, while others rolled eyes at turning every record into a diary entry. Someone wondered if this rule should spread beyond records to named arguments everywhere, and that lit the “readability vs concision” fuse all over again. Verdict: not settled—just deliciously spicy.
Key Points
- •The post advises preferring do notation over Applicative operators when assembling Haskell record values.
- •The guidance applies to both Monad and Applicative-only types; Applicative-only usage requires enabling the ApplicativeDo extension.
- •Do notation improves ergonomics and readability, especially when adding side effects like prompts alongside input.
- •Do-based record construction is order-insensitive; reordering record fields does not change behavior, unlike positional Applicative application.
- •Do notation with RecordWildCards and GHC’s -Werror=missing-fields yields clearer, targeted error messages when fields are missing.