[fix memory leak in "fuse . getAll n"
Helmut Grohne <grohne@cs.uni-bonn.de>**20150305132525
 Ignore-this: 3eb06b5d7b900efec093b755b2d6701d
 
 If the indices in a CovrRule returned from fuse are never computed, the passed
 [CovrRule] must be preserved in memory even though it was already completely
 forced by the lggRules call. Thus the full result of getAll was persisted in
 memory.
 
 Now in this composition the name equality check holds by definition and the
 index list also is trivial, so a targeted implementation of this composition
 can save up to 20% memory for some examples. It also speeds up the test suite
 by 1%.
] hunk ./src/Igor2/Data/IOData.hs 6
-    
-    CovrRules, covrRules, 
-    
-    IOData,initIOData, getAll, breakup, fuse, insertRules 
+
+    CovrRules, covrRules,
+
+    IOData, initIOData, getAll, breakup, fuse, fuseByName, insertRules
hunk ./src/Igor2/Data/IOData.hs 106
-getAll :: Name -> IOData ->  [CovrRule]
-getAll n iod = 
+getRules :: Name -> IOData -> Rules
+getRules n iod =
hunk ./src/Igor2/Data/IOData.hs 109
-        Just rs -> let rl = S.toList rs
-                   in [RF n r [i] | (r, i) <- zip rl [0..]]
-        Nothing -> error $ "IOData.getByName: No Rules for Name" ++ show n
+        Just rs -> rs
+        Nothing -> error $ "no Rules for " ++ show n ++ " in IOData"
+
+getAll :: Name -> IOData -> [CovrRule]
+getAll n iod = [RF n r [i] | (r, i) <- zip (S.toList (getRules n iod)) [0..]]
hunk ./src/Igor2/Data/IOData.hs 144
-fuse :: [CovrRule] ->  LM CovrRule
+fuseByName :: Name -> IOData -> LM CovrRule
+fuseByName n iod = do
+    let rs = getRules n iod
+    rule <- lggRules $ S.toList rs
+    let indices = [0 .. (S.size rs - 1)]
+    return $ RF n rule indices
+
+fuse :: [CovrRule] -> LM CovrRule
hunk ./src/Igor2/Data/IgorMonad.hs 254
-coverAll n = gets igor_io >>= lift . fuse . (getAll n)
+coverAll n = getEvidence >>= lift . fuseByName n