[allow specification of the function to print logging information, check for crossing bounds on equality constraint
John Meacham <john@repetae.net>**20070301015255] hunk ./Util/UnionSolve.hs 7
-    islte,isgte,equals,is
+    islte,isgte,equals
hunk ./Util/UnionSolve.hs 63
-
-islte x y = C ((x `Clte` y):)
-isgte x y = islte y x
---equals x y = (x `islte` y) `mappend` (y `islte` x)
-
-equals x y = is x y
-
-is :: Either v l -> Either v l -> C l v
-is x y = C ((x `Cset` y):)
-
+islte  x y = C ((x `Clte` y):)
+isgte  x y = islte y x
+equals x y = C ((x `Cset` y):)
hunk ./Util/UnionSolve.hs 110
-solve :: (Fixable l, Show l, Show v, Ord v) =>  C l v -> IO (Map.Map v v,Map.Map v (Result l v))
-solve (C csp) = do
+solve :: (Fixable l, Show l, Show v, Ord v)
+    => (String -> IO ())
+    -> C l v
+    -> IO (Map.Map v v,Map.Map v (Result l v))
+solve putLog (C csp) = do
hunk ./Util/UnionSolve.hs 158
-            putStrLn $ "Setting value of " ++ show (fromElement xe) ++ " to " ++ show v
+            putLog $ "Setting value of " ++ show (fromElement xe) ++ " to " ++ show v
hunk ./Util/UnionSolve.hs 182
-            putStrLn $ "unifying to " ++ show (xe,ye)
+            putLog $ "unifying to " ++ show (xe,ye)
hunk ./Util/UnionSolve.hs 192
-            putStrLn $ "make sure " ++ show (fromElement xe) ++ " is less than " ++ show v
+            putLog $ "make sure " ++ show (fromElement xe) ++ " is less than " ++ show v
hunk ./Util/UnionSolve.hs 203
-            putStrLn $ "make sure " ++ show (fromElement xe) ++ " is greater than " ++ show v
+            putLog $ "make sure " ++ show (fromElement xe) ++ " is greater than " ++ show v
hunk ./Util/UnionSolve.hs 247
-                    nlb <- finds (xlb `mappend` ylb)
-                    nub <- finds (yub `mappend` xub)
-                    updateW (\_ -> Ri (xml `mmeet` yml) (Set.delete xe nlb) (xmu `mjoin` ymu) (Set.delete xe nub)) xe
+                    let nml = xml `mmeet` yml
+                        nmu = xmu `mjoin` ymu
+                    case (nml,nmu) of
+                        (Just x,Just y) | x `eq` y -> xe `setValue` x
+                                        | y `lte` x -> fail "equal not equal"
+                        _ -> do
+                            nlb <- finds (xlb `mappend` ylb)
+                            nub <- finds (yub `mappend` xub)
+                            updateW (\_ -> Ri nml (Set.delete xe nlb) nmu (Set.delete xe nub)) xe
hunk ./Util/UnionSolve.hs 340
+-- this is the opposite of the 'Maybe' instance