GHCi really should allow multiple modules

George Russell
Wed, 15 Aug 2001 15:29:12 +0200

GHCi is great.  But I really think it should allow you to have multiple
modules in scope, since having to qualify either your favorite module or
the Prelude all the time is a bore.

My complete suggestion is
(1) That there be a list of in-scope modules.  Names are searched 
    in each module in term, starting at the list head.
(2) :module mod1 mod2 ... modn (n>=1)
    replaces the current list by [mod1,mod2,...,modn]
    :module mod1 mod2 ... modn + 
    prepends [mod1,mod2,...,modn] to the existing list.
    displays the current list.
(3) The prompt show the head of the current list, followed, if the list
    has more than one element, by a "+" sign.

I appreciate that you can load multiple modules by creating a special
file containing the relevant import declarations.  Indeed, if provoked
enough I suppose I might write a :def macro to do this, but it seems
rather untidy and can't get at the existing list of modules.