-
Simon Peyton Jones authored
--------------------------------------------------- Template-Haskell fix to make the global environment more side-effect-ful --------------------------------------------------- Consider f = $(...foldl...) $(...foldl...) The first splice sucks in the type sig for foldl, which the second splice needs. That means that the second splice is going to have to consult the persistent compiler state to see the effect of imports by the first one. We used to cache the global type environment in the TcGblEnv, but this commit switches to the obvious thing: consult the persistent state on every global lookup. After all, reading a MutVar is no big deal; and it's a benign, ever-growing cache of type signatures, so the side effect is fine. On the way I tidied up the knot-tying in TcIfaceSig a bit more. Previously, I think the setUnfoldingInfo was being strict in the unfolding, which forced it to be type-checked. Now it's lazy. That could mean a lot less typechecking overall, for things whose unfolding isn't looked at. I hope I havn't broken it, though.
e6d00492