Alllow static pointers to local closed definitions
A limitation of the original patch implementing
-XStaticPointers is that while the following all work,
t1 = static not t2 = static (\x -> case x of True -> False; False -> True)
the below does not:
t3 = static foo where foo True = False
foo is perfectly "static": it's a closed expression that can readily be floated to top-level.
So in short:
-XStaticPointers should not consider only expressions with top-level identifiers, but in general any closed expression (which may involve local closed identifiers too).