Hacker News new | past | comments | ask | show | jobs | submit login

There's nothing Haskell specific about those concepts. In fact, the first three where developed by mathematicians long before Haskell even existed.



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.


Sure, 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.


Just 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.


True, but imo Haskell I/O was less than pretty before monadic IO came along: https://stackoverflow.com/a/17004448




Join us for AI Startup School this June 16-17 in San Francisco!

Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: