typelead / eta-hackage

A set of patches to make Hackage compatible with the Eta language.
64 stars 31 forks source link

Sending input to spawned process hangs #62

Open rahulmutt opened 6 years ago

rahulmutt commented 6 years ago

From: https://lotz84.github.io/haskellbyexample/ex/spawning-processes

import System.Process
import System.IO

main :: IO ()
main = do
    (Just hin, Just hout, _, _) <- createProcess (proc "grep" ["hello"]){ std_in = CreatePipe, std_out = CreatePipe }
    hPutStr hin "hello grep\ngoodbye grep"
    grepBytes <- hGetContents hout
    putStrLn "> grep hello"
    putStrLn grepBytes

should give

> grep hello
hello grep

but gives

> grep hello
[hangs]