1 module Main ( main ) where
5 wrapup (_ccall_ printf ``"%d\n"'' (pass (14::Int)))
8 do_actions :: [IO ()] -> IO ()
9 do_actions = foldr thenIO_ (returnIO ())
12 wrapup :: IO_Int# -> IO a
14 instance Wrapper () where
15 wrapup a = a `thenIO_Int#` \ _ -> returnIO ()
17 instance Wrapper Int where
18 wrapup a = a `thenIO_Int#` \ x# -> returnIO (I# x#)
20 instance Wrapper Char where
21 wrapup a = a `thenIO_Int#` \ x# -> returnIO (toEnum (I# x#))
23 instance Wrapper Bool where
24 wrapup a = a `thenIO_Int#` \ x# -> returnIO (x# /=# 0#)
29 instance Pass Int where
32 instance Pass Char where
33 pass c = pass (fromEnum c)
35 instance Pass Bool where
40 usleep :: Int -> IO ()
42 sleep t = wrapup (ccall sleep (pass t))
43 usleep t = wrapup (ccall usleep (pass t))