Cabal: N executables without building all the modules N times?

Niklas Hambüchen mail at nh2.me
Mon Aug 10 22:35:40 UTC 2020


Hey James,

yes, if you want to avoid duplicate compilation, you need to define a `library` with a separate `hs-source-dirs` and use that library in the `build-depends` of your executables.

See

    https://stackoverflow.com/questions/12305970/how-to-make-a-haskell-cabal-project-with-libraryexecutables-that-still-run-with

and the linked question.

Cheers,
Niklas


More information about the Libraries mailing list