RE: GHC Poll: scope in GHCi

2002-01-22 Thread Simon Marlow


  | I'm currently showing the scope in the prompt, with
  | the modules from which we're taking the exports only
  | surrounded by square brackets.
 
 It is nice to show the difference. What I am looking for
 however is to get everything defined in a compiled module
 into scope.
 
 One solution might be to just interpret the module, even
 when there is a compiled version of it.
 
 The current way to do it is to remove the .o file, and
 reload. This is very unsatisfactory I think.

You can also touch the .hs file of course, which is slightly less
drastic.

But yes, I think we could provide a way to say ignore the compiled
version of module M.

Cheers,
Simon

___
Glasgow-haskell-users mailing list
[EMAIL PROTECTED]
http://www.haskell.org/mailman/listinfo/glasgow-haskell-users



RE: GHC Poll: scope in GHCi

2002-01-22 Thread Simon Marlow


 Simon Marlow [EMAIL PROTECTED] writes:
 
  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'd like to suggest one more thing that it would be nice to have in
 scope.  I would like every loaded module to be imported qualified
 into the scope.  (In fact, I would prefer if this were the default,
 although I suppose it might be useful to have a way to turn it off.)

Sure.  In fact, GHCi already supports this:

Prelude Time.getClockTime = IO.putStrLn . show
Tue Jan 22 16:33:58 GMT 2002

Cheers,
Simon

___
Glasgow-haskell-users mailing list
[EMAIL PROTECTED]
http://www.haskell.org/mailman/listinfo/glasgow-haskell-users



Re: GHC Poll: scope in GHCi

2002-01-14 Thread Ketil Z Malde

Koen Claessen [EMAIL PROTECTED] writes:

  | Does anyone have any better suggestions?

 I think any solution that leaves it transparent as to if it
 is a compiled or an interpreted module is fine.

 But I have understood that this is hard to achieve...

How about using a different command for importing the exported
interface only?

I.e. 

:l M  --loads the whole (internal/top level) module
:i M  --imports the module's exported interface

If :l requires interpretation, then so be it, otherwise use compiled
modules whenever possible.

I'm not sure I see the need for namespace combinators (ie. SM's
suggested :m +M and so on)

-kzm
-- 
If I haven't seen further, it is by standing in the footprints of giants

___
Glasgow-haskell-users mailing list
[EMAIL PROTECTED]
http://www.haskell.org/mailman/listinfo/glasgow-haskell-users



Re: GHC Poll: scope in GHCi

2002-01-13 Thread Eray Ozkural (exa)

-BEGIN PGP SIGNED MESSAGE-
Hash: SHA1

Hi,

On Wednesday 09 January 2002 16:35, Simon Marlow wrote:
 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

   Main[IO]

 The whole top-level scope of Main, plus additionally the exports of IO

   A,B

 The combined top-level scopes of A and B.


This is exactly the feature I had requested! Thanks a lot! This is going to 
make development with ghc a lot easier.

Regards,

- -- 
Eray Ozkural (exa) [EMAIL PROTECTED]
Comp. Sci. Dept., Bilkent University, Ankara
www: http://www.cs.bilkent.edu.tr/~erayo
GPG public key fingerprint: 360C 852F 88B0 A745 F31B  EA0F 7C07 AE16 874D 539C
-BEGIN PGP SIGNATURE-
Version: GnuPG v1.0.6 (GNU/Linux)
Comment: For info see http://www.gnupg.org

iD8DBQE8QkaUfAeuFodNU5wRAuNqAJ0RDuf1p8YCX4g7HRuKNK8EL4jo9gCfRf+R
+jenPr2AKOOI8QcacpkCPQM=
=BJ/W
-END PGP SIGNATURE-

___
Glasgow-haskell-users mailing list
[EMAIL PROTECTED]
http://www.haskell.org/mailman/listinfo/glasgow-haskell-users



Re: GHC Poll: scope in GHCi

2002-01-09 Thread Koen Claessen


 | Does anyone have any better suggestions?

I think any solution that leaves it transparent as to if it
is a compiled or an interpreted module is fine.

But I have understood that this is hard to achieve...

/Koen.


___
Glasgow-haskell-users mailing list
[EMAIL PROTECTED]
http://www.haskell.org/mailman/listinfo/glasgow-haskell-users



Re: GHC Poll: scope in GHCi

2002-01-09 Thread Max A.K.

Is there any haskell interpreter done it already?
Hugs and hmake support :also command. I don't know
now exactly it works, but quick test showed than
it (sometimes) helps to mix scopes:

Hi (hmake/nhc98):
--- begin cut
Prelude :also Maybe
[Std   module... /usr/local/opt/nhc98/include/nhc98/Prelude.hi]
[Std   module... /usr/local/opt/nhc98/include/nhc98/Maybe.hi]
Maybe print a
a  
Maybe :also IO
[Std   module... /usr/local/opt/nhc98/include/nhc98/Prelude.hi]
[Std   module... /usr/local/opt/nhc98/include/nhc98/Maybe.hi]
[Std   module... /usr/local/opt/nhc98/include/nhc98/IO.hi]
IO listToMaybe [1]
Just 1   
--- end cut

