You can use source-dirs (in hpack/package.yaml) or hs-source-dirs (in cabal files) to specify the directory. Though standard practice these days in Haskell projects is to put the code in an src directory.
For more information on hpack settings and some examples, check out: https://github.com/sol/hpack#readme On Tuesday, July 21, 2020 at 12:55:48 PM UTC+3 sdrubo...@googlemail.com wrote: > Hi everyone, > I'm trying to add Stack to my existing Haskell project. however, when I > try to build it with Stack I get the following error > > File name does not match module name: >> >> Saw: ‘MyModuleName’ >> >> Expected: ‘ MyModuleName. MyModuleName’ >> >> | >> >> 4 | module MyModuleName >> >> > This is happening because I've structured the project in the following > way. > > + root > + MyModuleName > |---- MyModuleName > | Main.hs > > With GHC you can easily fix this issue by using "-i" flag - e.g. > "-iMyModuleName". Therefore I was wondering if I can define the same > "search path" on Stack. > > Thanks in advance > Gianluca > -- You received this message because you are subscribed to the Google Groups "haskell-stack" group. To unsubscribe from this group and stop receiving emails from it, send an email to haskell-stack+unsubscr...@googlegroups.com. To view this discussion on the web visit https://groups.google.com/d/msgid/haskell-stack/1d5f9491-85bc-45a2-9ddb-a03e0aaf0b06n%40googlegroups.com.