When I :load
a Haskell script into GHCi, it changes the prompt from Prelude>
to *Main>
. After I'm done with this script, how can I go back to the Prelude>
prompt? There seems to be no documentation regarding this.
Quits GHCi. You can also quit by typing control-D at the prompt. Attempts to reload the current target set (see :load ) if any of the modules in the set, or any dependent module, has changed.
You can also quit by typing a control-D at the prompt. Attempts to reload the current target set (see :load) if any of the modules in the set, or any dependent module, has changed.
As before, you can now use :m [+/-] My. Module to load and unload modules, but please note that this is different from :load because :module assumes you already :load ed what you're trying to get in/out of scope. you may load it by double-clicking it (on windows with winghci), by typing ghci test.
Prelude is a module that contains a small set of standard definitions and is included automatically into all Haskell modules.
Try using the :m
command. It should unload all the modules.
This is short for :module
which sets the current context. You can also load arbitrary modules this way:
Prelude> :m Data.List Control.Applicative Prelude Data.List Control.Applicative> :m Prelude>
Adding to the answer by @Tikhon Jelvis.
Apparently you can choose to unload modules using the syntax :m -<module>
. As in:
Prelude> import Numeric Prelude Numeric> :m -Numeric Prelude> :m +Numeric Prelude Numeric>
Source: [Haskell] Import/unimport a module into ghci
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With