<div dir="auto">I’m supportive of this proposal. I think Adam raised a good concern on the discussion with respect to tooling. As this does not impact GHCs acceptance of existing code, I’m more lenient towards these changes.</div><div dir="auto"><br></div><div dir="auto">Moritz</div><div><br><div class="gmail_quote"><div dir="ltr" class="gmail_attr">On Sat, 9 Sep 2023 at 5:43 AM, Simon Peyton Jones <<a href="mailto:simon.peytonjones@gmail.com">simon.peytonjones@gmail.com</a>> wrote:<br></div><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left-width:1px;border-left-style:solid;padding-left:1ex;border-left-color:rgb(204,204,204)"><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" target="_blank">chris@chrisdornan.com</a>> wrote:<br></div><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left-width:1px;border-left-style:solid;padding-left:1ex;border-left-color:rgb(204,204,204)"><div dir="ltr"><div style="font-family:Hasklig,"Fira Code",Menlo,Monaco,"Courier New",monospace;font-size:12px;line-height:18px;white-space:pre-wrap;background-color:rgb(1,22,39);color:rgb(214,222,235)"><div style="font-family:Hasklig,"Fira Code",Menlo,Monaco,"Courier New",monospace">Proposal: Fine-Grained Unused Warnings (#42)</div><div style="font-family:Hasklig,"Fira Code",Menlo,Monaco,"Courier New",monospace">Author: Jakob Brünker</div><div style="font-family:Hasklig,"Fira Code",Menlo,Monaco,"Courier New",monospace">Rendered proposal: <a href="https://github.com/JakobBruenker/ghc-proposals/blob/fine-grained-unused/proposals/0000-fine-grained-unused-warnings.rst" target="_blank" style="font-family:Hasklig,"Fira Code",Menlo,Monaco,"Courier New",monospace">https://github.com/JakobBruenker/ghc-proposals/blob/fine-grained-unused/proposals/0000-fine-grained-unused-warnings.rst</a></div><div style="font-family:Hasklig,"Fira Code",Menlo,Monaco,"Courier New",monospace">Discussion: <a href="https://github.com/ghc-proposals/ghc-proposals/pull/434" target="_blank" style="font-family:Hasklig,"Fira Code",Menlo,Monaco,"Courier New",monospace">https://github.com/ghc-proposals/ghc-proposals/pull/434</a></div><div style="font-family:Hasklig,"Fira Code",Menlo,Monaco,"Courier New",monospace">Recommendation: Acceptance</div><br><div style="font-family:Hasklig,"Fira Code",Menlo,Monaco,"Courier New",monospace"><span style="font-family:Hasklig,"Fira Code",Menlo,Monaco,"Courier New",monospace;color:rgb(130,177,255)">## Summary</span></div><br><div style="font-family:Hasklig,"Fira Code",Menlo,Monaco,"Courier New",monospace">GHC currently warns equally about any superfluous binding that it discovers, regardless of whether</div><div style="font-family:Hasklig,"Fira Code",Menlo,Monaco,"Courier New",monospace">the definition is unreferenced anywhere itself, or is merely mentioned by other definitions that are</div><div style="font-family:Hasklig,"Fira Code",Menlo,Monaco,"Courier New",monospace">similarly superfluous. The proposal proposes to replace these warnings with just the warnings about</div><div style="font-family:Hasklig,"Fira Code",Menlo,Monaco,"Courier New",monospace">definitions that are not referenced anywhere, but list within those warnings the entities it</div><div style="font-family:Hasklig,"Fira Code",Menlo,Monaco,"Courier New",monospace">references that would otherwise not be required. The same information is being conveyed under this</div><div style="font-family:Hasklig,"Fira Code",Menlo,Monaco,"Courier New",monospace">proposal as previously, but in a more structured manner.</div><br><div style="font-family:Hasklig,"Fira Code",Menlo,Monaco,"Courier New",monospace">The proposal is careful to ensure the -Wunused-* controls (-Wunused-top-binds, etc.) are respected,</div><div style="font-family:Hasklig,"Fira Code",Menlo,Monaco,"Courier New",monospace">so the subwarnings of transitively unused entities are only listed if their corresponding -Wunused-*</div><div style="font-family:Hasklig,"Fira Code",Menlo,Monaco,"Courier New",monospace">control is active.</div><br><div style="font-family:Hasklig,"Fira Code",Menlo,Monaco,"Courier New",monospace">As Jakob points out in the proposal, getting these warnings into some structure is partly motivated</div><div style="font-family:Hasklig,"Fira Code",Menlo,Monaco,"Courier New",monospace">by IDE usage where the 'additional [transitive] warnings take up a lot of valuable screen real</div><div style="font-family:Hasklig,"Fira Code",Menlo,Monaco,"Courier New",monospace">estate'.</div><br><div style="font-family:Hasklig,"Fira Code",Menlo,Monaco,"Courier New",monospace"><span style="font-family:Hasklig,"Fira Code",Menlo,Monaco,"Courier New",monospace;color:rgb(130,177,255)">## Example [From the proposal]</span></div><br><div style="font-family:Hasklig,"Fira Code",Menlo,Monaco,"Courier New",monospace"> In the following code,</div><br><div style="font-family:Hasklig,"Fira Code",Menlo,Monaco,"Courier New",monospace"> module Foo ()</div><br><div style="font-family:Hasklig,"Fira Code",Menlo,Monaco,"Courier New",monospace"> import Data.List as L</div><br><div style="font-family:Hasklig,"Fira Code",Menlo,Monaco,"Courier New",monospace"> foo = L.intercalate</div><br><div style="font-family:Hasklig,"Fira Code",Menlo,Monaco,"Courier New",monospace"> `intercalate` is transitively unused, since it is only used by `foo`, which is unused. The warning</div><div style="font-family:Hasklig,"Fira Code",Menlo,Monaco,"Courier New",monospace"> that's produced will be</div><br><div style="font-family:Hasklig,"Fira Code",Menlo,Monaco,"Courier New",monospace"> Foo.hs:5:1: warning: [-Wunused-top-binds]</div><div style="font-family:Hasklig,"Fira Code",Menlo,Monaco,"Courier New",monospace"> Defined but not used: ‘foo’</div><div style="font-family:Hasklig,"Fira Code",Menlo,Monaco,"Courier New",monospace"> as a consequence the following imports are transitively unused [-Wunused-imports]:</div><div style="font-family:Hasklig,"Fira Code",Menlo,Monaco,"Courier New",monospace"> Data.List imported at foo.hs:3:1:</div><br><div style="font-family:Hasklig,"Fira Code",Menlo,Monaco,"Courier New",monospace"> 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 style="font-family:Hasklig,"Fira Code",Menlo,Monaco,"Courier New",monospace"><span style="font-family:Hasklig,"Fira Code",Menlo,Monaco,"Courier New",monospace;color:rgb(130,177,255)">## Recommendation</span></div><br><div style="font-family:Hasklig,"Fira Code",Menlo,Monaco,"Courier New",monospace">This proposal is not at all disruptive (arguably to the extent of not requiring a GHC proposal</div><div style="font-family:Hasklig,"Fira Code",Menlo,Monaco,"Courier New",monospace">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>
_______________________________________________<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></div>