Simple Haskell program: main = getLine >>= print What would you expect Hugs to do with this if you run the program with an empty input stream? And what do you think Hugs does instead?-) For me, it loops, printing white space.. GHC gives me the end-of-file exception I expected, so this looks like a bug in Hugs? Claus
This problem is with runhugs not Hugs, right? Easy to reproduce (slightly different but still wrong output): $ cat > /tmp/foo.hs main = getLine >>= print $ cat /dev/null | runhugs /tmp/foo.hs ÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿ ÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿ... IIRC, end of file detection is scrogged in Hugs - but that mostly doesn't matter because Hugs is usually used interactively (where end of file doesn't readily occur). [Note: this is just to confirm details. I'm not working on a fix for this because I'm in the middle of something else - maybe someone else on this list could chase this up?] -- Alastair Reid reid@cs.utah.edu http://www.cs.utah.edu/~reid/
Thanks for reporting this; now fixed.
--sigbjorn
----- Original Message -----
From: "C.Reinke"
Simple Haskell program:
main = getLine >>= print
What would you expect Hugs to do with this if you run the program with an empty input stream? And what do you think Hugs does instead?-)
For me, it loops, printing white space..
GHC gives me the end-of-file exception I expected, so this looks like a bug in Hugs?
Claus _______________________________________________ Hugs-Bugs mailing list Hugs-Bugs@haskell.org http://www.haskell.org/mailman/listinfo/hugs-bugs
participants (3)
-
Alastair Reid -
C.Reinke -
Sigbjorn Finne