I set up a project according to the recommendation here: http://www.haskell.org/haskellwiki/Structure_of_a_Haskell_project
How can I run an example in the doc/examples folder? Assume I have src/App/SomeModule.hs, and doc/examples/Example1.hs. Example1 has a main method, and import App.SomeModule. Of course, when I try to compile or run Example1 it dies because it can’t find App.SomeModule.
How do you solve this problem? Is there some kind of search path mechanism where I can tell ghc to look in the other folder for files? Do you do anything different for development?
On the command line,
$ ghc doc/examples/Example1 -i src/. You can also have a.cabalfile indoc/exampleswithhs-source-dirs: ../../srcfor example.