<div dir="ltr"><div class="gmail_default" style="font-family:tahoma,sans-serif">
<blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex"><div><span>My question is then “How can I get all variables in scope in 
the module underlying this CoreM computation, to pass in the 
LintConfig?”.</span></div></blockquote><div><br></div><div>What do you have in your hand?  A [CoreBinding]?  If so, just do `bindersOfBinds`.</div><div><br></div><div>You only need the LocalIds.  You don't need (imported) GlobalIds</div><div><br></div><div>Simon <br></div>

</div></div><br><div class="gmail_quote"><div dir="ltr" class="gmail_attr">On Sun, 6 Aug 2023 at 11:02, Rodrigo Mesquita <<a href="mailto:rodrigo.m.mesquita@gmail.com">rodrigo.m.mesquita@gmail.com</a>> wrote:<br></div><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex"><div>Dear GHC devs,<div><br></div><div>I’m trying to invoke the GHC.Core.Lint linting functions from a Core GHC plugin.</div><div>These functions take a <a id="m_5840639114991679159t:LintConfig" style="color:rgb(0,0,0)">LintConfig that can m</a><a style="color:rgb(0,0,0)">ostly be constructed from DynFlags,</a></div><div><a style="color:rgb(0,0,0)">the exception being</a></div><div><a style="color:rgb(0,0,0)"><br></a></div><div><span><b><span style="white-space:pre-wrap">      </span>l_vars :: ![Var]</b> — ^ Ids that should be treated as being in scope</span><div></div></div><div><span><br></span></div><div><span>My question is then “How can I get all variables in scope in the module underlying this CoreM computation, to pass in the LintConfig?”.</span></div><div><span><br></span></div><div><span>My ultimate goal is to run LintM to determine the usage environment of a given core expression.</span></div><div><span>In that sense, the “Id out of scope” errors aren’t that important to me, but they do make the linting action fail.</span></div><div><span><br></span></div><div><span>Thanks in advance!</span></div><div><span>Rodrigo</span></div></div>_______________________________________________<br>
ghc-devs mailing list<br>
<a href="mailto:ghc-devs@haskell.org" target="_blank">ghc-devs@haskell.org</a><br>
<a href="http://mail.haskell.org/cgi-bin/mailman/listinfo/ghc-devs" rel="noreferrer" target="_blank">http://mail.haskell.org/cgi-bin/mailman/listinfo/ghc-devs</a><br>
</blockquote></div>