-
Simon Peyton Jones authored
Consider lvl = Just True foo :: Maybe Bool -> Int -> Int foo (Just True) i = i foo _ i = foo lvl i SpecConstr should specialise foo, but it wasn't doing so (spotted by Roman). Reason: lvl's unfolding wasn't in the cloned version of lvl. Solution: extend the value environment to record top-level bindings too At the same time I made it work if 'lvl' is a lambda, in which case it is again worth specialisg. This meant renaming ConEnv to ValueEnv, and adding a case for 'LambdaVal'. (To make specialisation on lambdas work properly, we have to do lambda lifting as well, but this gets part of the way, and fixes a bug too.)
57a4597d