3 ms·
Of 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 demo
by jamesfisher 12y ago
Of 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.