<div dir="ltr"><div class="gmail_default" style="font-family:tahoma,sans-serif">I'm supportive of this proposal in general -- that is, make it easy to find what the "root" unused bindings are, without cluttering up the warnings with all the transitively unused ones.</div><div class="gmail_default" style="font-family:tahoma,sans-serif"><br></div><div class="gmail_default" style="font-family:tahoma,sans-serif">But I have a question (added on the discussion thread) about the ergonomics.<br></div></div><br><div class="gmail_quote"><div dir="ltr" class="gmail_attr">On Fri, 8 Sept 2023 at 03:16, Chris Dornan <<a href="mailto:chris@chrisdornan.com">chris@chrisdornan.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 dir="ltr"><div style="color:rgb(214,222,235);background-color:rgb(1,22,39);font-family:Hasklig,"Fira Code",Menlo,Monaco,"Courier New",monospace;font-size:12px;line-height:18px;white-space:pre-wrap"><div>Proposal: Fine-Grained Unused Warnings (#42)</div><div>Author: Jakob Brünker</div><div>Rendered proposal: <a href="https://github.com/JakobBruenker/ghc-proposals/blob/fine-grained-unused/proposals/0000-fine-grained-unused-warnings.rst" target="_blank">https://github.com/JakobBruenker/ghc-proposals/blob/fine-grained-unused/proposals/0000-fine-grained-unused-warnings.rst</a></div><div>Discussion: <a href="https://github.com/ghc-proposals/ghc-proposals/pull/434" target="_blank">https://github.com/ghc-proposals/ghc-proposals/pull/434</a></div><div>Recommendation: Acceptance</div><br><div><span style="color:rgb(130,177,255)">## Summary</span></div><br><div>GHC currently warns equally about any superfluous binding that it discovers, regardless of whether</div><div>the definition is unreferenced anywhere itself, or is merely mentioned by other definitions that are</div><div>similarly superfluous. The proposal proposes to replace these warnings with just the warnings about</div><div>definitions that are not referenced anywhere, but list within those warnings the entities it</div><div>references that would otherwise not be required. The same information is being conveyed under this</div><div>proposal as previously, but in a more structured manner.</div><br><div>The proposal is careful to ensure the -Wunused-* controls (-Wunused-top-binds, etc.) are respected,</div><div>so the subwarnings of transitively unused entities are only listed if their corresponding -Wunused-*</div><div>control is active.</div><br><div>As Jakob points out in the proposal, getting these warnings into some structure is partly motivated</div><div>by IDE usage where the 'additional [transitive] warnings take up a lot of valuable screen real</div><div>estate'.</div><br><div><span style="color:rgb(130,177,255)">## Example [From the proposal]</span></div><br><div> In the following code,</div><br><div> module Foo ()</div><br><div> import Data.List as L</div><br><div> foo = L.intercalate</div><br><div> `intercalate` is transitively unused, since it is only used by `foo`, which is unused. The warning</div><div> that's produced will be</div><br><div> Foo.hs:5:1: warning: [-Wunused-top-binds]</div><div> Defined but not used: ‘foo’</div><div> as a consequence the following imports are transitively unused [-Wunused-imports]:</div><div> Data.List imported at foo.hs:3:1:</div><br><div> The warning about transitively unused bindings only appears if both the warning flag for the unused binding (in this case -Wunused-top-binds) and the the one for the transitively unused binding itself (in this case -Wunused-imports) are enabled.</div><br><br><div><span style="color:rgb(130,177,255)">## Recommendation</span></div><br><div>This proposal is not at all disruptive (arguably to the extent of not requiring a GHC proposal</div><div>review), is well thought out, and can improve the GHC/IDE UI so I recommend that we accept it.</div><br></div></div>
_______________________________________________<br>
ghc-steering-committee mailing list<br>
<a href="mailto:ghc-steering-committee@haskell.org" target="_blank">ghc-steering-committee@haskell.org</a><br>
<a href="https://mail.haskell.org/cgi-bin/mailman/listinfo/ghc-steering-committee" rel="noreferrer" target="_blank">https://mail.haskell.org/cgi-bin/mailman/listinfo/ghc-steering-committee</a><br>
</blockquote></div>