> module A where
> Main.main = putLine "HALLO"

You cannot define a function belonging to another module than the current
(`A' in this case).

Instead, call your module `Main', but put into a file called `A.hs'. This
should work. However, the interface file created by ghc will be called
`Main.hi', so you run into other problems. If in doubt, remove the
interface file before compiling a `wrong named' Main.

Proposal for ghc: what about adding an option `--main' to the compiler
that tells ghc that the module compiled contains the main function, even
if it's name differs from `Main'? If multiple files are compiled at once,
`--main=MyMain' would be an alternative, e.g.:

ghc -o foo --main=A A.hs SomeOtherFile.hs

Bye,
        Kili

-- 
de: Signaturen erzeugen Krebs.          en: Signatures cause cancer.
es: Signaturas provocan cáncer.         latin: Cancerem signatura faciunt.
se: Signaturer förorsaka cancer.        fr: Les signatures provoquent le cancer.
ro: Signaturile produc cancer.          ru: Podpis'ki razvivaút rak.

Reply via email to