News for hackers. Stuff that matters.
Re:Are Monads a Waste of Time? by quchen on Tuesday February 20, 2018 @08:33AM (#16420147)
Haskell has the ST type for this, which is a stripped version of IO in which we can still make proper mutable inplace updates like in other languages, but there is a »runner« function called »runST«, which guarantees that the computation it contains does not leak any state to the outside – in other words, »runST <impure>« is pure from the outside. This allows embedding of mutable algorithms, e.g. inplace sorting of vectors, into pure code.

There are no comments on this comment yet.