[Haskell-cafe] runInteractiveCommand
Dave Feustel
dfeustel at mindspring.com
Mon Apr 9 08:57:00 EDT 2007
I tried the code below with both ghc 6.2.2 and hugs march 2005.
ghc: "The last statement in a 'do' construct must be an expression"
Hugs ERROR "interactive.hs" - Can't find imported module "System.Process"
.
>----------------------------------------------------------------------------------
>import System.IO
>import System.Process
>
>eval :: String -> IO String
>eval s = do (_,hOutput,_,hProcess) <- runInteractiveCommand s
> sOutput <- hGetContents hOutput
> waitForProcess hProcess
> return sOutput
>----------------------------------------------------------------------------------
http://RepublicBroadcasting.org - Because You CAN Handle The Truth!
http://iceagenow.com - Because Global Warming Is A Scam!
More information about the Haskell-Cafe
mailing list