[Haskell-cafe] cabal Main-Is restriction

Duncan Coutts duncan.coutts at worc.ox.ac.uk
Thu Nov 15 13:14:58 EST 2007

On Thu, 2007-11-15 at 11:14 -0600, Nicolas Frisby wrote:
> It seems the meaning of the -main-is switch for GHC and the Main-Is
> build option for Cabal executables differ. With GHC, I can point to
> any function "main" in any module, but in Cabal I must point to a
> filename with precisely the module name "Main". This is tying my hands
> with regard to organizing a default executable and exposing some of
> its functionality as a library. Is there a way to get around this
> restriction?

I've filed your feature request in the Cabal trac:

Do please add your suggestions in a comment there.

Login with username "guest" and password "haskell'" (note the apostrophe
at the end).

> Is this currently possible? I recognize the "add a separate
> Program-Main.hs file" workaround, but I'll avoid it if I can.

A workaround is to use:

main-is: Program/Main.hs
ghc-options: -main-is Program.Main


More information about the Haskell-Cafe mailing list