GHC Poll: scope in GHCi

Simon Marlow simonmar@microsoft.com
Wed, 9 Jan 2002 14:35:28 -0000


>  | Does anyone have any better suggestions?
>=20
> I think any solution that leaves it transparent as to if it
> is a compiled or an interpreted module is fine.

I'm currently showing the scope in the prompt, with the modules from
which we're taking the exports only surrounded by square brackets. Eg.

	[Prelude]>

Just the exports of the Prelude are in scope

	[Prelude,IO]>

The exports from Prelude and IO are in scope

	Main>

The whole top-level scope of module Main=20

	Main[IO]>
=09
The whole top-level scope of Main, plus additionally the exports of IO

	A,B>

The combined top-level scopes of A and B.

So this doesn't really tell you which modules are compiled vs.
interpreted but it does give you a good indication of what the current
scope is.  I can easily add another command to show the currently loaded
modules, including which ones are interpreted - something like

	> :show modules
	Main	( Main.hs, interpreted )
	Foo	( Foo.hs,  Foo.o )

And maybe

	> :show bindings
	x :: Int
	f :: Int -> Bool

Any other show-type things that might be useful?

Cheers,
	Simon
=09