3 ms·
Or just use the IO combinators directly (if there were exposed outside the typeclass instances).
by eru 12y ago
Or 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.