
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? Concretely, I want to point Cabal's Main-Is to Program/Main.hs which starts with module Program.Main where instead of just module Main where Is this currently possible? I recognize the "add a separate Program-Main.hs file" workaround, but I'll avoid it if I can. Thanks!

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: http://hackage.haskell.org/trac/hackage/ticket/179 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 Duncan
participants (2)
-
Duncan Coutts
-
Nicolas Frisby