[commit: ghc] master: Clean up the handling of the import and :module commands in GHCi (79d6745)
Simon Marlow
marlowsd at gmail.com
Fri Aug 26 23:52:29 CEST 2011
Repository : ssh://darcs.haskell.org//srv/darcs/ghc
On branch : master
http://hackage.haskell.org/trac/ghc/changeset/79d6745f66c678de5e104b2146d3dd3e2f006c3e
>---------------------------------------------------------------
commit 79d6745f66c678de5e104b2146d3dd3e2f006c3e
Author: Simon Marlow <marlowsd at gmail.com>
Date: Fri Aug 26 16:36:05 2011 +0100
Clean up the handling of the import and :module commands in GHCi
Previously we remembered the whole history of commands and replayed
them on every :load/:reload, which lead to some non-linear performance
characteristics (#5317). The handling of the implicit Prelude import
and the implicit imports of recently loaded modules was also
complicated and wrong in various obscure ways.
The Prelude import works just like the implicit Prelude import in a
Haskell module: it can be overriden with an explicit Prelude
import.
I have added a new ":show imports" command to show which imports are
currently in force.
Prelude> :show imports
import Prelude -- implicit
Prelude> import Prelude ()
Prelude> :show imports
import Prelude ()
Prelude> map
<interactive>:0:1: Not in scope: `map'
Prelude>
Full documentation in the User's Guide.
There are various other little tweaks and improvements, such as when a
module is imported with 'as', we now show the 'as' name in the prompt
rather than the original name.
compiler/hsSyn/HsImpExp.lhs | 2 +-
docs/users_guide/ghci.xml | 135 ++++++---
ghc/GhciMonad.hs | 39 ++--
ghc/InteractiveUI.hs | 731 +++++++++++++++++++++++++------------------
4 files changed, 542 insertions(+), 365 deletions(-)
Diff suppressed because of size. To see it, use:
git show 79d6745f66c678de5e104b2146d3dd3e2f006c3e
More information about the Cvs-ghc
mailing list