summaryrefslogtreecommitdiff
path: root/docs/users_guide/ghci.rst
diff options
context:
space:
mode:
authorMatthew Pickering <matthewtpickering@gmail.com>2018-01-15 13:51:38 -0500
committerBen Gamari <ben@smart-cactus.org>2018-01-15 13:53:46 -0500
commit41afbb3f20f3d84abacb37afcc5aa64b24c22da8 (patch)
treedafe640432f261442f596bf05e01b88e9ee51b80 /docs/users_guide/ghci.rst
parent2feed118413944cae8a4eed17365f40521f470db (diff)
downloadhaskell-41afbb3f20f3d84abacb37afcc5aa64b24c22da8.tar.gz
Add flag -fno-it
This flag stops ghci creating the special variable `it` after evaluating an expression. This stops ghci leaking as much memory when evaluating expressions. See #14336 Reviewers: bgamari Reviewed By: bgamari Subscribers: rwbarton, thomie, carter GHC Trac Issues: #14336 Differential Revision: https://phabricator.haskell.org/D4299
Diffstat (limited to 'docs/users_guide/ghci.rst')
-rw-r--r--docs/users_guide/ghci.rst14
1 files changed, 14 insertions, 0 deletions
diff --git a/docs/users_guide/ghci.rst b/docs/users_guide/ghci.rst
index eae98f7936..f5dcfe3962 100644
--- a/docs/users_guide/ghci.rst
+++ b/docs/users_guide/ghci.rst
@@ -1027,6 +1027,20 @@ The corresponding translation for an IO-typed ``e`` is
Note that ``it`` is shadowed by the new value each time you evaluate a
new expression, and the old value of ``it`` is lost.
+In order to stop the value ``it`` being bound on each command, the flag
+:ghc-flag:`-fno-it` can be set. The ``it`` variable can be the source
+of space leaks due to how shadowed declarations are handled by
+GHCi (see :ref:`ghci-decls`).
+
+.. ghc-flag:: -fno-it
+ :shortdesc: No longer set the special variable ``it``.
+ :type: dynamic
+ :reverse: -fno-no-it
+ :category:
+
+ When this flag is set, the variable ``it`` will no longer be set
+ to the result of the previously evaluated expression.
+
.. _extended-default-rules:
Type defaulting in GHCi