Debugging inside the typechecker knot
rae at cs.brynmawr.edu
Fri Aug 4 14:33:53 UTC 2017
My secret is that I've been annoyed by this problem, too!
Perhaps a better answer is that you probably don't need the information you don't have. All the type-checking decisions are around the kinds of the types floating through the system, so look there. You might want to know what type that kind is classifying... perhaps print out the HsType before it's lost.
Or, you could tackle #13737 and get rid of the knot altogether! :)
> On Aug 3, 2017, at 6:21 PM, Ryan Scott <ryan.gl.scott at gmail.com> wrote:
> Recently, I've found myself wanting to make changes to code that works inside code where TyCons are knot-tied . 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.
>  See Note [Type-checking inside the knot] at http://git.haskell.org/ghc.git/blob/884bd21a917f607b5a44e038e06f78d0b765ea63:/compiler/typecheck/TcHsType.hs#l1087 <http://git.haskell.org/ghc.git/blob/884bd21a917f607b5a44e038e06f78d0b765ea63:/compiler/typecheck/TcHsType.hs#l1087>_______________________________________________
> ghc-devs mailing list
> ghc-devs at haskell.org
-------------- next part --------------
An HTML attachment was scrubbed...
More information about the ghc-devs