Angabe des Suchpfads für Ladevorgänge in ghci

ImQuelldateien werden geladen es besagt, dass der Suchpfad zum Finden von Quelldateien mit der Option -i angegeben wird:

ghci -idir1:...:dirn

Bedeutet dies, dass wenn man ausführt:

:load test.hs

dann sucht ghci in den Verzeichnissen oben nach test.hs? Ich habe die Antwort bei gesehenProblem beim Angeben des Quellverzeichnisses für GHC darüber bin ich mir aber immer noch nicht im klaren.

Zum Beispiel in Windows XP habe ich test.hs in:

C:\Documents and Settings\winuser\My Documents

und lief dann:

ghci -iC:\Documents and Settings\winuser\My Documents

Jedoch beim Tun:load test.hs, beschwerte sich ghci, dass die Datei nicht gefunden werden konnte.

[EDIT 1]

Ich möchte die Verwendung vermeiden:cd weil es alle geladenen Module entlädt, was mich daran hindert, Dateien von mehreren Orten zu laden

[EDIT 2: Antwort auf jozefg]

--C:\A\A.hs
module A where
myaddA::Int->Int->Int
myaddA x y = x+y

--C:\B\B.hs
module B where
myaddB::Int->Int->Int
myaddB x y = x+y

Dann kann ich folgendes machen:

Prelude> :cd C:\A
Prelude> :load A
[1 of 1] Compiling A                ( A.hs, interpreted )
Ok, modules loaded: A.
*A> myaddA 2 3
5
*A> :cd C:\B
Warning: changing directory causes all loaded modules to be unloaded,
because the search path has changed.
Prelude> :load B
[1 of 1] Compiling B                ( B.hs, interpreted )
Ok, modules loaded: B.
*B> myaddB 3 4
7

Ich habe jedoch keine Möglichkeit gefunden, die Module A und B gleichzeitig verfügbar zu machen, wenn die Module in Dateien an verschiedenen Orten gespeichert sind

[EDIT 3: Antwort auf jozefg]

>ls
temp  temp2
>more temp/A.hs
module A where
addA = (+)
>more temp2/B.hs
module B where
addB = (+)
>cd temp
>ghci -i../temp2
GHCi, version 7.6.3: http://www.haskell.org/ghc/  :? for help
Loading package ghc-prim ... linking ... done.
Loading package integer-gmp ... linking ... done.
Loading package base ... linking ... done.
Prelude> import A B

<interactive>:1:10: parse error on input `B'

[EDIT 4: Antwort auf jozefg]

>ls
temp  temp2
>more temp/A.hs
module A where
addA = (+)
>more temp2/B.hs
module B where
addB = (+)
>cd temp
>ghci -i../temp2
GHCi, version 7.6.3: http://www.haskell.org/ghc/  :? for help
Loading package ghc-prim ... linking ... done.
Loading package integer-gmp ... linking ... done.
Loading package base ... linking ... done.
Prelude> import A

<no location info>:
    Could not find module `A'
    It is not a module in the current program, or in any known package.
Prelude> import B

<no location info>:
    Could not find module `B'
    It is not a module in the current program, or in any known package.

Antworten auf die Frage(2)

Ihre Antwort auf die Frage