2005-05-13 01:58:07 +00:00
|
|
|
{-# GLOBALOPTIONS -package mtl #-}
|
2005-04-24 08:51:33 +00:00
|
|
|
-- illustrates the use of static options in pragmas
|
|
|
|
|
|
|
|
import System.IO.Unsafe
|
|
|
|
import System.IO
|
|
|
|
import System.Process
|
|
|
|
|
|
|
|
resource = unsafe { field = date }
|
|
|
|
|
|
|
|
-- illustrates the use of the devil's work
|
|
|
|
date :: String
|
|
|
|
date = unsafePerformIO $ do
|
|
|
|
(_,outh,_,proc) <- runInteractiveProcess "date" [] Nothing Nothing
|
|
|
|
waitForProcess proc
|
|
|
|
s <- hGetContents outh
|
|
|
|
return s
|
|
|
|
|