Hello!

Try doing this first:

  loadModules ["My.Module"]

You may also need to set the "searchPath" - it defaults to the current
director.  Another good function to know about is "setTopLevelModules",
which is just like using ":load" in ghci - it imports everything in the
module, including its imports.  So, I often do:

  loadModules ["MyPrelude"]
  setTopLevelModules ["MyPrelude"]

And stick all of the things that I want to be in scope into "MyPrelude.hs".

-Michael


On Thu, Dec 20, 2012 at 3:35 PM, Martin Hilbig <[email protected]> wrote:

> hi,
>
> how to use Language.Haskell.Interpreter.**setImports?
>
> i use it like:
>
>   setImports ["My.Module"]
>
> so that my interpreted modules don't need to:
>
>   import My.Module
>
> But i still get:
>
>   Not in scope: data constructor `MyType'
>
> What am i doing wrong?
>
> Thanks in advance.
>
> have fun
> martin
>
> ______________________________**_________________
> Haskell-Cafe mailing list
> [email protected]
> http://www.haskell.org/**mailman/listinfo/haskell-cafe<http://www.haskell.org/mailman/listinfo/haskell-cafe>
>
_______________________________________________
Haskell-Cafe mailing list
[email protected]
http://www.haskell.org/mailman/listinfo/haskell-cafe

Reply via email to