[add putW routine to UnionFind
John Meacham <john@repetae.net>**20060503035047] hunk ./Util/UnionFind.hs 4
+    find,
+    fromElement,
+    getW,
hunk ./Util/UnionFind.hs 9
-    updateW,
-    getW,
-    find,
+    putW,
hunk ./Util/UnionFind.hs 12
-    fromElement
+    updateW
hunk ./Util/UnionFind.hs 54
-    Weight s w <- readIORef  r
-    writeIORef r (Weight s (f w))
-
+    modifyIORef r (\ (Weight s w) -> Weight s (f w))
hunk ./Util/UnionFind.hs 56
+putW :: MonadIO m => Element w a -> w -> m ()
+putW e w = liftIO $ do
+    Element _ _ r <- find e
+    modifyIORef r (\ (Weight s _) -> Weight s w)