[#162] Remove artificial delay in allowRewrite

Problem: `allowRewrite` uses `threadDelay (ms 100)` to "prevent our
output to interleave with further outputs".

It's not exactly what problem this is supposed to address, and how it's
supposed to fix it. This seems like it may have been an earlier attempt
to fix the issue addressed in the previous commit.

Solution: delete `threadDelay`.
This commit is contained in:
Diogo Castro 2022-09-24 17:47:53 +01:00
parent 1964f57280
commit 25d73c3d09
No known key found for this signature in database
GPG Key ID: 24CC151ACE03BA28

View File

@ -31,7 +31,7 @@ import Universum
import Data.Ratio ((%))
import System.Console.Pretty (Color (..), Style (..), color, style)
import Time (Second, Time, ms, sec, threadDelay, unTime, (-:-))
import Time (Second, Time, sec, unTime, (-:-))
-----------------------------------------------------------
-- Task timestamp
@ -225,8 +225,6 @@ allowRewrite enabled = bracket prepare erase
erase (Rewrite RewriteCtx{..}) = liftIO $ do
maxPrintedSize <- readIORef rMaxPrintedSize
hPutStr stderr $ '\r' : replicate maxPrintedSize ' ' ++ "\r"
-- prevent our output to interleave with further outputs
threadDelay (ms 100)
erase RewriteDisabled = pass
-- | Return caret and print the given text.