GHC Poll: scope in GHCi
Wed, 9 Jan 2002 12:02:58 -0000
There's a long-standing problem in GHCi, namely that when you select a
compiled module with ':m M' you can only see the exports of M, and even
the exports of the Prelude are hidden. Several people have suggested
that this should be improved, and I'm just getting around to
implementing something more useful. =20
This message is to gather suggestions on what the user interface should
look like in a more general setting, from people who use GHCi more than
we do :-)
Ok, so in general a 'scope' can be constructed by combining:
1. the full top-level scope from zero or more *interpreted* modules
2. the exports of zero or more modules (interpreted or compiled)
3. any temporary bindings made on the command line
I'm assuming name clashes are handled in the normal Haskell 98 way, ie.
lazilly, so it might actually make sense to combine the top-level scope
of more than one module.
Whatever user interface we adopt should provide a way to manipulate
these sets. Here's one suggestion:
:m M1..Mn set sets 1 & 2 from M1..Mn - use
list 1 if Mi is interpreted, otherwise
:m +M adds M to set 1 or 2.
:m -M removes M from set 1 or 2.
Which leaves one remaining case: adding an interpreted module to set 2.
Perhaps this could be ':m *M'.
Does anyone have any better suggestions?