Created
May 31, 2014 23:05
-
-
Save aostiles/fb8d5e22881cdb05e5fa to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
module IHaskell.Eval.RIO (RIO(), runRIO, IHaskell.Eval.RIO.putStrLn, IHaskell.Eval.RIO.putStr,MyGhcMonad) where | |
import qualified System.IO | |
import GHC | |
-- Notice that symbol UnsafeRIO is not exported from this module! | |
newtype RIO a = UnsafeRIO { runRIO :: IO a } | |
type MyGhcMonad = GhcT RIO | |
instance Monad RIO where | |
return = UnsafeRIO . return | |
(UnsafeRIO m) >>= k = UnsafeRIO $ m >>= runRIO . k | |
putStrLn :: String -> RIO () | |
putStrLn s = UnsafeRIO (System.IO.putStrLn s) | |
putStr :: String -> RIO () | |
putStr s = UnsafeRIO (System.IO.putStr s) | |
print :: Show a => a -> RIO () | |
print s = UnsafeRIO (System.IO.print s) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment