reexport warnings

Serge D. Mechveliani mechvel at botik.ru
Thu Oct 16 12:24:43 EDT 2003


Dear GHC and Haskell experts,

I need advice on the following question.
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 

(please, help  FiniteMap, Set  to become standard!).

What is the best way to organize this?

I arrange this by reexporting a large part of Haskell library from 
certain particular DoCon module  DExport.

This is put so because most mathematician users are lazy to search 
among proper Haskell libraries: they had already imported 
DoCon+(Haskell library)  from DoCon, and do not want to search
any more among  List, Ratio, etc.  


--------------------------------------------------------------
module DExport
  -- All the export of  DoCon + part of GHC exploited by DoCon.
  --
  -- Set the line       import DExport
  --
  -- if you are lazy to find more precisely which modules your
  -- program needs.

  (module DPrelude, module Categs, ...  -- DoCon  proper export
   ...
   module Data.FiniteMap,
   module Prelude, module List,  module Ratio, module Random
  )
where
import Data.FiniteMap
import List    hiding (minimum, maximum, sort, sortBy)
import Prelude hiding (minimum, maximum,             )
import Ratio
import Random

import DPrelude  -- DoCon proper import
...
------------------------------------------------- 


Is this a reasonable way to arrange the thing?

Now, the  ghc-6.0.1  compiler reports  

Compiling DExport  ...
  Warning: `++' is exported by `module Prelude' and `module List' ..
  Warning: `foldr' is exported by `module Prelude' and `module List' ..
  Warning: `concat' 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.

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?

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. 
Right?

Thank you in advance for your advice.

Answer, please, to   mechvel at botik.ru

-----------------
Serge Mechveliani
mechvel at botik.ru


More information about the Glasgow-haskell-users mailing list