How to make a Haskell cabal project with library+executables that still run with runhaskell/ghci?

后端 未结 2 1440
别跟我提以往
别跟我提以往 2020-12-07 11:04

If you declare a library + executable sections in a cabal file while avoiding double compilation of the library by putting the library into a hs-source-dirs dir

2条回答
  •  旧巷少年郎
    2020-12-07 11:36

    You can use cabal repl to start ghci with the configuration from the cabal file and cabal run to compile and run the executables. Unlike runhaskell and ghci, using cabal repl and cabal run also picks up dependencies from cabal sandboxes correctly.

提交回复
热议问题