Description

Consider the following code:

data U a = U
g :: [U a]
g = [U]
f :: [Int]
f = map (\U -> 2) g

Compiled with -O1, g does not get inlined, and f stays unchanged. Inline pragmas don't seem to help. However, if we change the type signature of g to instantiate the phantom type parameter, such as with g :: [U ()], then f is nicely optimised to become [2]. I believe this is a bug, and we'd like f to be simplified even when g has its most general type signature.