
16 Oct
2010
16 Oct
'10
9:39 a.m.
On Saturday 16 October 2010 10:59:10, Aleksandar Dimitrov wrote:
. GHC (the compiler itself) on the other hand, will just not produce a binary as long as your module name isn't "Main."
If your module name isn't Main, you have to tell GHC what to regard as the main module by passing the "-main-is" flag on the command line $ ghc -O2 --make -main-is Test -o Test Test.hs works. And your main function may also have a different name, e.g. $ ghc -O2 --make -main-is MultiMain.main2 -o main2 MultiMain.hs with module MultiMain where main1 :: IO () main1 = putStrLn "main1" main2 :: IO () main2 = putStrLn "You chose main two."