example for recursive import

Serge D. Mechveliani mechvel at botik.ru
Wed Jun 7 05:13:42 EDT 2006


Johannes Waldmann <waldmann at imn.htwk-leipzig.de> writes on 
Junne 6 2006 

> As for recursive module imports,
> could you perhaps show an example where this occurs.
> I found that in my code, I can re-arrange things
> so as to remove the cyclic dependency. Best regards,


Consider the following situation, which often happens.
* A function  f  calls for  g  and for  h,
  each  g  and  h  calls for  f.
* f  is a large implementation, gathered in the module  F.
* g and h  are the two important special cases for  f,  each 
  implemented as a large source, according to its very particular
  principles.
* Each of these three functions needs only a small part of the 
  name space needed for other two functions
  (modules are also for structuring the name space).

>From the conceptual point of view, we need at least  three modules 
in this case. This way this program is easier to write and to 
understand. But the module import occurs cyclic.  

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



More information about the Glasgow-haskell-users mailing list