aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--src/Ghci.hs6
1 files changed, 3 insertions, 3 deletions
diff --git a/src/Ghci.hs b/src/Ghci.hs
index 85081c5..d16d2a0 100644
--- a/src/Ghci.hs
+++ b/src/Ghci.hs
@@ -214,11 +214,11 @@ hGetUntil h mmax tag = do
when (nread <= 0) $ exitEarly (BSB.toLazyByteString builder, ReachedEOF)
bs <- lift $ BS.packCStringLen (ptr, nread)
- -- lift $ putStrLn ("Read: " ++ show bs)
+ when debugPrints $ lift $ hPutStrLn stderr ("Read: " ++ show bs)
when (or [BSS.toShort (BS.takeEnd suflen bs) == BSS.takeEnd suflen tag
| n <- 0 : havePrefixes
, let suflen = BSS.length tag - n]) $ do
- -- lift $ putStrLn "yay determined end"
+ when debugPrints $ lift $ hPutStrLn stderr "yay determined end"
exitEarly (BSB.toLazyByteString (builder <> BSB.byteString bs)
,ReachedTag)
@@ -232,7 +232,7 @@ hGetUntil h mmax tag = do
[n -- new matches
| n <- [1 .. min (BS.length bs) (BSS.length tag)]
, BSS.toShort (BS.takeEnd n bs) == BSS.take n tag]
- -- lift $ putStrLn ("nextPrefixes = " ++ show nextPrefixes)
+ when debugPrints $ lift $ hPutStrLn stderr ("nextPrefixes = " ++ show nextPrefixes)
loop (yet + nread) nextPrefixes (builder <> BSB.byteString bs)
result <- execExitEarlyT (loop 0 [] mempty)
when debugPrints $ hPutStrLn stderr ("Read: <" ++ show result ++ ">")