Re:Ask HN: What is the best Linux distro for a development l...
by Profpatsch on Sunday January 08, 2017 @07:24AM
(#13349422)
Even though it’s very much out of context for this thread, it’s a little pearl that brought me again a little bit closer to understanding. Thanks!
The IO monad, as in Haskell, can be viewed as an entirely pure construct. Its implementation is impure purely because of performance reasons. You can write your own completely pure IO type if you want, with unchanged semantics.
A basic example of this would be
Of course, now you need a way to interpret your IO type in order to make the machine actually do stuff. This can be achieved in two ways: You can modify the GHC RTS to allow it to interpret your IO type, or you can define an interpreter in Haskell to convert it to the IO type that the GHC RTS knows how to interpret