2 ms·
When mathematicians developed monads, they were doing abstract algebra. They were not using them as a kludge to (for example) impose sequence on functional pro
by AnimalMuppet 5y ago
When mathematicians developed monads, they were doing abstract algebra. They were not using them as a kludge to (for example) impose sequence on functional programming.
Having to use monads for sequencing is something that happens in Haskell and not in Rust.
- epolanski 5y agoJust to say, Haskell doesn't need monads to sequence computations, in fact Haskell as a programming language (1989) is older than Moggi's seminal paper on monads applied to programming in 1993.
- creata 5y agoTrue, but imo Haskell I/O was less than pretty before monadic IO came along: https://stackoverflow.com/a/17004448 https://stackoverflow.com/a/17004448
- creata 5y agoSure, I/O in Rust is a little easier because it's not wrapped up in an abstract type, but in exchange, Rust needs Try, async/.await and const-fn to solve just a few of the issues that monads solve in more generality. I don't think either choice is a kludge, it's just a bunch of trade-offs.