[project @ 1997-05-18 04:19:21 by sof]
authorsof <unknown>
Sun, 18 May 1997 04:19:21 +0000 (04:19 +0000)
committersof <unknown>
Sun, 18 May 1997 04:19:21 +0000 (04:19 +0000)
getLine defined in terms of hGetLine

ghc/lib/ghc/PrelIO.lhs

index 0d99d24..24bf95b 100644 (file)
@@ -43,10 +43,7 @@ getChar         :: IO Char
 getChar         =  hGetChar stdin
 
 getLine         :: IO String
-getLine         =  do c <- getChar
-                      if c == '\n' then return "" else 
-                         do s <- getLine
-                            return (c:s)
+getLine         =  hGetLine stdin
             
 getContents     :: IO String
 getContents     =  hGetContents stdin