Hi, thanks for the reply - I will give a try.
> Though standard practice these days in Haskell projects is to put the code in
> an src directory.
>
Yes, I put it in the src folder - sorry if I haven’t provided a real project
structure - basically what I have is
+root
| +app
| Main.hs
| +src
| + MyModule
| MyModule.hs
so, I’m following standard approach for a Stack project
> On 21 Jul 2020, at 11:07, Michael Snoyman <[email protected]> wrote:
>
> 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 <https://github.com/sol/hpack#readme>
> On Tuesday, July 21, 2020 at 12:55:48 PM UTC+3 [email protected]
> <http://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 [email protected]
> <mailto:[email protected]>.
> To view this discussion on the web visit
> https://groups.google.com/d/msgid/haskell-stack/1d5f9491-85bc-45a2-9ddb-a03e0aaf0b06n%40googlegroups.com
>
> <https://groups.google.com/d/msgid/haskell-stack/1d5f9491-85bc-45a2-9ddb-a03e0aaf0b06n%40googlegroups.com?utm_medium=email&utm_source=footer>.
--
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 [email protected].
To view this discussion on the web visit
https://groups.google.com/d/msgid/haskell-stack/AA32B78E-F552-4CC1-94F3-E9809FAF0982%40googlemail.com.