module Main(main) where

import Shell (launch)
import System.Environment (getArgs)
import System.IO (IO, hPutStrLn, hGetLine, hFlush, hClose)

main :: IO ()
main = do
  (input,output,_) <- launch "ghci" ["ghci"]
  sequence $ take 7 $ repeat (hGetLine output) --Read 8 intro lines
  getArgs >>= (hPutStrLn input) . unwords      --Send arguments to process
  hFlush input                                 --Flush arguments
  hGetLine output >>= putStrLn                 --Print line from process
  hClose input                                 --Close input handle
--   putStrLn "Errors:"
--   hGetContents error >>= putStr


