4 ms·
> The I/O monad modifies the Universe that contains the set of all functions that comprise your program That sounds rather complicated. My way of thinking of
by tome 12y ago
> The I/O monad modifies the Universe that contains the set of all functions that comprise your program
That sounds rather complicated. My way of thinking of it is simpler than that. a -> IO b is just a function from a to b that can do some I/O. Nothing more complicated than that.
- wbillingsley 12y agoIt is (slightly) more complicated than that. Your return type is not b but IO b. Your callers will be performing functions that are defined on IO b with the result (such as bind)
- SamReidHughes 12y agoI recommend just regarding IO a as an action, or some description of an action, that returns a value of type a. And (>>=) constructs bigger actions by attaching continuations to actions.