-
Notifications
You must be signed in to change notification settings - Fork 704
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
cabal new-repl
only brings one module into scope
#5374
Comments
Coming from |
In particular it's not obvious why only the module that is compiled first is brought into scope, while the other modules are in scope with full qualification. |
Because that's what GHCi does... a related issue is #5103 I don't think there's not much we can do without using some ugly hack like generating some transient .ghci file before and passing that to the ghci session, which then injects ghci commands to modify the startup environment... while making sure that your ~/.ghci or ./.ghci files are honored too and hoping they won't conflict with the autogenerated ghci script... (see also A better way would be to extend GHCi to fix this in a principled way which lets you explicitly tell GHCi which modules to bring into scope (it's kinda arbitrary as you point out that you get a single module into scope at all), i.e. whether no modules, a single module, all exposed modules, or some user-specified enumerated set (we could even allow wildcards here) Personally, if I want to setup a particular project-specific default ghci environment I do just that, I create |
Thanks for the explanation, Herbert!
👍
Also 👍 :) |
Trying to workaround the [limitations in `ghci`](haskell/cabal#5103) (see also [this issue](haskell/cabal#5374)) is not worth the time, specially since a `stack` workflow could be implemented. Additionally, by explaining the workaround in the README will probably take a lot of effort.
Maybe a |
I have not had success manually crafting a
upon invoking
first, followed by e.g.
|
Just wanted to chip-in here, but this is a very frustrating paper-cut that presents itself on a constant basis when developing with I'd be willing to try and put together a PR based off of however I've tried creating project-specific I can understand the reticence to accept a solution that isn't "principled" while the |
As @hvr mentioned, if one wants this to be improved then the |
this also makes ghcid's |
cabal new-repl
andcabal repl
only seem to bring one module into scope at the prompt. Is this the intended behavior? Thanks :)The text was updated successfully, but these errors were encountered: