3 data RealWorld = RealWorld
4 data IO a = IO (RealWorld -> (RealWorld, a))
9 instance Functor IO where
11 fmap f x = x >>= (return . f)
13 instance Monad IO where
15 return x = IO (\s -> (s, x))
18 (IO m) >>= f = IO (\s -> do
25 runIO m = snd (unIO m RealWorld)
27 main = runIO (return (13 :: Integer))