Reputation: 1661
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.
Upvotes: 50
Views: 10664
Reputation: 143
You can
:cd /new/directory
See the definition of :cd/:load in https://downloads.haskell.org/~ghc/6.6/docs/html/users_guide/ghci-commands.html
Upvotes: 0
Reputation: 3799
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
Upvotes: 16
Reputation: 68152
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>
Upvotes: 74