3 ms·
The fact that something called "ST" is one of the most important libraries in the language, and it's the one that you should choose for State (leave aside the "
by gowld 9y ago
The fact that something called "ST" is one of the most important libraries in the language, and it's the one that you should choose for State (leave aside the "State" library! that's not the one you want!) shows how for all Haskell's power, it's terribly unusable for trivial reasons that never get fixed due to extreme deference to legacy mistakes. See also: Prelude.
- tome 9y agoIt's not one of the most importart libraries in the language. It's hardly used.
- tathougies 9y agoST is not the monad that should be used for state. You should use State for that. ST is an optimization trick mainly used by framework implementors. In my professional experience writing Haskell, I’ve never seen st used for anything important
- dllthomas 9y ago"mainly used by framework implementors" IMO it's data structures and algorithms - specifically those where mutation gives substantial speed improvement (which isn't all by any stretch) - more than "frameworks" as typically conceived...
- gowld 9y agoI wouldn't call "mutable arrays" an optimization trick mainly used by framework implementors, or "not important" https://wiki.haskell.org/Arrays https://wiki.haskell.org/Arrays
- efnx 9y agoI’ve never had to use ST. I most definitely meant State, which is what I wrote in the grandfather post.