GHC 7.10 regression when using foldr
Edward Kmett
ekmett at gmail.com
Wed Jan 21 00:49:52 UTC 2015
I was assuming that the list was generated by doing more or less the same
check we do now. I haven't looked at the code for it.
If so, then it seems it wouldn't flag a now-unnecessary Data.Traversable
dependency for instance. At least not without rather significant retooling.
I might be off in my understanding of how it works, though.
-Edward
On Tue, Jan 20, 2015 at 7:40 PM, Edward Z. Yang <ezyang at mit.edu> wrote:
> I don't see why that would be the case: we haven't *excluded* any
> old import lists, so -ddump-minimal-imports could still
> take advantage of Prelude in a warning-free way.
>
> Edward
>
> Excerpts from Edward Kmett's message of 2015-01-20 16:36:53 -0800:
> > It isn't without a cost. On the down-side, the results of
> > -ddump-minimal-imports would be er.. less minimal.
> >
> > On Tue, Jan 20, 2015 at 6:47 PM, Edward Z. Yang <ezyang at mit.edu> wrote:
> >
> > > I like this proposal: if you're explicit about an import that
> > > would otherwise be implicit by Prelude, you shouldn't get a
> > > warning for it. If it is not already the case, we also need to
> > > make sure the implicit Prelude import never causes "unused import"
> > > errors.
> > >
> > > Edward
> > >
> > > Excerpts from Edward Kmett's message of 2015-01-20 15:41:13 -0800:
> > > > Sure.
> > > >
> > > > Adding it to the CHANGELOG makes a lot of sense. I first found out
> about
> > > it
> > > > only a few weeks ago when Herbert mentioned it in passing.
> > > >
> > > > Of course, the geek in me definitely prefers technical fixes to human
> > > ones.
> > > > Humans are messy. =)
> > > >
> > > > I'd be curious how much of the current suite of warnings could be
> fixed
> > > > just by switching the implicit Prelude import to the end of the
> import
> > > list
> > > > inside GHC.
> > > >
> > > > Now that Herbert has all of his crazy tooling to build stuff with
> 7.10
> > > and
> > > > with HEAD, it might be worth trying out such a change to see how
> much it
> > > > reduces the warning volume and if it somehow manages to introduce
> any new
> > > > warnings.
> > > >
> > > > I hesitate to make such a proposal this late in the release candidate
> > > game,
> > > > but if it worked it'd be pretty damn compelling.
> > > >
> > > > -Edward
> > > >
> > > > On Tue, Jan 20, 2015 at 6:27 PM, Edward Z. Yang <ezyang at mit.edu>
> wrote:
> > > >
> > > > > Hello Edward,
> > > > >
> > > > > Shouldn't we publicize this trick? Perhaps in the changelog?
> > > > >
> > > > > Edward
> > > > >
> > > > > Excerpts from Edward Kmett's message of 2015-01-20 15:22:57 -0800:
> > > > > > Building -Wall clean across this change-over has a big of a
> trick to
> > > it.
> > > > > >
> > > > > > The easiest way I know of when folks already had lots of
> > > > > >
> > > > > > import Data.Foldable
> > > > > > import Data.Traversable
> > > > > >
> > > > > > stuff
> > > > > >
> > > > > > is to just add
> > > > > >
> > > > > > import Prelude
> > > > > >
> > > > > > explicitly to the bottom of your import list rather than
> > > painstakingly
> > > > > > exclude the imports with CPP.
> > > > > >
> > > > > > This has the benefit of not needing a bunch of CPP to manage what
> > > names
> > > > > > come from where.
> > > > > >
> > > > > > Why? GHC checks that the imports provide something 'new' that is
> > > used by
> > > > > > the module in a top-down fashion, and you are almost suredly
> using
> > > > > > something from Prelude that didn't come from one of the modules
> > > above.
> > > > > >
> > > > > > On the other hand the implicit import of Prelude effectively
> would
> > > come
> > > > > > first in the list.
> > > > > >
> > > > > > It is a dirty trick, but it does neatly side-step this problem
> for
> > > folks
> > > > > in
> > > > > > your situation.
> > > > > >
> > > > > > -Edward
> > > > > >
> > > > > > On Tue, Jan 20, 2015 at 6:12 PM, Bryan O'Sullivan <
> > > bos at serpentine.com>
> > > > > > wrote:
> > > > > >
> > > > > > >
> > > > > > > On Tue, Jan 20, 2015 at 3:02 PM, Herbert Valerio Riedel <
> > > hvr at gnu.org>
> > > > > > > wrote:
> > > > > > >
> > > > > > >> I'm a bit confused, several past attoparsec versions seem to
> build
> > > > > just
> > > > > > >> fine with GHC 7.10:
> > > > > > >>
> > > > > > >> https://ghc.haskell.org/~hvr/buildreports/attoparsec.html
> > > > > > >>
> > > > > > >> were there hidden breakages not resulting in compile errors?
> > > > > > >> Or are the fixes you mention about restoring -Wall hygiene?
> > > > > > >>
> > > > > > >
> > > > > > > I build with -Wall -Werror, and also have to maintain the test
> and
> > > > > > > benchmark suites.
> > > > > > >
> > > > >
> > >
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://www.haskell.org/pipermail/glasgow-haskell-users/attachments/20150120/e96788c1/attachment.html>
More information about the Glasgow-haskell-users
mailing list