RE: Using packages in ghci

2004-10-05 Thread Simon Marlow
I think what's happening here is that you essentially have overlapping
.hi files: the interface for Data.Tree.AVL.List is found along the
search path, and also in a package (because the search path "." and the
import_dirs for the package point to the same place).

This is apparently confusing GHC, but I don't know exactly how.  We
could "fix" the problem by checking whether a given module can be found
in more than one place, but that would involve searching every package
for every module, which might slow things down.  When we store the list
of visible modules with a package we'll be able to do this much more
easily.

Cheers,
Simon

On 02 October 2004 08:42, Adrian Hey wrote:

> On Friday 01 Oct 2004 9:36 pm, Simon Marlow wrote:
>> Looks fine - GHCi is supposed to look in the directories in
>> import_dirs 
>> for .hi files.  What does ghci -v tell you?
> 
> Quite a lot :-), but nothing very surprising. I think I've found what
> causes the problem. It does actually seem to work as expected,
> provided the current directory is not what it usually is when I'm
> working on the library. 
> 
> I.E. /home/adrian/HaskellLibs/Data.Tree.AVL
> 
> This is what I get
> 
>> Prelude> :m Data.Tree.AVL
>> Prelude Data.Tree.AVL> asTreeL "ABCD"
>> 
>> :1:
>>tcLookup: `asTreeL' is not in scope
>>In the definition of `it': it = asTreeL "ABCD"
>> 
>> Failed to load interface for `Data.Tree.AVL.List':
>>Bad interface file: ./Data/Tree/AVL/List.hi
>>./Data/Tree/AVL/List.hi: openBinaryFile: does not exist (No
>> such file or directory) 
>> 
>> Failed to find interface decl for `asTreeL'
>> from module `Data.Tree.AVL.List'
> 
> But if I cd to..
> 
> I.E. /home/adrian/HaskellLibs/Data.Tree.AVL/pkg
> 
> ..it works fine. I've since discovered it also seems to work fine from
> from any other directory too. So it seems to something peculiar about
> the one particular directory that upsets it.
> 
> This is with version 6.2.20040915, but 6.2.1 did the same thing IIRC.
> 
> Regards

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


Re: Using packages in ghci

2004-10-02 Thread Adrian Hey
On Friday 01 Oct 2004 9:36 pm, Simon Marlow wrote:
> Looks fine - GHCi is supposed to look in the directories in import_dirs
> for .hi files.  What does ghci -v tell you?

Quite a lot :-), but nothing very surprising. I think I've found what causes
the problem. It does actually seem to work as expected, provided the current
directory is not what it usually is when I'm working on the library.

I.E. /home/adrian/HaskellLibs/Data.Tree.AVL

This is what I get

>Prelude> :m Data.Tree.AVL
>Prelude Data.Tree.AVL> asTreeL "ABCD"
>
>:1:
>tcLookup: `asTreeL' is not in scope
>In the definition of `it': it = asTreeL "ABCD"
>
>Failed to load interface for `Data.Tree.AVL.List':
>Bad interface file: ./Data/Tree/AVL/List.hi
>./Data/Tree/AVL/List.hi: openBinaryFile: does not exist (No such file 
or directory)
>
>Failed to find interface decl for `asTreeL'
>from module `Data.Tree.AVL.List'

But if I cd to..

I.E. /home/adrian/HaskellLibs/Data.Tree.AVL/pkg

..it works fine. I've since discovered it also seems to work fine from
from any other directory too. So it seems to something peculiar about the
one particular directory that upsets it.

This is with version 6.2.20040915, but 6.2.1 did the same thing IIRC.

Regards
--
Adrian Hey

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


RE: Using packages in ghci

2004-10-01 Thread Simon Marlow
On 01 October 2004 10:37, Adrian Hey wrote:

