Skip to content

Remove the GHCi debugger's panicking isUnliftedType check

Ryan Scott requested to merge RyanGlScott/ghc:wip/T14828 into master

The GHCi debugger has never been that robust in the face of higher-rank types, or even types that are interally higher-rank, such as the types of many class methods (e.g., fmap). In GHC 8.2, however, things became even worse, as the debugger would start to panic when a user tries passing the name of a higher-rank thing to :print. This all ties back to a strange isUnliftedType check in Debugger that was mysteriously added 11 years ago (in commit 4d71f5ee) with no explanation whatsoever.

After some experimentation, no one is quite sure what this isUnliftedType check is actually accomplishing. The test suite still passes if it's removed, and I am unable to observe any differences in debugger before even with data types that do have fields of unlifted types (e.g., data T = MkT Int#). Given that this is actively causing problems (see #14828 (closed)), the prudent thing to do seems to be just removing this isUnliftedType check, and waiting to see if anyone shouts about it. This patch accomplishes just that.

Note that this patch fix the underlying issues behind #14828 (closed), as the debugger will still print unhelpful info if you try this:

λ> f :: (forall a. a -> a) -> b -> b; f g x = g x
λ> :print f
f = (_t1::t1)

But fixing this will require much more work, so let's start with the simple stuff for now.

Edited by Ryan Scott

Merge request reports