I have my foo.cabal file looking like this:
library
exposed-modules:
Foo.Bar,
Foo.Something
hs-source-dirs: lib
default-language: Haskell2010
executable foobar
main-is: Main.hs
other-modules:
Utils, -- Local module in ./src
Foo.Bar
hs-source-dirs: src
default-language: Haskell2010
According to the sample code here: https://www.haskell.org/cabal/users-guide/developing-packages.html#example-a-package-containing-a-library-and-executable-programs
And I get the following error:
$ cabal build
Resolving dependencies...
Configuring foobar-0.1.0.0...
Preprocessing executable 'foobar' for foobar-0.1.0.0..
cabal: can't find source for Foo/Bar in src, dist/build/foobar/autogen,
dist/build/global-autogen