Silly question on interactive import

Previous Topic Next Topic
 
classic Classic list List threaded Threaded
6 messages Options
Reply | Threaded
Open this post in threaded view
|

Silly question on interactive import

jerzy.karczmarczuk
Could you remind me what is the easiest way to load interactively a specific
module before loading a afile into ghci? For example, I have a file parse.hs
with some functions such as isUpper, which belongs to the module Char.

I thought that writing

:m + Char
:l parse

  would work, but loading destroys the access to the module Char. (:add as well).

Well, I won't die if there is no way to do it.
But am I obliged to import Char within parse? Of course, interactive import
is illegal...

Thanks.

Jerzy Karczmarczuk
_______________________________________________
Haskell mailing list
[hidden email]
http://www.haskell.org/mailman/listinfo/haskell
Reply | Threaded
Open this post in threaded view
|

Re: Silly question on interactive import

Tomasz Zielonka
On Wed, Dec 14, 2005 at 12:03:17PM +0100, Jerzy Karczmarczuk wrote:
> Could you remind me what is the easiest way to load interactively a specific
> module before loading a afile into ghci? For example, I have a file parse.hs
> with some functions such as isUpper, which belongs to the module Char.
>
> I thought that writing
>
> :m + Char
> :l parse

Try doing it in reverse order.
:load resets the session, or whatever it is called
:module +/- doesn't

Best regards
Tomasz

--
I am searching for a programmer who is good at least in some of
[Haskell, ML, C++, Linux, FreeBSD, math] for work in Warsaw, Poland
_______________________________________________
Haskell mailing list
[hidden email]
http://www.haskell.org/mailman/listinfo/haskell
Reply | Threaded
Open this post in threaded view
|

Re: Silly question on interactive import

jerzy.karczmarczuk
I tried to add a module, and then to load a file into GHCi, in order to use
both.

Tomasz Zielonka wrote:

> Try doing it in reverse order.
> :load resets the session, or whatever it is called
> :module +/- doesn't

Mmm, no. The file cannot be loaded, since it won't compile without that
incriminated module...

Jerzy Karczmarczuk
_______________________________________________
Haskell mailing list
[hidden email]
http://www.haskell.org/mailman/listinfo/haskell
Reply | Threaded
Open this post in threaded view
|

Re: Silly question on interactive import

Tomasz Zielonka
On Wed, Dec 14, 2005 at 01:08:01PM +0100, Jerzy Karczmarczuk wrote:
> Mmm, no. The file cannot be loaded, since it won't compile without that
> incriminated module...

I'm sorry, seems like I misunderstood your question - you have
to add an import to the file.

Best regards
Tomasz

--
I am searching for a programmer who is good at least in some of
[Haskell, ML, C++, Linux, FreeBSD, math] for work in Warsaw, Poland
_______________________________________________
Haskell mailing list
[hidden email]
http://www.haskell.org/mailman/listinfo/haskell
Reply | Threaded
Open this post in threaded view
|

Re: Silly question on interactive import

Mirko Rahn
In reply to this post by jerzy.karczmarczuk

> :m + Char
> :l parse
>
>  would work, but loading destroys the access to the module Char. (:add
> as well).

I remember that accessing functions from Char in a qualified matter
should still be possible.

/

--
-- Mirko Rahn -- Tel +49-721 608 7504 --
--- http://liinwww.ira.uka.de/~rahn/ ---
_______________________________________________
Haskell mailing list
[hidden email]
http://www.haskell.org/mailman/listinfo/haskell
Reply | Threaded
Open this post in threaded view
|

Re: Silly question on interactive import

jerzy.karczmarczuk
Mirko Rahn answers my query:

>> :m + Char
>> :l parse
>>
>>  would work, but loading destroys the access to the module Char. (:add
>> as well).
>
>
> I remember that accessing functions from Char in a qualified matter
> should still be possible.

Sure. I know that I can write, e.g.   Char.isUpper 'c'  interactively.
But I cannot put that into may parse.hs file anyway, it is not recognized.
So, I believe the *only* way is to import Char etc. by my private files.
There is nothing wrong with it, I was just interested whether an "incremental,
interactive" import is possible. Seems not. Unless somebody knows how, but
then, I would have already an answer, you are all very helpful. Thanks.

Jerzy Karczmarczuk


_______________________________________________
Haskell mailing list
[hidden email]
http://www.haskell.org/mailman/listinfo/haskell