Browse Source

removed head and tail

master
Jon Kristensen 14 years ago
parent
commit
d33f32d5cc
  1. 7
      src/Network/XMPP/Utilities.hs

7
src/Network/XMPP/Utilities.hs

@ -38,8 +38,11 @@ idGenerator prefix = atomically $ do
next :: TVar [Text.Text] -> IO Text.Text next :: TVar [Text.Text] -> IO Text.Text
next tvar = atomically $ do next tvar = atomically $ do
list <- readTVar tvar list <- readTVar tvar
writeTVar tvar $ tail list case list of
return $ head list [] -> error "empty list in Utilities.hs"
(x:xs) -> do
writeTVar tvar xs
return x
-- Generates an infinite and predictable list of IDs, all beginning with the -- Generates an infinite and predictable list of IDs, all beginning with the
-- provided prefix. -- provided prefix.

Loading…
Cancel
Save