Open
Description
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 of zs
) amount of computation as part of the STM
transaction AFAICT. If so, it probably makes sense to either fix this (but it isn't high priority as it isn't used by IO
) or remove the comment.
Also see the upstream readTBQueue
for comparison: https://github.com/haskell/stm/blob/07df1050ab5d45244f718eee8a512bb18e7066f6/Control/Concurrent/STM/TBQueue.hs#L133-L140