3 ms·
For the same reason, we should not say, "use the IO monad to do output". We should just say, "use IO to do output". You may not even need the monad instance fo
by jamesfisher 12y ago
For the same reason, we should not say, "use the IO monad to do output". We should just say, "use IO to do output".
You may not even need the monad instance for IO -- for example, you might just use its functor instance.
- eru 12y agoOr just use the IO combinators directly (if there were exposed outside the typeclass instances).
- jamesfisher 12y agoOf course! It turns out that GHC implements the Monad instance for IO by using `returnIO` and `bindIO` in `GHC.Base`. I played around with these as a mini demonstration of using IO in Haskell without any mention of monads: https://gist.github.com/jameshfisher/1d735b5267e8f848b280 https://gist.github.com/jameshfisher/1d735b5267e8f848b280
- dllthomas 12y agoIt's cute, but I think it's misleading to call it "non-monadic" - you're calling the same functions in the same way, just not through the Monad typeclass.