Skip to content

Disabling -fprint-explicit-runtime-reps defaults too much

When -fprint-explicit-runtime-reps is disabled, we instantiate all RuntimeRep variables to LiftedRep in the entire type. Instead, I think we should do this only for the toplevel foralls - not for the foralls in the contravariant position. Example:

λ> foo :: (forall (r :: RuntimeRep). p r) -> Int; foo _ = 0
λ> :t foo
foo :: p 'LiftedRep -> Int

This is not a correct type for foo. My expectation is that disabling -fprint-explicit-runtime-reps can give a less specific type for an expression, but not an incorrect one.

Related: #16320.

Edited by Krzysztof Gogolewski
To upload designs, you'll need to enable LFS and have an admin enable hashed storage. More information