|
|
|
|
|
by tome
348 days ago
|
|
This is not historically how Haskell was developed. Haskell didn't try to "avoid mutable state". Haskell tried to be (and indeed succeeded in being) referentially transparent. Now, it turns out that you can't uphold referential transparency whilst having access to mutable state in the "traditional" way, but you can access mutable state if you introduce monads as a means of structuring your computation. So, they're certainly not a means of getting around a limitation of the language. If it was just a limitation that limitation would have been lifted a long time ago! It's a means of preserving a desirable property of the language (referential transparency) whilst also preserving access to mutable state, exceptions, I/O, and all sorts of other things one expects in a normal language. See my comment here for a little bit more about the benefits of referential transparency: https://news.ycombinator.com/item?id=44448127 |
|
And if so, then it seems fair to say at least that monads were a way to get around the limitations imposed by a desirable feature of the language...