Description
#2457 added a change to load packages individually. This has caused some non-ideal behavior when loading multiple packages into ghci / intero. Also, I've observed that the approach doesn't work in general, its success is non-deterministic. In particular:
-
This causes it to output "Ok, modules loaded: " messages N types, where N = number of packages.
-
If an error occurs, it can be repeated upto N times, filling up your console with duplicated errors.
-
It doesn't order the packages based on dependency order, so if package A is before package B in the list, and A depends on B, by the time it asks to load B's modules, they've already been loaded. So sometimes the source path setting doesn't work. So, the primary motivation for that change doesn't always work.
-
Intero re-collects type info for every load statement. This is probably an issue with intero. But since it is
-
The setting of cwd does not replay on reload.
So generally, that change was a major downgrade in how stack ghci
behaves, and it does not really properly support switching cwd.
I'm working on a change to go back to pretty much how scripts were generated before, this is documenting the motivation for the change. It will still benefit from :cd-ghc
in the case that intero is just loading one package, which I believe is the default in emacs