@@ -81,13 +81,10 @@ tellResources resources' = Rules $ tell $
8181
8282
8383--------------------------------------------------------------------------------
84−match :: Pattern -> Rules b -> Rules b
85−match pattern = Rules . censor matchRoutes . local addPattern . unRules
84+-- | Make sure routes are consistent with the compilers in this section
85+fixRoutes :: Rules b -> Rules b
86+fixRoutes = Rules . censor matchRoutes . unRules
8687 where
87− addPattern env = env
88− { rulesPattern = rulesPattern env `mappend` pattern
89− }
90−
9188 -- Create a fast pattern for routing that matches exactly the compilers
9289 -- created in the block given to match
9390 matchRoutes ruleSet = ruleSet
@@ -97,10 +94,18 @@ match pattern = Rules . censor matchRoutes . local addPattern . unRules
9794 fastPattern = fromList [id' | (id', _) <- rulesCompilers ruleSet]
9895
9996
97+--------------------------------------------------------------------------------
98+match :: Pattern -> Rules b -> Rules b
99+match pattern = fixRoutes . Rules . local addPattern . unRules
100+ where
101+ addPattern env = env
102+ { rulesPattern = rulesPattern env `mappend` pattern
103+ }
104+
100105
101106--------------------------------------------------------------------------------
102107version :: String -> Rules a -> Rules a
103−version v = Rules . local setVersion' . unRules
108+version v = fixRoutes . Rules . local setVersion' . unRules
104109 where
105110 setVersion' env = env {rulesVersion = Just v}
106111