[ ghc-Bugs-482596 ] ghc requires main to be in Main

noreply@sourceforge.net noreply@sourceforge.net
Fri, 16 Nov 2001 12:13:00 -0800


Bugs item #482596, was opened at 2001-11-16 12:12
You can respond by visiting: 
http://sourceforge.net/tracker/?func=detail&atid=108032&aid=482596&group_id=8032

Category: Compiler
Group: 5.02
Status: Open
Resolution: None
Priority: 5
Submitted By: Iavor S. Diatchki (iavor_sd)
Assigned to: Nobody/Anonymous (nobody)
Summary: ghc requires main to be in Main

Initial Comment:
it looks like ghc requires that the main function
be defined in the module Main, rather than simply
be exported from Main as the report says.  

here is an example:

module Main(main) where
import B


module B where
main = print "hello"


ghc B.hs Main.hs
Module `Main' must include a definition for `main'

i tried this using ghc-5.02 on linux (mandrake 8.0 
distribution)


----------------------------------------------------------------------

You can respond by visiting: 
http://sourceforge.net/tracker/?func=detail&atid=108032&aid=482596&group_id=8032