[Haskell-beginners] GHC compilation without using module Main

Andrew Pennebaker andrew.pennebaker at gmail.com
Mon Mar 7 00:21:35 CET 2011


It turns out you need to delete scriptedmain.o in order for test.hs to
compile.

Cheers,

Andrew Pennebaker
www.yellosoft.us



On Sun, Mar 6, 2011 at 5:54 PM, Daniel Fischer <
daniel.is.fischer at googlemail.com> wrote:

> 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.
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://www.haskell.org/pipermail/beginners/attachments/20110306/3a8496a4/attachment.htm>


More information about the Beginners mailing list