From: Simon Marlow Date: Fri, 16 Nov 2007 15:21:48 +0000 (+0000) Subject: Attempt at fixing #1873, #1360 X-Git-Url: http://git.megacz.com/?a=commitdiff_plain;ds=sidebyside;h=037aa382bad090cf5d39fbfdf00a6634be69ddc4;hp=037aa382bad090cf5d39fbfdf00a6634be69ddc4;p=ghc-hetmet.git Attempt at fixing #1873, #1360 I think I figured out a reasonable way to manage the GHCi context, comments welcome. Rule 1: external package modules in the context are persistent. That is, when you say 'import Data.Maybe' it survives over :load, :add, :reload and :cd. Rule 2: :load and :add remove all home-package modules from the context and add the rightmost target, as a *-module if possible. This is as before, and makes sense for :load because we're starting a new program; the old home-package modules don't make sense any more. For :add, it usually does what you want, because the new target will become the context. Rule 3: any modules from the context that fail to load during a :reload are remembered, and re-added to the context at the next successful :reload. Claus' suggestion about adding the "remembered" modules to the prompt prefixed with a ! is implemented but commented out. I couldn't decide whether it was useful or confusing. One difference that people might notice is that after a :reload where there were errors, GHCi would previously dump you in the most recent module that it loaded. Now it dumps you in whatever subset of the current context still makes sense, and in the common case that will probably be {Prelude}. ---