Closed
Description
Currently (with cabal-install 3.6
), when running cabal repl
with multiple components, users see the following error message:
$ cabal repl comp1 comp2
cabal: Cannot open a repl for multiple components at once. The targets
'comp1' and 'comp2' refer to different components..
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.
The ability to load REPL with multiple components is commonly known as "Multiple Home Units (MHU)". The following blog post by Matthew Pickering (Well-Typed) from January 7, 2022, claims that this feature is implemented in GHC and now it's up to build tools to support it:
I haven't found an issue in Cabal tracking the implementation of Multiple Home Units. There's a similar issue but it seems to be talking about something else: