In my opinion, the most important benefit of multi-repl is correctness and reliability. While HLS works reasonably well, no one can disagree that HLS crashes sometimes. Sometimes HLS reports lovely error messages such as Overlapping instances and reports the same location twice. Sometimes HLS fails with interface file errors. The only way to fix these kinds of errors is restarting HLS, sometimes clearing out the caches.
Many of these hard-errors happen because the support for loading multiple components without cabalās multi-repl feature (like a library, executable, test suites, sub-libraries, etcā¦) is simply a hack. A pretty good one, and it served us well for many years by now, but a hack nonetheless.
The multi-repl feature will improve the correctness and reliability of HLS, once its infancy issues have been fixed.
Iāve got a confirmation it works simultaneously across components and across packages, as long as all are ālocalā, that is, covered in your cabal.project.
I was primarily talking about ghci, because I can see what exactly is happening there. As @fendor has noted HLS seems to have quite a few tricks up its sleeve and unlike him Iām not familiar with them, but I also did notice that HLS has gotten better at handling these cross-package scenarios surprisingly well over the years, and thanks to his answer, many mysterious crashes make much more sense now.
That said, when I say ghci, itās also ghcid, because I also like to build various workflows on ghcid --test ... when the :reload cycle is fast.
I have a large multi-library project and I continually get HLS errors about colliding instances because it seems to load both the source and previous compiled versions of the libraries. Itās private code so it would be some effort to report a proper bug, Iām just hoping that this does fix it for me
Does the Haskell VSCode plugin need anything other than a new option / form field for multicomponent support?
Iām on v2.4.3, and just added "haskell.sessionLoading": "multipleComponents" directly to my settings file, and it seems to be working. Iām seeing references to --enable-multi-repl in cabal commands and overall it feels a lot more stable.