I am trying to structure my simple project so that it is easy for me to develop in the future. Basically, I used cabal init to get the basic material, then created the src folder, inside which I created the main folder and the test folder, the main task is to save the entire source code, and the test is to put the entire test source code. Inside .cabal, I have the following:
. . . . test-suit Test type: exitcode-stdio-1.0 hs-source-dirs: src/test main-is: Test.hs build-depends: base executable Finance hs-source-dirs: src/main main-is: Main.hs build-depends: base
There are only three files Main.hs, Methods.hs, Test.hs. Methods.hs is imported into Main.hs for execution, and Test.hs imports Methods.hs and checks the methods. My goal is to do cabal --enable-tests configure , then cabal build , then cabal test , then cabal install . But at the build stage, I get an error
src/test/Test.hs:2:8: Could not find module `Methods` Use -v to see a list of the files search for.
How can I tell cabal where Methods.hs is located? Also, is there a better way to set up a project?
source share