News for hackers. Stuff that matters.
Re:Standard ML in 2020 by fanf2 on Monday October 26, 2020 @01:18PM (#24898560)
The classic paper Imperative Functional Programming https://www.microsoft.com/en-us/research/publication/imperat... introduced the IO monad and explained that its internals are based on passing around the state of the world. The monad hides the world and keeps it linear. The compiler (ghc) optimizes out the world so that it is implicit in the compiled program. I believe this is still the way that ghc works.
Re:Standard ML in 2020 by marcosdumay on Tuesday October 27, 2020 @12:03AM (#24904386)
Oh, yes, the stdlib does pretend the world is a piece of data. But it does a very good job on keeping this hidden from any developer, so this is more of a compiler design that does not leak into the language.