Debugging inside the typechecker knot

Ryan Scott at
Thu Aug 3 22:21:36 UTC 2017

Recently, I've found myself wanting to make changes to code that works
inside code where TyCons are knot-tied [1]. But I've found myself unable to
make much progress, since my ability to debug this code is severely limited
by the fact that I can't seem to trace anything. That is, if I try tracing
anything that comes from a knot-tied TyCon, GHC will go into an infinite
loop! This prevents me from learning *anything* about the types floating
around in the code I want to fix, which is hugely annoying.

How do others work around this problem? There must be *some* way to glean
information about the types inside a typechecker knot, since others seem to
be able to work within this space. How do you do it? And will you consider
sharing your secrets?

Ryan S.
[1] See Note [Type-checking inside the knot] at
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <>

More information about the ghc-devs mailing list