> In Haskell, the `main' function must reside in the `Main' module.
> Add to this that the `Main' module must reside in a `Main' file and
> you have an unfortunate consequence that you can only have one `Main'
> function in each directory.

Actually, Haskell does not insist that a module named X must reside in
a file called X.  Many *implementations* do, but that is not required
behaviour.  In particular, since module Main is not imported by any
other modules, it certainly need not live in a file called Main.hs,
and compilers like hbc and nhc13/98 are quite happy with that.

> Even when taking the simple example from my previous^2 post
>   ghc -c Add.hs
>   ghc -c Main.hs
>   ghc -o Main Main.o Add.o
> we notice that it takes three commands, in the right order, each with
> a non optional flag.  There is nothing present here that couldn't be
> deducted directly from the contents of `Main.hs', thus a simple `ghc'
> (or `ghc Main' assuming my first plea) command should have sufficed.

Well, the `hmake' tool does all that for you.  It is currently packaged
with the nhc13/98 compiler, but it doesn't have any particular
dependency on nhc - it works well with hbc and ghc too - and I'm
planning to give it a separate release in the next couple of weeks.
Watch this space!

Regards,
    Malcolm

---------------------------------------- [EMAIL PROTECTED]


Reply via email to