trying to have 2 executables in my properly named 'MyFirstProject'
executables:
run-it:
source-dirs: app/
main: Main.hs
dependencies:
MyFirstProject
hello:
source-dirs: app/Hello/
main: Main.hs
(MyFirstProject is a library inside this same project, but it's completely irrelevant)
± |master U:3 ?:2 ✗| → tree app/
app/
├── Hello
│ └── Main.hs
└── Main.hs
stack build fails, because my hello's module isn't called Main:
<no location info>: error:
output was redirected with -o, but no output will be generated
because there is no Main module.
it is correct - given the tree above, the module is named Hello.Main:
module Hello.Main where
main :: IO ()
main = putStrLn "Hello, world"
but, of course, if I were to call it Main, I will get the expected:
File name does not match module name:
Saw: ‘Main’
Expected: ‘Hello.Main’
|
1 | module Main where
| ^^^^
feels like catch 22, eh? I can't call the module Main AND place it at the root of app/, because there's a default-generated one in there already (which builds no problem, if I comment the 'hello' one out)