Remove code that is dead now that we need >= 6.12 to build
[ghc-hetmet.git] / compiler / basicTypes / UniqSupply.lhs
index cb1a1fc..493bfbe 100644 (file)
@@ -8,15 +8,16 @@ module UniqSupply (
         -- * Main data type
         UniqSupply, -- Abstractly
 
-        -- ** Operations on supplies 
+        -- ** Operations on supplies
         uniqFromSupply, uniqsFromSupply, -- basic ops
-        
+        takeUniqFromSupply,
+
         mkSplitUniqSupply,
         splitUniqSupply, listSplitUniqSupply,
 
         -- * Unique supply monad and its abstraction
         UniqSM, MonadUnique(..),
-        
+
         -- ** Operations on the monad
         initUs, initUs_,
         lazyThenUs, lazyMapUs,
@@ -30,8 +31,7 @@ import FastTypes
 
 import MonadUtils
 import Control.Monad
-import Control.Monad.Fix
-import GHC.IOBase (unsafeDupableInterleaveIO)
+import GHC.IO (unsafeDupableInterleaveIO)
 
 \end{code}
 
@@ -67,6 +67,8 @@ uniqFromSupply  :: UniqSupply -> Unique
 -- ^ Obtain the 'Unique' from this particular 'UniqSupply'
 uniqsFromSupply :: UniqSupply -> [Unique] -- Infinite
 -- ^ Obtain an infinite list of 'Unique' that can be generated by constant splitting of the supply
+takeUniqFromSupply :: UniqSupply -> (Unique, UniqSupply)
+-- ^ Obtain the 'Unique' from this particular 'UniqSupply', and a new supply
 \end{code}
 
 \begin{code}
@@ -95,6 +97,7 @@ listSplitUniqSupply  (MkSplitUniqSupply _ s1 s2) = s1 : listSplitUniqSupply s2
 \begin{code}
 uniqFromSupply  (MkSplitUniqSupply n _ _)  = mkUniqueGrimily (iBox n)
 uniqsFromSupply (MkSplitUniqSupply n _ s2) = mkUniqueGrimily (iBox n) : uniqsFromSupply s2
+takeUniqFromSupply (MkSplitUniqSupply n s1 _) = (mkUniqueGrimily (iBox n), s1)
 \end{code}
 
 %************************************************************************