3 ms·
Merely quoting Simon Peyton Jones and Philip Wadler in their paper from 1993 "Imperative Functional Programming" [1]. Chaining monadic binds with a `do` is the
by zak_mc_kracken 13y ago
Merely quoting Simon Peyton Jones and Philip Wadler in their paper from 1993 "Imperative Functional Programming" [1].
Chaining monadic binds with a `do` is the textbook example of imperative programming (it's actually the very reason why the keyword 'do' was chosen for syntactic sugar, because it captures perfectly the imperative aspect: "do this and in this order").
You seem to think it's a bad word but I really don't understand that. Haskell is both functional and imperative, there's really nothing wrong about it.
[1] http://research.microsoft.com/en-us/um/people/simonpj/Papers/imperative.ps.Z http://research.microsoft.com/en-us/um/people/simonpj/Papers...
- nbouscal 13y agoHuh. We clearly mean different things by "imperative programming". To me, sequential computation is a necessary but really-far-from-sufficient aspect of imperative programming. A monadic expression is still an expression, not a statement. It is still referentially transparent. I don't know how you can look at a referentially transparent expression and call it imperative other than by being very liberal with your definitions.