[Haskell-beginners] GHC compilation without using module Main

Daniel Fischer daniel.is.fischer at googlemail.com
Sun Mar 6 23:54:53 CET 2011

On Sunday 06 March 2011 23:32:43, Andrew Pennebaker wrote:
> Is there a way to compile a Haskell script with a different module name
> than Main?

$ ghc -main-is ScriptedMain --make ScriptedMain

The -main-is flag tells GHC what to regard as Main.main.
Give it a module name (Foo) to say main is Foo.main, a function name (bar) 
to tell it main is Main.bar or a quailfied function name (Foo.bar) to tell 
it main is function bar in module Foo.

More information about the Beginners mailing list