Skip to content

Commit e16e841

Browse files
authored
Remove space leaks in a more robust way (#578)
Follow up from #557. We definitely want the progress state to be fully evaluated, so demand that with evaluating functions like evaluate and $!, rather than relying on the compiler to get it right. My guess is the `$!` is unnecessary now we have `evaluate`, but it's also not harmful, so belt and braces approach.
1 parent 3ec5edf commit e16e841

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

src/Development/IDE/Core/Shake.hs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -541,7 +541,7 @@ withProgress var file = actionBracket (f succ) (const $ f pred) . const
541541
-- This functions are deliberately eta-expanded to avoid space leaks.
542542
-- Do not remove the eta-expansion without profiling a session with at
543543
-- least 1000 modifications.
544-
where f shift = modifyVar_ var $ \x -> return (HMap.alter (\x -> Just (shift (fromMaybe 0 x))) file x)
544+
where f shift = modifyVar_ var $ \x -> evaluate $ HMap.alter (\x -> Just $! shift (fromMaybe 0 x)) file x
545545

546546

547547
defineEarlyCutoff

0 commit comments

Comments
 (0)