commercialhaskell / commercialhaskell/stack
"stack ghci" should load multiple executables if they have "ghc-options: -main-is ...`
Open
component: ghci
- Dominant language
- Haskell
- Stars
- 4.1k
- Forks
- 850
- Avg merge
- 10h 37m
- Merged PRs (30d)
- 4
Description
See [this stackoverflow question](https://stackoverflow.com/questions/46134228/haskell-stack-main-module-to-load-is-ambiguous). Issue is that there's no easy way for stack to know that `Apple.hs` has `module Apple where` vs being a `Main` module.
This only works with build because `-main-is Apple.main` is passed to ghc. Suggested resolution is to find `-main-is MN.*` in the ghc-options for executables / benchmarks / libraries. If it is there, then don't treat the component like it has a `Main` module.
An alternative, less pretty resolution would be to have a special flag to ignore the ambiguity check.
Contributor guide
Assessment
This issue has not been assessed yet.