6 May 2003 19:52
getContents/hGetContents bug?
Amanda Clare <afc <at> aber.ac.uk>
2003-05-06 17:52:52 GMT
2003-05-06 17:52:52 GMT
Hello nhc-team,
The following doesn't work under nhc98 1.14 (made with hmake 3.05)
[afc <at> pcburum mipsmanual]$ nhc98 --version
/usr/local/funcprog/bin/nhc98: v1.14 (2002-06-13)
[ config: ix86-Linux/ghc by malcolm <at> pc173 on 13 Jun 2002 ]
The program does nothing, and returns immediately without waiting for
input. Just using getContents does the same.
--------------------------
module Main where
import IO
parse accum [] = [accum]
parse accum ('*':cs) = accum:parse [] cs -- finished this expression
parse accum ('%':cs) = [accum] -- end input here
parse accum (c:cs) = parse (c:accum) cs
main = do text <- hGetContents stdin
putStr (unlines (parse [] text))
--------------------------
Amanda
RSS Feed