Commit d43d63f5 authored by anfarmer@ku.edu's avatar anfarmer@ku.edu Committed by ian@well-typed.com

Fix thunk leak in CoreM's CoreWriter

parent cef115fc
......@@ -762,7 +762,8 @@ instance Monad CoreM where
mx >>= f = CoreM $ \s -> do
(x, s', w1) <- unCoreM mx s
(y, s'', w2) <- unCoreM (f x) s'
return (y, s'', w1 `plusWriter` w2)
let w = w1 `plusWriter` w2 -- forcing w before returning avoids a space leak (Trac #7702)
return $ seq w (y, s'', w)
instance Applicative CoreM where
pure = return
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment