Opened 6 years ago

Closed 2 years ago

#1588 closed proposed-project (fixed)

GHCi support for Cabal

Reported by: Johan Tibell Owned by:
Priority: good Keywords:
Cc: Difficulty: 1 person Summer
Mentor: not-accepted Topic: Cabal


GHCi is a real boon to productivity as it enables programmers to quickly compile and test their code. However, using GHCi in Cabal projects is not as simple as running ghci <source.hs> as there's often a need to run preprocessors (e.g. hsc2hs) or rebuild dependencies first. You might also need to pass .c files, used in foreign imports, to ghci.

Cabal could make all this much easier. It already knows how to rebuild/regenerate dependencies and create a set of options to pass to GHC.

Task: Implement cabal ghci, which runs all the required steps (e.g. preprocessing) to create a source tree that can be loaded into GHCi. There's already a partial implementation that can serve as a starting point:

Sub tasks:

  1. Refactor the flag generation code used to invoke ghc and use it to invoke ghci (see half finished implementation in the above ticket).
  2. Implement a submodule that sets up the flags to ghci, similar to the modules that are used to call e.g. ghc or ld.
  3. Implement cabal ghci [MODULE NAME].

Change History (1)

comment:1 Changed 2 years ago by Matthew Pickering

Resolution: fixed
Status: newclosed

Resolved by cabal repl

Note: See TracTickets for help on using tickets.