Top all-time · #15802
Martin Wernstål
Personal blog · m4rw3r.github.ioprogramming
Martin Wernstål writes m4rw3r, a personal blog at m4rw3r.github.io about programming. Since 2016, 5 different Hacker News readers have linked it 5 times, most often “Rust and the Monad trait – Not just higher kinded types”. The last post was in 2016, but the archive is still widely read.
Too few sampled comments (4) to say how often HN recommends it.?
Why HN links it
HN readers link this blog's posts on Rust's ? operator as a reference for error handling and how it compares to monads. Comments cite it as a source rather than praising it.
Summarised by Claude from a sample of 4 HN comments that link here. Each comment is marked recommending, critical or neutral (citing without judging); how this works.
Most-linked posts?
- /rust-questionmark-operator2 people · 2 mentions · first linked 2016-12-22
- Rust and the Monad trait – Not just higher kinded types2 people · 2 mentions · first linked 2017-12-18
What Hacker News says?
Rust error handling can be concise thanks to the try! macro, but macros bring their own problems (like making more difficult to write refactoring and static analysis tools). Haskell error handling can be concise thanks to monads, but they need higher kinded types which bring their own share of complexity. The conversation on the "RFC: Stabilize catch_panic", found on Rust's issue tracker, illustrate some unsettled q…
Comment linking /rust-questionmark-operator/
on “Visual Studio Code for Go”Submitted Rust and the Monad trait – Not just higher kinded types as a story · 2 points
HN discussionThe "?" operator looks like a more specialized, error/success-specific version of monads. Has there been any discussion about generalizing everything into monad-style chaining operators? I see that there is some discussion here [1], including a suggestion to add a Haskell-style "do" block. But that's just one guy's blog post. [1] https://m4rw3r.github.io/rust-questionmark-operator .
Comment linking /rust-questionmark-operator
on “Announcing Rust 1.14”There are strong technical reasons why writing a monad abstraction in Rust is particularly hard[1], and to my knowledge nobody has found a way to do so whilst preserving fairly basic properties like being able to use loops or avoid allocations. Using "?" with appropriate traits is much simpler (important for understandability), more globally applicable (important to be general) and preserves ease of important reason…
Comment linking /rust-and-monad-trait
on “Escaping Hell with Monads (2017)”Right. I think Rust was the first to propose “?” operator as a syntactic sugar to Result and Option monads. (i am not 100% though) ref: https://m4rw3r.github.io/rust-questionmark-operator
Comment linking /rust-questionmark-operator
on “Optional Value Handling in Nim”