From 34cc1f198763bcc9e9293ebbb50820b66805fbdf Mon Sep 17 00:00:00 2001 From: konsumlamm <konsumlamm@gmail.com> Date: Sat, 9 Sep 2023 02:43:01 +0200 Subject: [PATCH] Update implementation note --- Control/Concurrent/STM/TBQueue.hs | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/Control/Concurrent/STM/TBQueue.hs b/Control/Concurrent/STM/TBQueue.hs index be90360..2cd9007 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 -- GitLab