[Haskell-cafe] module is a package module error

Martin Hilbig lists at mhilbig.de
Sat Jan 14 04:09:46 UTC 2017


meh, i got confused with my different tests and not using cabal clean.

add this paragraph to your hint-test.cabal:

library
  hs-source-dirs:      src
  default-language:    Haskell2010
  Exposed-Modules:     Internal

remove 'import Internal' (or not)
remove 'loadModules ["Internal"]'
enjoy.

i think the error meant to say, this module source file you are trying
to load is already part of a package, which would be bad if loaded twice.

and since it's part of your package, you dont need to load it, just
import it.

On 14.01.2017 04:55, Martin Hilbig wrote:
> hi,
> 
> i got it to OK by removing your 'loadModules ["Internal"]' line.
> 
> i think this works, because you imported Internal in your Main module
> and set it as Import.
> 
> but you might want to check up on loadModules description at [1].
> 
> is the Internal module's source file available when you compile your
> Main module or will it be provided during run-time? in the latter case
> you will need the loadModules call, but shouldn't import the module.
> 
> have fun
> martin
> 
> [1]:https://hackage.haskell.org/package/hint-0.6.0/docs/Language-Haskell-Interpreter.html#v:loadModules
> 
> On 12.01.2017 17:16, Lana Black wrote:
>> Hi,
>>
>> I'm trying to use hint [1] to compile in runtime externally supplied
>> haskell code. The compiled code must have certain modules imported. The
>> problem is that I'm getting this error when loading modules
>>
>>> WontCompile [GhcError {errMsg = "<no location info>: error: module
>>> \8216Internal\8217 is a package module"}]
>>
>> I'm not really sure what to do with this. One way to fix this is to move
>> Internal to a separate package so that hint could load it through cabal,
>> but that's something I'd like to avoid. Is there any way I could make hint
>> use the same modules from the package it's being called from? The code
>> is located at [2].
>>
>> [1]: http://hackage.haskell.org/package/hint
>> [2]: https://github.com/greydot/hint-test/
>> _______________________________________________
>> Haskell-Cafe mailing list
>> To (un)subscribe, modify options or view archives go to:
>> http://mail.haskell.org/cgi-bin/mailman/listinfo/haskell-cafe
>> Only members subscribed via the mailman list are allowed to post.
>>
> _______________________________________________
> Haskell-Cafe mailing list
> To (un)subscribe, modify options or view archives go to:
> http://mail.haskell.org/cgi-bin/mailman/listinfo/haskell-cafe
> Only members subscribed via the mailman list are allowed to post.
> 


More information about the Haskell-Cafe mailing list