Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

set visible packages #130

Open
gelisam opened this issue Apr 21, 2021 · 1 comment
Open

set visible packages #130

gelisam opened this issue Apr 21, 2021 · 1 comment

Comments

@gelisam
Copy link
Contributor

gelisam commented Apr 21, 2021

it is possible to set the visible modules using setImportsQ; it would be nice to also be able to specify the visible packages (and maybe the list of package databases they are drawn from?) using a similar function.

Until then, a workaround is to use unsafeRunInterpreterWithArgs ["-hide-all-packages", "-package-id", "base-4.15.0.0"]; that is, pass the same arguments which stack and cabal are passing to ghc and ghci in order to limit the visible packages to those listed in the build-depends list of the .cabal file.

@gelisam
Copy link
Contributor Author

gelisam commented Apr 21, 2021

To figure out how to implement this, look at the ghci source code and figure out how they implement the :set -package mtl command.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

1 participant