___
Glasgow-haskell-users mailing list
[EMAIL PROTECTED]
http://www.haskell.org/mailman/listinfo/glasgow-haskell-users



RE: GHC Poll: scope in GHCi

2002-01-09 Thread Simon Marlow

  | Does anyone have any better suggestions?
 
 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 

Main[IO]

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


___
Glasgow-haskell-users mailing list
[EMAIL PROTECTED]
http://www.haskell.org/mailman/listinfo/glasgow-haskell-users



RE: GHC Poll: scope in GHCi

2002-01-09 Thread Simon Marlow

 Is there any haskell interpreter done it already?
 Hugs and hmake support :also command. I don't know
 now exactly it works, but quick test showed than
 it (sometimes) helps to mix scopes:
 
 Hi (hmake/nhc98):
 --- begin cut
 Prelude :also Maybe
 [Std   module... /usr/local/opt/nhc98/include/nhc98/Prelude.hi]
 [Std   module... /usr/local/opt/nhc98/include/nhc98/Maybe.hi]
 Maybe print a
 a  
 Maybe :also IO
 [Std   module... /usr/local/opt/nhc98/include/nhc98/Prelude.hi]
 [Std   module... /usr/local/opt/nhc98/include/nhc98/Maybe.hi]
 [Std   module... /usr/local/opt/nhc98/include/nhc98/IO.hi]
 IO listToMaybe [1]
 Just 1   
 --- end cut

Hugs's :also is the same as GHC's :add; it causes another module to be
loaded without throwing away the existing loaded set, and it changes the
scope to the new module.

Hi seems to be doing something slightly different, but I can't find any
documentation on Hi's :also command.

Cheers,
Simon

___
Glasgow-haskell-users mailing list
[EMAIL PROTECTED]
http://www.haskell.org/mailman/listinfo/glasgow-haskell-users



RE: GHC Poll: scope in GHCi

2002-01-09 Thread Koen Claessen


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

It is nice to show the difference. What I am looking for
however is to get everything defined in a compiled module
into scope.

One solution might be to just interpret the module, even
when there is a compiled version of it.

The current way to do it is to remove the .o file, and
reload. This is very unsatisfactory I think.

/Koen.


___
Glasgow-haskell-users mailing list
[EMAIL PROTECTED]
http://www.haskell.org/mailman/listinfo/glasgow-haskell-users



Re: GHC Poll: scope in GHCi

2002-01-09 Thread Dean Herington

A minor suggestion: Let :m *M apply to compiled modules as well as
interpreted.  In other words, :m +M requests all top-level entities
(accepting only exported ones for compiled modules) while :m *M requests
only exported entities (whether the module is compiled or interpreted).

More generally, though, I dislike allying the all / exported only choice
with the add a module to the scope command; they should be specified
independently.  In particular, one should be able to make the choice for
each of the modules in the :m M1..Mn command.  (Otherwise, how can one
reasonably request a scope consisting of only the exported entities from a
single interpreted module?)

A question: What is the syntax of the M1..Mn form?

I like Koen Claessen's suggestion that one be able to request all top-level
names from a compiled module.

Here's a variant of Simon's proposal that addresses the above concerns:

  * Let a mods be either the name of a module (implying the set of all
top-level names in that module) or a square-bracketed, space-separated list
of module names (implying the set of names exported from the modules).

  * Let a modslist be a list of modss.  Whitespace must separate
adjacent modss when neither is in square brackets.

  * Let the :module command take an optional '+' or '-' followed by a
modslist.  '+' indicates additions to the scope; '-' indicates
subtractions from the scope; absence of both indicates redefinition of the
scope.

Square bracketing is suggested for indicating that only exported names are
desired, to match the prompt syntax.  An alternative for both would be to
prefix each such module name by, say, '*'.  Examples of these two
alternatives:

Main[IO] :module + [Char Monad] Foo
Main Foo[IO Char Monad]

or

Main *IO :module + *Char *Monad Foo
Main *IO *Char *Monad Foo

I think I prefer the latter.

Dean


___
Glasgow-haskell-users mailing list
[EMAIL PROTECTED]
http://www.haskell.org/mailman/listinfo/glasgow-haskell-users



Re: GHC Poll: scope in GHCi

2002-01-09 Thread Carl R. Witty

Simon Marlow [EMAIL PROTECTED] writes:

 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'd like to suggest one more thing that it would be nice to have in
scope.  I would like every loaded module to be imported qualified
into the scope.  (In fact, I would prefer if this were the default,
although I suppose it might be useful to have a way to turn it off.)

Carl Witty

___
Glasgow-haskell-users mailing list
[EMAIL PROTECTED]
http://www.haskell.org/mailman/listinfo/glasgow-haskell-users