diff --git a/Control/Concurrent/STM/TBQueue.hs b/Control/Concurrent/STM/TBQueue.hs index be90360fdcddd546ca4f3441b67dfdd41600ba52..2cd9007f3a3b37def46bc33b566354b5b520c8ea 100644 --- a/Control/Concurrent/STM/TBQueue.hs +++ b/Control/Concurrent/STM/TBQueue.hs @@ -22,8 +22,7 @@ -- maximum number of elements, then 'writeTBQueue' blocks until an -- element is removed from the queue. -- --- The implementation is based on the traditional purely-functional --- queue representation that uses two lists to obtain amortised /O(1)/ +-- The implementation is based on an array to obtain /O(1)/ -- enqueue and dequeue operations. -- -- @since 2.4 @@ -59,7 +58,7 @@ import Control.Concurrent.STM.TArray -- -- @since 2.4 data TBQueue a - = TBQueue {-# UNPACK #-} !(TVar Int) -- read index + = TBQueue {-# UNPACK #-} !(TVar Int) -- read index {-# UNPACK #-} !(TVar Int) -- write index {-# UNPACK #-} !(TArray Int (Maybe a)) -- elements {-# UNPACK #-} !Int -- initial capacity