I have a Haskell library with several executables (tests, tests, etc.), about six in total. When I do refactoring in a library, I usually need to make a small change to each of the executable files.
In my current workflow, I separately compile each executable (say, using GHCi) and commit each one. This is tedious because I have to specify the path to each executable file and, in addition, reload the entire (very large) library, which even takes some time with GHCi.
My first thought in order to solve this problem was to create a single dummy module that imports the "Main" executable modules. However, this (of course) requires that the "Main" modules have a module name, for example module Executable1 where .... But now the bondage complains when compiling the executable file that it cannot find a module called "Main" (despite the fact that "main-is" is explicitly specified in the cabal file for each executable file.)
I also tried ghci Exec1.hs Exec2.hs ..., but he complains module ‘main@main:Main’ is defined in multiple files.
Is there an easy way to download multiple "Main" modules at once using GHCi so that I can test them at the same time?
source
share