Hey everyone! I am doing some work to bring a new feature to GHC. However, I am finding the workflow of below pretty exhausting:
- Edit code in emacs
- Build in terminal with
hadrian/build -j --flavour=quick --freeze1
- Read errors as they come up and edit in emacs appropriately
This is quite slow, as often I just want to check if one individual module typechecks. My usual workflow with other Haskell projects in Emacs is to just use C-c C-l
in haskell-mode, which loads that module into GHCi. However, when developing GHCi, this doesnāt seem to work. I get the following error in my haskell-process-log:
(āStarting inferior `cabal replā process using cabal ā¦ā āghcā nil ācabalā āreplā āāghc-option=-ferror-spansā)
ā Prelude.putStrLn āā
:set -v1
:set +c
ā :set prompt ā\4ā
ā :set prompt-cont "Ī»| "
ā Resolving dependenciesā¦ā Error: cabal: Could not resolve dependencies:
[__0] next goal: ghc (user goal)ā [__0] rejecting: ghc-9.9 (constraint from non-upgradeable package requires
installed instance)
[__0] rejecting: ghc-9.6.1, ghc-9.4.5, ghc-9.4.4, ghc-9.4.3, ghc-9.4.2,
ghc-9.4.1, ghc-9.2.8, ghc-9.2.7/installed-9.2.7, ghc-9.2.7, ghc-9.2.6,
ghc-9.2.5, ghc-9.2.4, ghc-9.2.3, ghc-9.2.2, ghc-9.2.1, ghc-9.0.2, ghc-8.10.7,ā ghc-8.10.2, ghc-8.10.1, ghc-8.8.3, ghc-8.8.1, ghc-8.6.5, ghc-8.6.4, ghc-8.6.1,
ghc-8.4.4, ghc-8.4.3, ghc-8.4.1, ghc-8.2.2, ghc-8.2.1, ghc-9.2.3.20220620
(constraint from user target requires ==9.9)
[__0] fail (backjumping, conflict set: ghc)
After searching the rest of the dependency tree exhaustively, these were theā goals Iāve had most trouble fulfilling: ghc
Event: "exited abnormally with code 1
"Process reset.
The answer to my problem feels somehow related to this bit of the wiki, but I cannot figure out how to make the connection. This part of the wiki does seem to imply that on the fly typechecking from within Emacs is indeed possible.
Is there something I am missing? Am I meant to somehow point haskell-mode to use the version of GHC built locally? If someone helps me to understand how to get this working, I am happy to update whatever documentation necessary so that it is clearer to others. Or if there is a piece of documentation I am missing, please direct me! Thanks so much