
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
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