reexport warnings

Simon Peyton-Jones simonpj at
Mon Oct 20 09:36:02 EDT 2003

| My application program (called DoCon),
| being ported recently to  ghc-6.0.1,
| needs to provide the user (program) with the following visibility
| scope of items:
|                     all the proper DoCon export
|                  + most of Haskell standard library
|                  + FiniteMap, and maybe some others
| module DExport
|   (module DPrelude, module Categs, ...  -- DoCon  proper export
|    ...
|    module Data.FiniteMap,
|    module Prelude, module List,  module Ratio, module Random
|   )
| Is this a reasonable way to arrange the thing?

Yes, this looks fine to me.

| Now, the  ghc-6.0.1  compiler reports
| Compiling DExport  ...
|   Warning: `++' is exported by `module Prelude' and `module List' ..
| I think that these overlaps are harmless, and the compiler will still
| set the intended definitions for  (++), foldr, etc.,
| without any danger.

Correct.  You can suppress these warnings with

| Aslo proper DoCon export fron  DExport  has many similar overlaps.
| I think that it is often useful to be able to import an item from
| different modules. Is this reasonable?

It's fine.  The warning is only saying that either one of the exports
would do by
itself for (++).  Perhaps there should not be a warning when both export
specifiers are 'module X'.

| Generally, I accept these overlap warnings as useful ones.
| But at the installation, such strange numerous warnings on  DExport
| will frighten the user.
| Therefore, Makefile has, probably, to compile the last module
| DExport with this kind of messages switched off.

Yes, -fno-warn-duplicate-exports should do the job.  You can even put it
in the
file thus:
	{-# OPTIONS -fno-warn-duplicate-exports #-}


More information about the Glasgow-haskell-users mailing list