From: simonmar Date: Tue, 2 Oct 2001 11:09:55 +0000 (+0000) Subject: [project @ 2001-10-02 11:09:55 by simonmar] X-Git-Tag: Approximately_9120_patches~877 X-Git-Url: http://git.megacz.com/?a=commitdiff_plain;h=accc1381a865f51ad866e6b7c4bc927f1b7aacb7;p=ghc-hetmet.git [project @ 2001-10-02 11:09:55 by simonmar] Add a FAQ entry about using getContents in GHCi. --- diff --git a/ghc/docs/users_guide/ghci.sgml b/ghc/docs/users_guide/ghci.sgml index a82782f..3e900c4 100644 --- a/ghc/docs/users_guide/ghci.sgml +++ b/ghc/docs/users_guide/ghci.sgml @@ -1109,8 +1109,31 @@ Prelude> :set -fno-glasgow-exts properly with GHC's concurrency model. - + + After using getContents, I can't use + stdin again until I do + :load or :reload. + + + This is the defined behaviour of + getContents: it puts the stdin Handle in + a state known as semi-closed, wherein + any further I/O operations on it are forbidden. Because I/O + state is retained between computations, the semi-closed + state persists until the next :load or + :reload command. + + You can make stdin reset itself + after every evaluation by giving GHCi the command + :set +r. This works because + stdin is just a top-level expression that + can be reverted to its unevaluated state in the same way as + any other top-level expression (CAF). + + + +