<div dir="ltr">It isn't without a cost. On the down-side, the results of -ddump-minimal-imports would be er.. less minimal.<div><br></div><div><br></div></div><div class="gmail_extra"><br><div class="gmail_quote">On Tue, Jan 20, 2015 at 6:47 PM, Edward Z. Yang <span dir="ltr"><<a href="mailto:ezyang@mit.edu" target="_blank">ezyang@mit.edu</a>></span> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">I like this proposal: if you're explicit about an import that<br>
would otherwise be implicit by Prelude, you shouldn't get a<br>
warning for it. If it is not already the case, we also need to<br>
make sure the implicit Prelude import never causes "unused import"<br>
errors.<br>
<br>
Edward<br>
<br>
Excerpts from Edward Kmett's message of 2015-01-20 15:41:13 -0800:<br>
<div class="HOEnZb"><div class="h5">> Sure.<br>
><br>
> Adding it to the CHANGELOG makes a lot of sense. I first found out about it<br>
> only a few weeks ago when Herbert mentioned it in passing.<br>
><br>
> Of course, the geek in me definitely prefers technical fixes to human ones.<br>
> Humans are messy. =)<br>
><br>
> I'd be curious how much of the current suite of warnings could be fixed<br>
> just by switching the implicit Prelude import to the end of the import list<br>
> inside GHC.<br>
><br>
> Now that Herbert has all of his crazy tooling to build stuff with 7.10 and<br>
> with HEAD, it might be worth trying out such a change to see how much it<br>
> reduces the warning volume and if it somehow manages to introduce any new<br>
> warnings.<br>
><br>
> I hesitate to make such a proposal this late in the release candidate game,<br>
> but if it worked it'd be pretty damn compelling.<br>
><br>
> -Edward<br>
><br>
> On Tue, Jan 20, 2015 at 6:27 PM, Edward Z. Yang <<a href="mailto:ezyang@mit.edu">ezyang@mit.edu</a>> wrote:<br>
><br>
> > Hello Edward,<br>
> ><br>
> > Shouldn't we publicize this trick? Perhaps in the changelog?<br>
> ><br>
> > Edward<br>
> ><br>
> > Excerpts from Edward Kmett's message of 2015-01-20 15:22:57 -0800:<br>
> > > Building -Wall clean across this change-over has a big of a trick to it.<br>
> > ><br>
> > > The easiest way I know of when folks already had lots of<br>
> > ><br>
> > > import Data.Foldable<br>
> > > import Data.Traversable<br>
> > ><br>
> > > stuff<br>
> > ><br>
> > > is to just add<br>
> > ><br>
> > > import Prelude<br>
> > ><br>
> > > explicitly to the bottom of your import list rather than painstakingly<br>
> > > exclude the imports with CPP.<br>
> > ><br>
> > > This has the benefit of not needing a bunch of CPP to manage what names<br>
> > > come from where.<br>
> > ><br>
> > > Why? GHC checks that the imports provide something 'new' that is used by<br>
> > > the module in a top-down fashion, and you are almost suredly using<br>
> > > something from Prelude that didn't come from one of the modules above.<br>
> > ><br>
> > > On the other hand the implicit import of Prelude effectively would come<br>
> > > first in the list.<br>
> > ><br>
> > > It is a dirty trick, but it does neatly side-step this problem for folks<br>
> > in<br>
> > > your situation.<br>
> > ><br>
> > > -Edward<br>
> > ><br>
> > > On Tue, Jan 20, 2015 at 6:12 PM, Bryan O'Sullivan <<a href="mailto:bos@serpentine.com">bos@serpentine.com</a>><br>
> > > wrote:<br>
> > ><br>
> > > ><br>
> > > > On Tue, Jan 20, 2015 at 3:02 PM, Herbert Valerio Riedel <<a href="mailto:hvr@gnu.org">hvr@gnu.org</a>><br>
> > > > wrote:<br>
> > > ><br>
> > > >> I'm a bit confused, several past attoparsec versions seem to build<br>
> > just<br>
> > > >> fine with GHC 7.10:<br>
> > > >><br>
> > > >>   <a href="https://ghc.haskell.org/~hvr/buildreports/attoparsec.html" target="_blank">https://ghc.haskell.org/~hvr/buildreports/attoparsec.html</a><br>
> > > >><br>
> > > >> were there hidden breakages not resulting in compile errors?<br>
> > > >> Or are the fixes you mention about restoring -Wall hygiene?<br>
> > > >><br>
> > > ><br>
> > > > I build with -Wall -Werror, and also have to maintain the test and<br>
> > > > benchmark suites.<br>
> > > ><br>
> ><br>
</div></div></blockquote></div><br></div>