MercuryTechnologies / ghciwatch

Load a GHCi session for a Haskell project and reload it when source files change
https://mercurytechnologies.github.io/ghciwatch/
MIT License
111 stars 10 forks source link

Make `ghciwatch` useable in a multi-component repo #308

Closed rockboynton closed 3 months ago

rockboynton commented 3 months ago

Describe the feature you’d like to be implemented

Currently cabal repl doesn't work with multiple component repos, therefore ghciwatch doesn't either. haskell-language-server does, though, so I hope ghciwatch can do some tricks to also be able to work with multiple components at once.

❯ cabal repl                                                                                                                                                                                                                                                                            Error: cabal: Cannot open a repl for multiple components at once. The target
'' refers to the package foo-0.1.0.0 which includes the libraries bar and baz.

The reason for this limitation is that current versions of ghci do not support
loading multiple components as source. Load just one component and when you
make changes to a dependent component then quit and reload.

List alternatives to the feature and their pros and cons

No response

Additional context

Without this I would only be able to develop on a per-component basis and have to stop/restart ghciwatch for every component I work on within the same cabal project

9999years commented 3 months ago

I think Well-Typed actually fixed this recently: "Multiple Component support for cabal repl" by Matthew Pickering, 2023-03-16. Unfortunately, it's only available in cabal-install-3.12.1.0.

I think we should probably just wait to use cabal-install-3.12.1.0 directly.