[make equality constraints work, clean up code some, don't require 'Eq' instance for solve
John Meacham <john@repetae.net>**20070301012351] hunk ./Util/UnionSolve.hs 66
-equals x y = (x `islte` y) `mappend` (y `islte` x)
+--equals x y = (x `islte` y) `mappend` (y `islte` x)
+
+equals x y = is x y
hunk ./Util/UnionSolve.hs 76
+    deriving(Show)
hunk ./Util/UnionSolve.hs 116
-solve :: (Fixable l, Show l, Show v, Ord v,Eq l) =>  C l v -> IO (Map.Map v v,Map.Map v (Result l v))
+{-# NOINLINE solve #-}
+solve :: (Fixable l, Show l, Show v, Ord v) =>  C l v -> IO (Map.Map v v,Map.Map v (Result l v))
hunk ./Util/UnionSolve.hs 141
-        prule (Right x `Clte` Right y)
-            | x `lte` y = return ()
-            | otherwise = fail $ "invalid constraint: " ++ show x ++ " <= " ++ show y
+        prule (Right v `Cset` Left x) = prule (Left x `Cset` Right v)
hunk ./Util/UnionSolve.hs 147
-        prule (Right v `Cset` Left x) = ans where
-            Just xe = Map.lookup x umap
-            ans = do
-                xe <- UF.find xe
-                xe `setValue` v
hunk ./Util/UnionSolve.hs 154
+        -- handle constant cases, just check if valid, and perhaps report error
hunk ./Util/UnionSolve.hs 158
+        prule (Right x `Clte` Right y)
+            | x `lte` y = return ()
+            | otherwise = fail $ "invalid constraint: " ++ show x ++ " <= " ++ show y
hunk ./Util/UnionSolve.hs 175
-                            when (Just v /= mu) $ mapM_ (\lb -> v `greaterThen` lb) (Set.toList lb)
-                            when (Just v /= ml) $ mapM_ (\ub -> v `lessThen` ub) (Set.toList ub)
+                            when (Just v `nem` mu) $ mapM_ (\lb -> v `greaterThen` lb) (Set.toList lb)
+                            when (Just v `nem` ml) $ mapM_ (\ub -> v `lessThen` ub) (Set.toList ub)
+        nem Nothing Nothing = False
+        nem (Just x) (Just y) = not (x `eq` y)
+        nem _ _ = True
hunk ./Util/UnionSolve.hs 251
-                    updateW (\_ -> Ri (xml `mmeet` yml) (Set.delete xe $ xlb `mappend` ylb) (xmu `mjoin` ymu) (Set.delete xe $ yub `mappend` xub)) xe
+                    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
+                (Ri xml xlb xmu xub,R c) -> do xe `setValue` c
+                (R c,Ri xml xlb xmu xub) -> do xe `setValue` c
+                (R c1,R c2) | c1 `eq` c2 -> return ()
+                _ -> fail $ "error: " ++ show (xw,yw)