hierarchical module names

Serge D. Mechveliani mechvel at botik.ru
Thu Jun 23 08:25:48 EDT 2005


Who knows, please, where there are explained  
hierarchical module names?

Is this a matter of Haskell-98 or of GHC ?
I looked into both of them (and also a bit into libraries at haskell.org)
but could not find a basic explanation of the point, somehow missed.

Suppose that my user package called  dumatel  exports a module 
of kind

  ---------------------------
  module List (union) 
  where
  import Data.List
  import qualified List

  union xs ys = f (Data.List.union xs (List.union ys ys))

  f = ...
  ---------------------------


First, the module name  List  conflicts with such of the  base  package
of GHC.
So, I change this to

  ---------------------------
  module Dumatel.List (union) 
  where
  where
  import Data.List
  import qualified List

  union xs ys = f (Data.List.union xs (List.union ys ys))

  f = ...
  ---------------------------

Second,  -v  key in   ghc --make   shows that GHC decides to search for 
the  module Dumatel.List  only in the files  

     ./Dumatel/*.hs
and  ./Dumatel/*.lhs

So, I create a directory and put the above module to the file   
./Dumatel/List.hs 

Does this all mean "to use hierarchical module names"?
Does the module name "Dumatel.List" agree with Haskell-98 ?

What is the currently most convenient way to resolve module name 
clashes between the packages?
Is this the above arrangement with subdirectories and module names 
with dots (and with "qualified-as" import) ?

Thank you in advance for explanation.

Regards,

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


More information about the Glasgow-haskell-users mailing list