[Added destructors for BnbNode for better readability and easier addition of fields.
tobias@goedderz.info**20150330095559
 Ignore-this: 2bbe5e121985bb0fdc9bc507042b6165
] hunk ./src/Igor2/RuleDevelopment/Matching.hs 138
-    BnbNode (Ordering, ArgList FunList) (ArgList Rule) [[(Ordering, ArgList Rule)]]
+    BnbNode
+        { nodeHistory :: (Ordering, ArgList FunList)
+        , nodeLggs :: (ArgList Rule)
+        , residualIOMatrix :: [[(Ordering, ArgList Rule)]]
+        }
hunk ./src/Igor2/RuleDevelopment/Matching.hs 152
-        keyOfBnbNode (BnbNode hist lggs _) = length $ filter Rules.isOpen lggs
+        keyOfBnbNode (BnbNode { nodeHistory = hist, nodeLggs = lggs }) =
+            length $ filter Rules.isOpen lggs
hunk ./src/Igor2/RuleDevelopment/Matching.hs 156
-        childrenOfBnbNode (BnbNode hist lggs (xs:xxs)) =
-            map (\(o, rs) ->
-                let cmInnerNode = do
-                        let nhist = (max o *** multiCons rs) hist
-                        nlggs <- nextLggs lggs rs
-                        return (BnbNode nhist nlggs xxs)
-                in case cmInnerNode `withC` context of
-                    Left err -> error err
-                    Right x -> x
-            ) xs
+        childrenOfBnbNode (BnbNode
+            { nodeHistory = hist
+            , nodeLggs = lggs
+            , residualIOMatrix = (xs:xxs)
+            }) =
+                map (\(o, rs) ->
+                    let cmInnerNode = do
+                            let nhist = (max o *** multiCons rs) hist
+                            nlggs <- nextLggs lggs rs
+                            return (BnbNode
+                                { nodeHistory = nhist
+                                , nodeLggs = nlggs
+                                , residualIOMatrix = xxs
+                                })
+                    in case cmInnerNode `withC` context of
+                        Left err -> error err
+                        Right x -> x
+                ) xs
hunk ./src/Igor2/RuleDevelopment/Matching.hs 176
-        valueOfBnbNode x@(BnbNode _ _ [])    = BnB.Solution   (keyOfBnbNode x)
-        valueOfBnbNode x@(BnbNode _ _ (_:_)) = BnB.LowerBound (keyOfBnbNode x)
+        valueOfBnbNode x@(BnbNode { residualIOMatrix = []  }) = BnB.Solution   (keyOfBnbNode x)
+        valueOfBnbNode x@(BnbNode { residualIOMatrix = _:_ }) = BnB.LowerBound (keyOfBnbNode x)
hunk ./src/Igor2/RuleDevelopment/Matching.hs 186
-        initialNode = BnbNode (LT, []) [] ioMatrix
+        initialNode = BnbNode
+            { nodeHistory = (LT, [])
+            , nodeLggs = []
+            , residualIOMatrix = ioMatrix
+            }
hunk ./src/Igor2/RuleDevelopment/Matching.hs 203
-    in map (\(BnbNode (ord, rules) lggs []) -> (ord, saveClosedLggs rules lggs)) solutions
+    in [ (ord, saveClosedLggs rules lggs)
+       | BnbNode { nodeHistory = (ord, rules)
+                 , nodeLggs = lggs
+                 , residualIOMatrix = []
+                 }
+            <- solutions
+       ]