In contrast to the information in "learn you a haskell", on my windows system, ghci translates CTRL-D
to EOT
, not EOF
.
Thus, when I do something like:
input <- getContents
doSomething input
, where doSomething
is a function which consumes the input.
Doing that, I have to press CTRL-Z
to end my input text, which makes sense since getContents
is intended for process piping...
But if I repeat the above steps a second time, it fails because stdin
is closed.
So, while browsing System.IO, I could not find an alternative to getContents
, which would react on EOT
.
Do I have to write such a function myself or is it to be found in another package, maybe?
Btw, the version of GHCI, I use is 8.2.2
.
Also, I do not want single line processing. I am aware of getLine
but it is not what I want in this case.