[add alternating once
John Meacham <john@repetae.net>**20050928083029] hunk ./Util/Once.hs 4
-module Util.Once(Once, newOnce, runOnce) where
+module Util.Once(Once, newOnce, runOnce, altOnce) where
hunk ./Util/Once.hs 29
+
+-- | run first argument once, after which perform the second
+
+altOnce :: Once () -> IO b -> IO b -> IO b
+altOnce (Once ref) first second = do
+    b <- readIORef ref
+    case b of
+        Just _ -> second
+        Nothing -> do
+            writeIORef ref (Just ())
+            first
+
+