Main.main naming convention

Manuel M T Chakravarty chak@cse.unsw.edu.au
Tue, 10 Sep 2002 09:22:30 +1000 (EST)


Martin Norb=E4ck <d95mback@dtek.chalmers.se> wrote,

> I have a question about the Main.main naming convention. Would it be =
a
> good idea to lift the restriction and allow any module which exports =
a
> function main :: IO () to be compiled into a separate binary?
> =

> You'd need to specify which module should be the top-level module whe=
n
> compiling, of course.
> =

> Why I'm asking is because I have several Main modules in one director=
y,
> in files like Program1.hs, Program2.hs and so on, but all of these
> claims (and must claim) to be "module Main".

So?  That just means that the file name of Program1.hs,
Program2.hs, etc will be different from the name of the
module that they contain.  I think all Haskell systems allow
the Main module to be in a file whose name differs from the
module name (in contrast to other modules, which need to be
found when chasing imports).

Cheers,
Manuel