Import hs-plugins cvs
This commit is contained in:
17
examples/makewith/unsafeio/Unsafe.conf
Normal file
17
examples/makewith/unsafeio/Unsafe.conf
Normal file
@ -0,0 +1,17 @@
|
||||
{-# GLOBALOPTIONS -package posix #-}
|
||||
-- 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
|
||||
|
Reference in New Issue
Block a user