<div dir="ltr">Dear Simon, other ghc devs,<div><br></div><div style>I hooked into genericHscRecompile to traverse the typechecked source and construct an environment of type</div><div style><br></div><div style>     [(SrcSpan, Id)]</div>
<div style><br></div><div style>recording all identifiers in the source with their type, definition site, etc. To be precise, I am traversing the </div><div style><br></div><div style><div>    tcg_binds     :: LHsBinds Id,<span class="" style="white-space:pre">        </span>    -- Value bindings in this module</div>
<div><br></div><div style>field of the TcGblEnv structure returned by the type checker. The problem is that I have so far been unable to find top-level user-supplied type annotations inside LHsBinds. The closest thing I&#39;ve found is the PostTcType of a MatchGroup, but that is not Located; what I&#39;m really looking for is an LSig. </div>
<div style><br></div><div style>Now, let-bindings get a HsValBindsLR instead of an LHsBinds, and that *does* contain signatures. My question is two-fold:</div><div style><br></div><div style>1. First, am I missing something? Are there LSigs somewhere inside the TcGblEnv where I simply haven&#39;t seen them?</div>
<div style><br></div><div style>2. If not, is there a good reason why tcg_binds is an LHsBinds rather than an HsValBindsLR? And if there isn&#39;t, would you accept a patch making the change?</div><div style><br></div><div style>
Thanks,</div><div style><br></div><div style>Edsko</div></div></div>