How to make a Haskell cabal project with library+executables that still run with runhaskell/ghci?
问题 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 directory, you cannot usually run your project with ghci and runhaskell anymore, especially if the executables have helper modules themselves. What is a recommended project layout that only builds what is needed once allows using runhaskell has a clean structure without hacks? 回答1: Let's assume you have a mylib library, and mylib