eta
eta copied to clipboard
List comprehension hanging
module Main where
main = do
print $ boomBangs [13,9]
boomBangs xs = [ if x < 10 then "BOOM!" else "BANG!" | x <- xs, odd x]
Works
module Main where
main = do
print $ boomBangs [7,9]
boomBangs xs = [ if x < 10 then "BOOM!" else "BANG!" | x <- xs, odd x]
Hangs
module Main where
main = do
print $ boomBangs [7,13]
boomBangs xs = [ if x < 10 then "BOOM!" else "BANG!" | x <- xs, odd x]
Works
module Main where
main = do
print $ boomBangs [13,15]
boomBangs xs = [ if x < 10 then "BOOM!" else "BANG!" | x <- xs, odd x]
Hangs
module Main where
main = do
print $ [adjective ++ " " ++ noun | adjective <- adjectives, noun <- nouns]
nouns = ["hobo","frog","pope"]
adjectives = ["lazy","grouchy","scheming"]
Hangs
After some initial investigation, it looks to be a bug in the thunk updating/blackholing code:
[main] INFO ghcvm.runtime.thunk.Thunk - >> blackHole(1=ghcvm.runtime.stg.StgContext@46147bef, 2=ghcvm.runtime.thunk.StgCAFBlackHole@df2e04c, 3=ghczmprim.ghc.Types$ZCD@59a6acb9)
[main] INFO ghcvm.runtime.stg.StgConstr - >> getEvaluated()
[main] INFO ghcvm.runtime.stg.StgConstr - << getEvaluated() returns: ghczmprim.ghc.Types$ZCD@59a6acb9.
[main] INFO ghcvm.runtime.stg.StgContext - >> R(1=1, 2=ghczmprim.ghc.Types$ZCD@59a6acb9)
[main] INFO ghcvm.runtime.stg.AbstractArgumentStack - >> R(1=1, 2=ghczmprim.ghc.Types$ZCD@59a6acb9)
[main] INFO ghcvm.runtime.stg.AbstractArgumentStack - << R(1=1, 2=ghczmprim.ghc.Types$ZCD@59a6acb9)
[main] INFO ghcvm.runtime.stg.StgContext - << R(1=1, 2=ghczmprim.ghc.Types$ZCD@59a6acb9)
[main] INFO ghcvm.runtime.stg.StgConstr - >> getEvaluated()
[main] INFO ghcvm.runtime.stg.StgConstr - << getEvaluated() returns: ghczmprim.ghc.Types$ZCD@59a6acb9.
[main] INFO ghcvm.runtime.stg.StgContext - >> R(1=1, 2=ghczmprim.ghc.Types$ZCD@59a6acb9)
[main] INFO ghcvm.runtime.stg.AbstractArgumentStack - >> R(1=1, 2=ghczmprim.ghc.Types$ZCD@59a6acb9)
[main] INFO ghcvm.runtime.stg.AbstractArgumentStack - << R(1=1, 2=ghczmprim.ghc.Types$ZCD@59a6acb9)
[main] INFO ghcvm.runtime.stg.StgContext - << R(1=1, 2=ghczmprim.ghc.Types$ZCD@59a6acb9)
[main] INFO ghcvm.runtime.stg.StgConstr - >> getEvaluated()
[main] INFO ghcvm.runtime.stg.StgConstr - << getEvaluated() returns: ghczmprim.ghc.Types$ZCD@59a6acb9.
[main] INFO ghcvm.runtime.stg.StgContext - >> R(1=1, 2=ghczmprim.ghc.Types$ZCD@59a6acb9)
[main] INFO ghcvm.runtime.stg.AbstractArgumentStack - >> R(1=1, 2=ghczmprim.ghc.Types$ZCD@59a6acb9)
[main] INFO ghcvm.runtime.stg.AbstractArgumentStack - << R(1=1, 2=ghczmprim.ghc.Types$ZCD@59a6acb9)
[main] INFO ghcvm.runtime.stg.StgContext - << R(1=1, 2=ghczmprim.ghc.Types$ZCD@59a6acb9)
That last bit repeats forever.
Fixed as of #70