by bbcbasic · 9y ago · 0 comments
Haskell has no state support built in, it is all delegated to libraries.
So:
C++ has excellent IO support, but the language doesn't embrace IO at all.
Haskell has excellent State support, but the language doesn't embrace State at all.
f(cout << x, cout << y)
where we don't know whether x is sent to cout first or y.C++ statements could be added to C++ (e.g. as a compiler extension). They would be straightforward to use; C++ doesn't inherently reject that the way Haskell and its ilk reject sequencing and state.
Someone who understands where that support is and how to use it should rewrite atrocities like:
https://rosettacode.org/wiki/Assigning_Values_to_an_Array#Ha...
arr ^. ix 2
vs the original: readArray arr 2