readRest :: ProcessHandle -> Handle -> String -> IO String
readRest cp out str = do
  mc <- myGetChar cp out
  case mc of
    Wait -> readRest cp out str
    Stop -> return str
    JustChar c -> readRest cp out $ c : str
readRest :: ProcessHandle -> Handle -> String -> IO String
readRest cp out str = do
  mc <- myGetChar cp out
  case mc of
    Wait -> readRest cp out str
    Stop -> return str
    JustChar c -> readRest cp out $ c : str
readRest cp out str = do
  mc <- myGetChar cp out
  case mc of
    Wait -> readRest cp out str
    Stop -> return str
    JustChar c -> readRest cp out $ c : str