Update from input by @lierdakil

This commit is contained in:
Alan Zimmerman 2015-10-01 08:54:13 +02:00
parent 1d370f5866
commit fc7b059f92
1 changed files with 8 additions and 8 deletions

View File

@ -502,15 +502,15 @@ legacyInteractiveLoop symdbreq world = do
, GHandler $ \(SomeException e) -> gmErrStrLn (show e) >> return ""
]
getFileSourceFromStdin :: IO String
getFileSourceFromStdin = do
let loop' acc = do
line <- getLine
if line == "\EOT"
then return $ intercalate "\n" $ reverse $ ((init line):acc)
else loop' (line:acc)
loop' []
linesIn <- readStdin'
return (intercalate "\n" linesIn)
where
readStdin' = do
x <- getLine
if x/="\EOT"
then fmap (x:) readStdin'
else return []
-- Someone please already rewrite the cmdline parsing code *weep* :'(
wrapGhcCommands :: (IOish m, GmOut m) => Options -> [String] -> m ()