<div dir="ltr"><div class="gmail_default" style="font-family:tahoma,sans-serif">What about calling this function?</div><div class="gmail_default" style="font-family:tahoma,sans-serif"><br></div><blockquote style="margin:0 0 0 40px;border:none;padding:0px"><div class="gmail_default" style="font-family:tahoma,sans-serif"><span style="font-family:Arial,Helvetica,sans-serif">GHC.Tc.Plugin.newUnique :: TcPluginM Unique</span></div><div class="gmail_default" style="font-family:tahoma,sans-serif"><span style="font-family:Arial,Helvetica,sans-serif"><br></span></div></blockquote><div class="gmail_default" style="font-family:tahoma,sans-serif">The module GHC.Tc.Plugin provides facilities to plugins.</div><div class="gmail_default" style="font-family:tahoma,sans-serif"><br></div><div class="gmail_default" style="font-family:tahoma,sans-serif">More generally, here is the <a href="https://ghc.gitlab.haskell.org/ghc/doc/users_guide/extending_ghc.html#compiler-plugins">manual page for plugins</a>.  Is it adequate?</div><div class="gmail_default" style="font-family:tahoma,sans-serif"><br></div><div class="gmail_default" style="font-family:tahoma,sans-serif">I notice that</div><div class="gmail_default" style="font-family:tahoma,sans-serif"><ul><li>it mentions the module GHC.Plugins (but only in code fragments)</li><li>it does not mention GHC.Tc.Plugins; neither does GHC.Plugins re-export GHC.Tc.Plugins</li></ul><div>It would be great if some plugin authors felt able to offer patches to improve.  Maybe open a GHC ticket?</div></div><br><div class="gmail_default" style="font-family:tahoma,sans-serif">Simon</div><br><br></div><br><div class="gmail_quote gmail_quote_container"><div dir="ltr" class="gmail_attr">On Sat, 2 Aug 2025 at 14:16, Wolfgang Jeltsch <<a href="mailto:wolfgang@well-typed.com">wolfgang@well-typed.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">[Since it seems that `<a href="mailto:glasgow-haskell-users@haskell.org" target="_blank">glasgow-haskell-users@haskell.org</a>` is essentially<br>
an announcements-only mailing list these days, I’m re-sending my recent<br>
e-mail to that mailing list here.]<br>
<br>
Hello!<br>
<br>
I want to generate AST fragments in a source plugin, and for this I need<br>
to generate fresh (local) names. My current approach is to use<br>
`mkSystemName`, but it, like many of the other name-generating<br>
operations, needs a value of type `Unique`. How can I generate such<br>
values? It seems that the `Hsc` monad doesn’t carry a value of type<br>
`UniqueSupply` with it.<br>
<br>
All the best,<br>
Wolfgang<br>
_______________________________________________<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>