#2542: runghc does not infer module file extensions
----------------------+-----------------------------------------------------
 Reporter:  judah     |          Owner:         
     Type:  bug       |         Status:  new    
 Priority:  high      |      Milestone:  6.10.1 
Component:  Compiler  |        Version:  6.8.3  
 Severity:  normal    |     Resolution:         
 Keywords:            |     Difficulty:  Unknown
 Testcase:            |   Architecture:  Unknown
       Os:  Unknown   |  
----------------------+-----------------------------------------------------
Comment (by claus):

 (aside: would either `runhaskell Main` or adding `module Setup where`
 work?)

 The first two cases sound right overall, but note that they already differ
 in strictness of checking:

  - via module name, the file name has to match

  - via file name, the module name doesn't need to match.

 It would make more sense to have matching behaviour determined
 independently of the route, but the module-name route depends on strict
 matches to find the file (or ghc would have to check all sources for
 matching module names).

 We could still have a flag `ModuleFileNameMatch`, but it wouldn't buy
 much.

 The problem arises from `Setup.[l]hs` '''not''' having a module name,
 combined with the default being `Main`, which was meant to make finding
 and running `Main.main` in non-module code possible, while Cabal wants to
 find and run `Setup.main` in non-module code.

 Could we simply change the default module name?

  - if the filename is a module name, `File.[l]hs` introduces module `File`
 (and module `Main`, if we still need that?)

  - if there is an explicit module name, it has to match the file name or
 be `Main`

-- 
Ticket URL: <http://hackage.haskell.org/trac/ghc/ticket/2542#comment:9>
GHC <http://www.haskell.org/ghc/>
The Glasgow Haskell Compiler
_______________________________________________
Glasgow-haskell-bugs mailing list
Glasgow-haskell-bugs@haskell.org
http://www.haskell.org/mailman/listinfo/glasgow-haskell-bugs

Reply via email to