summaryrefslogtreecommitdiff
path: root/libraries/base/Data/Unique.hs
diff options
context:
space:
mode:
authorBas van Dijk <v.dijk.bas@gmail.com>2010-03-19 12:59:51 +0000
committerBas van Dijk <v.dijk.bas@gmail.com>2010-03-19 12:59:51 +0000
commitf513faee164cd07a68063e78efbff1e34b74f53e (patch)
treeaceeb17a250d2bb0baa56b58d99ba20ace80b9d3 /libraries/base/Data/Unique.hs
parent843fd341a530850b7a00a13aa73f05645dd228f5 (diff)
downloadhaskell-f513faee164cd07a68063e78efbff1e34b74f53e.tar.gz
Write the thunk 'next' to the MVar
Diffstat (limited to 'libraries/base/Data/Unique.hs')
-rw-r--r--libraries/base/Data/Unique.hs2
1 files changed, 1 insertions, 1 deletions
diff --git a/libraries/base/Data/Unique.hs b/libraries/base/Data/Unique.hs
index 38c8e483bb..55dfa5064e 100644
--- a/libraries/base/Data/Unique.hs
+++ b/libraries/base/Data/Unique.hs
@@ -45,7 +45,7 @@ newUnique :: IO Unique
newUnique = atomically $ do
val <- readTVar uniqSource
let next = val+1
- writeTVar uniqSource $! val + 1
+ writeTVar uniqSource $! next
return (Unique next)
-- SDM (18/3/2010): changed from MVar to STM. This fixes