3 ms·
You're misunderstanding Haskell and do-notation. Haskell does not "[attempt] to appear imperative to be palatable to more people". Haskell has to have a way of
by noelwelsh 7y ago
You're misunderstanding Haskell and do-notation. Haskell does not "[attempt] to appear imperative to be palatable to more people".
Haskell has to have a way of handling effects because no useful program can be written without effects. Even if that is as simple as printing output on completion, that is still an effect. Haskell furthermore needs to integrate effects into the language in such as way it does not break the substitution model of evaluation because 1) that's the goal of Haskell as defined back in 1992-ish and 2) order of evaluation is hard to reason about in a lazy language. Monads are Haskell's solution to this, and do-notation is syntax that makes monads easier to use. There is nothing here to do with popularity.
Furthermore, claims that "Imperative programming is the most natural thing for people" is not true. All programming is an artificial construction. There is no "naturalness" to be found here, only familiarity and prior experience. In my experience non-programmers take easily to functional programming. Experienced imperative programmers may struggle a bit.