Commit 3a42f210 authored by Michael D. Adams's avatar Michael D. Adams
Browse files

Added listSplitUniqSupply to ./compiler/basicTypes/UniqSupply.lhs

The function
  listSplitUniqSupply :: UniqSupply -> [UniqSupply]
splits a UniqSupply into an infinite list of supplies.
It is a generalization of splitUniqSupply.
parent b4fd4649
......@@ -18,7 +18,7 @@ module UniqSupply (
lazyThenUs, lazyMapUs,
mkSplitUniqSupply,
splitUniqSupply
splitUniqSupply, listSplitUniqSupply
) where
#include "HsVersions.h"
......@@ -56,6 +56,7 @@ data UniqSupply
mkSplitUniqSupply :: Char -> IO UniqSupply
splitUniqSupply :: UniqSupply -> (UniqSupply, UniqSupply)
listSplitUniqSupply :: UniqSupply -> [UniqSupply] -- Infinite
uniqFromSupply :: UniqSupply -> Unique
uniqsFromSupply :: UniqSupply -> [Unique] -- Infinite
\end{code}
......@@ -80,6 +81,7 @@ mkSplitUniqSupply (C# c#)
foreign import ccall unsafe "genSymZh" genSymZh :: IO Int
splitUniqSupply (MkSplitUniqSupply _ s1 s2) = (s1, s2)
listSplitUniqSupply (MkSplitUniqSupply _ s1 s2) = s1 : listSplitUniqSupply s2
\end{code}
\begin{code}
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment