2 ms·
True! But one neat thing is that, if you have a black-box abstract data type then you can force people to use the provided Monad interface if they want to do st
by ufo 13y ago
True! But one neat thing is that, if you have a black-box abstract data type then you can force people to use the provided Monad interface if they want to do stuff with it. The IO monad does exactly this to create its "alternative realm"; there is no way to get "out" of IO once you get in , the only way to run an IO computation is to have it be directly or indirectly called by "main" and the only primitive way to compose IO computations is with the monadic combinators.