[GHC] #414: GHC does not eforce that Main exports main

GHC trac at galois.com
Fri Jan 13 06:38:48 EST 2006


#414: GHC does not eforce that Main exports main
-----------------------+----------------------------------------------------
  Reporter:  simonpj   |          Owner:  nobody  
      Type:  bug       |         Status:  assigned
  Priority:  lowest    |      Milestone:          
 Component:  Compiler  |        Version:  6.4.1   
  Severity:  normal    |     Resolution:  None    
  Keywords:            |             Os:  Unknown 
Difficulty:  Unknown   |   Architecture:  Unknown 
-----------------------+----------------------------------------------------
Changes (by simonmar):

  * version:  None => 6.4.1

Old description:

> {{{
> The Haskell 98 report says "A Haskell program is a
> collection of
> modules, one of which, by convention, must be called
> Main and must
> export the value main." However, the program below
> builds and executes
> fine.
>
> module Main() -- should be "module Main" or "module
> Main(main)"
> where
> main = putStrLn "Hello, World"
>
> $ runghc Main.hs
> Hello, World
>
> Originally reported by Brian Smith
> [brianlsmith at gmail.com]
> }}}

New description:

 {{{
 The Haskell 98 report says "A Haskell program is a
 collection of
 modules, one of which, by convention, must be called
 Main and must
 export the value main." However, the program below
 builds and executes
 fine.

 module Main() -- should be "module Main" or "module
 Main(main)"
 where
 main = putStrLn "Hello, World"

 $ runghc Main.hs
 Hello, World

 Originally reported by Brian Smith
 [brianlsmith at gmail.com]
 }}}

-- 
Ticket URL: <http://cvs.haskell.org/trac/ghc/ticket/414>
GHC <http://www.haskell.org/ghc/>
The Glasgow Haskell Compiler


More information about the Glasgow-haskell-bugs mailing list