[Haskell-cafe] cabal Main-Is restriction

Nicolas Frisby nicolas.frisby at gmail.com
Thu Nov 15 12:14:19 EST 2007

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

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.


More information about the Haskell-Cafe mailing list