Is a comment about laziness in tryReadTBQueueDefault
correct?
#197
Labels
question
Further information is requested
tryReadTBQueueDefault
correct?
#197
While putting #196 together I noticed this comment:
io-sim/io-sim/src/Control/Monad/IOSim/STM.hs
Lines 156 to 160 in 785dc08
Is this actually true for the code here? This doesn't look like a lazy pattern match to me; forcing the first cons of
reverse ys
will force the linear (in the length ofzs
) amount of computation as part of theSTM
transaction AFAICT. If so, it probably makes sense to either fix this (but it isn't high priority as it isn't used byIO
) or remove the comment.Also see the upstream
readTBQueue
for comparison: https://github.com/haskell/stm/blob/07df1050ab5d45244f718eee8a512bb18e7066f6/Control/Concurrent/STM/TBQueue.hs#L133-L140The text was updated successfully, but these errors were encountered: