From 42098261a26732cad2f08bf90e57ae8da7d21cdf Mon Sep 17 00:00:00 2001 From: simonmar Date: Fri, 5 Mar 2004 16:04:52 +0000 Subject: [PATCH] [project @ 2004-03-05 16:04:52 by simonmar] Be clearer about when source files must match module names. --- ghc/docs/users_guide/separate_compilation.sgml | 14 +++++++++----- 1 file changed, 9 insertions(+), 5 deletions(-) diff --git a/ghc/docs/users_guide/separate_compilation.sgml b/ghc/docs/users_guide/separate_compilation.sgml index 3c20447..9eef1a9 100644 --- a/ghc/docs/users_guide/separate_compilation.sgml +++ b/ghc/docs/users_guide/separate_compilation.sgml @@ -118,17 +118,21 @@ interface file will be put in src/A/B/C.hi and the object file in src/A/B/C.o. - Note that it is reasonable to have a module + For any module that is imported, GHC requires that the + name of the module in the import statement exactly matches the + name of the module in the interface file (or source file) found + using the strategy specified in . + This means that for most modules, the source file name should + match the module name. + + However, note that it is reasonable to have a module Main in a file named foo.hs, but this only works because GHC never needs to search for the interface for module Main (because it is never imported). It is therefore possible to have several Main modules in separate source files in the same directory, and GHC - will not get confused. For modules other than - Main, it is strongly recommended that you - name the source file after the module name, replacing dots with - slashes in hierarchical module names. + will not get confused. In batch compilation mode, the name of the object file can also be overriden using the option, and the -- 1.7.10.4