GHCi hacking
Ulf Norell
ulfn at cs.chalmers.se
Fri Aug 18 07:39:42 EDT 2006
On Aug 18, 2006, at 1:06 PM, pepe wrote:
> If you have gone that far and modified ghci, wouldn't it be easier to
> disable the :load command and hardwire the loading of the UserLayer
> module ?
Ah, but the thing is that the UserLayer is written by the user and so
we don't know what it is before-hand. Also, the user should be able
to switch between different Layers without destroying the application
state.
> 1) CAFs (Constant Applicative Form) are essentially top level
> bindings. Top level bindings are closures, as anything in ghc, and
> they are in suspended state until they are evaluated. When this
> happens the closure is updated to store the computed value, and
> because of this evaluation effectively happens only once.
>
> 2) I don't know, but probably you will notice during your experiments
>
> 3) Probably no. What happens to top level bindings in the interactive
> environment? I think that you lose that environment too after load and
> some other commands. An option is to identify and disable all these
> commands.
I don't want to disable the commands, just the clearing of the
environment. At the moment I never revert the CAFs so I'm hoping that
the environment will be preserved whatever I the user does.
/ Ulf
More information about the Glasgow-haskell-users
mailing list