commercialhaskell / commercialhaskell/stack
Starting `stack ghci` makes no modules available if any are broken -- even though `:reload` is more permissive
- Dominant language
- Haskell
- Stars
- 4.1k
- Forks
- 850
- Avg merge
- 10h 37m
- Merged PRs (30d)
- 4
Description
(I believe this behavior is due to Stack and not GHCI, but I could be wrong.)
Before upgrading Stack to 2.1.3, if I ran `stack ghci` with some good modules and some broken ones, GHCI would make available everything in the modules that it did manage to compile. That's no longer the case: now it will load module A, then choke on B, and then I can't use the things defined in A. On the other hand, if I make a breaking change to B after successfully loading A and B, when I `:reload` it'll choke on B but still let me use A.
The result is that I have to do what feels like silly extra work. Recently I changed a foundational datatype, and something like half of the modules I had written stopped working. In order to start GHCI with any of that code available, I had to comment out all but one of the broken modules from `exposed-modules` in the `.cabal` file, and then comment out everything in the broken module. After that I can start GHCI; then I uncomment the module and `:reload` to start working on it.
This behavior seems suboptimal, no?
I've was using `resolver: nightly-2019-02-09` since Februrary. This new finicky load behavior only started this month, maybe a week ago, I believe on the day I upgraded Stack to 2.1.3 (from 1.9.something, I think). Yesterday I switched to `nightly-2019-09-08` but the finicky loading persists.
Contributor guide
Assessment
This issue has not been assessed yet.