> Where does ghci look for .hi files from packages? (I doesn't seem to
> be the same place as ghc). AFAICT it expects to find them relative to
> the current directory, and I can only get it to work by cding to
> the appropriate directory *before* invoking ghci (doing this from
> within ghci seems to really mess things up).
> 
> But I guess this isn't what's supposed to happen because this
> solution will only work with one package.
> 
> My package entry looks like this..
> 
> Package
>{name = "Data.Tree.AVL",
> auto = True,
> import_dirs = ["/home/adrian/HaskellLibs/Data.Tree.AVL/pkg"],
> source_dirs = [],
> library_dirs = ["/home/adrian/HaskellLibs/Data.Tree.AVL/pkg"],
> hs_libraries = ["Data.Tree.AVL"],
> extra_libraries = [],
> include_dirs = [],
> c_includes = [],
> package_deps = ["base", "Data.COrdering"],
> extra_ghc_opts = [],
> extra_cc_opts = [],
> extra_ld_opts = [],
> framework_dirs = [],
> extra_frameworks = []}
> 
> Is there something missing here?

Looks fine - GHCi is supposed to look in the directories in import_dirs
for .hi files.  What does ghci -v tell you?

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


Using packages in ghci

2004-10-01 Thread Adrian Hey
Hello,

Where does ghci look for .hi files from packages? (I doesn't seem to
be the same place as ghc). AFAICT it expects to find them relative to
the current directory, and I can only get it to work by cding to
the appropriate directory *before* invoking ghci (doing this from
within ghci seems to really mess things up).

But I guess this isn't what's supposed to happen because this
solution will only work with one package.

My package entry looks like this..

Package
   {name = "Data.Tree.AVL",
auto = True,
import_dirs = ["/home/adrian/HaskellLibs/Data.Tree.AVL/pkg"],
source_dirs = [],
library_dirs = ["/home/adrian/HaskellLibs/Data.Tree.AVL/pkg"],
hs_libraries = ["Data.Tree.AVL"],
extra_libraries = [],
include_dirs = [],
c_includes = [],
package_deps = ["base", "Data.COrdering"],
extra_ghc_opts = [],
extra_cc_opts = [],
extra_ld_opts = [],
framework_dirs = [],
extra_frameworks = []}

Is there something missing here?

Thanks
--
Adrian Hey

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


Re: packages in ghci

2001-09-27 Thread Reuben Thomas

> I just downloaded the nice installation of ghc 5.02 for windows.
> 
> I have just some problem when trying to start ghci with a
> package as described in the manual:
> 
> > E:\hs\Quip>ghci -package text

Works fine for me.

> > e:\PROGRA~1\ghc\ghc-5.02\bin\ghc.exe: no input files
> > Usage: For basic information, try the `--help' option.
> >
> > E:\hs\Quip>
> 
> Adding a Haskell source file as further parameter does not really help:
> 
> > E:\hs\Quip>ghci -package text M.hs
> > A' does not existhc-5.02\bin\ghc.exe: file `=

This looks as though there's some problem involving carriage returns,
as the error seems to wrap from the end of the line back to the beginning.

> Any idea, what I am doing wrong?

Nope. What's your PATH like? What version of Windows are you using?

-- 
http://sc3d.org/rrt/ | wit, n.  educated insolence (Aristotle)

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



packages in ghci

2001-09-27 Thread Sven Eric Panitz


I just downloaded the nice installation of ghc 5.02 for windows.

I have just some problem when trying to start ghci with a
package as described in the manual:

> E:\hs\Quip>ghci -package text
> e:\PROGRA~1\ghc\ghc-5.02\bin\ghc.exe: no input files
> Usage: For basic information, try the `--help' option.
> 
> E:\hs\Quip>

Adding a Haskell source file as further parameter does not really help:

> E:\hs\Quip>ghci -package text M.hs
> A' does not existhc-5.02\bin\ghc.exe: file `=
> 
> E:\hs\Quip>


Any idea, what I am doing wrong?

Sven Eric



-- 
__
Sven Eric Panitz Uhlandstr. 12   D-64297 Darmstadt
Software AG   [EMAIL PROTECTED] (+49)6151-92-1426 
---  when I cannot sing my heart, I can only speak my mind ---


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