
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!

On Apr 9, 2007, at 8:57 , Dave Feustel wrote:
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"
The indentation got mangled. Reindent the lines of the "do" so they line up:
eval s = do (_,hOutput,_,hProcess) <- runInteractiveCommand s sOutput <- hGetContents hOutput (...)
-- brandon s. allbery [solaris,freebsd,perl,pugs,haskell] allbery@kf8nh.com system administrator [openafs,heimdal,too many hats] allbery@ece.cmu.edu electrical and computer engineering, carnegie mellon university KF8NH
participants (2)
-
Brandon S. Allbery KF8NH
-
Dave Feustel