That sort of code (stripped out):

In Game.hs:

data Game = Game { ...
                   activeRules :: [Rule]}

applyTo :: Rule -> Game -> Game
applyTo r gs = ...


In Rule.hs:

data Rule = Cond (Obs) Rule Rule
          | many others..
          deriving (Read, Show, Eq, Typeable)

data NamedRule = NamedRule { ...,
                             rule :: Rule }

isRuleLegal :: Rule -> NamedRule -> Game -> Bool
isRuleLegal = ...


In Obs.hs:

data Obs a where
     ProposedBy :: Obs Int   -- The player that proposed the tested rule
     ...


evalObs :: Obs -> NamedRule -> Game -> EvalObsType
evalObs = ...


Corentin




                                                                       
             Johannes                                                  
             Waldmann                                                  
             <waldm...@imn.ht                                         Pour
             wk-leipzig.de>            haskell-cafe@haskell.org        
             Envoyé par :                                               cc
             haskell-cafe-bou                                          
             n...@haskell.org                                        Objet
                                       [Haskell-cafe] Re: circular imports
                                                                       
             07/09/2010 14:00                                          
                                                                       
                                                                       
                                                                       
                                                                       




 <corentin.dupont <at> ext.mpsa.com> writes:

> I had recently a really hard time splitting up my program into parts!
> The natural, business-oriented split up drove me into a deadly circular
> dependency.

perhaps you could post your code (enough of it to understand the problem)?

J.W.


_______________________________________________
Haskell-Cafe mailing list
Haskell-Cafe@haskell.org
http://www.haskell.org/mailman/listinfo/haskell-cafe


_______________________________________________
Haskell-Cafe mailing list
Haskell-Cafe@haskell.org
http://www.haskell.org/mailman/listinfo/haskell-cafe

Reply via email to