[Haskell-cafe] Re: Read a single char

Neil Mitchell ndmitchell at gmail.com
Tue Oct 24 18:31:19 EDT 2006


Hi

> Surely I can get along without getContents in WinHugs: last time I thought
> about
> it I just wanted to show getContents function to my students (and using
> hGetContents
> on a file handle seems to be better example). Another function that
> could be useful when teaching IO is 'interact', and it seems that it's also
> impossible to use it without typing EOF (am I right?).

You can use interact, you just have to hit the stop button to break
out of it. Interestingly Ctrl+C is captured by interact, as is
Ctrl+Z/Ctrl+D, so fixing it up to return -1 in these cases should be
pretty easy - i'll try and get that done tomorrow.

> And thank you for WinHugs, it is really useful!

Thank you :) - its nice to know that it is being used.

Neil


More information about the Haskell-Cafe mailing list