GHC 7.10 regression when using foldr
Edward Z. Yang
ezyang at mit.edu
Tue Jan 20 23:47:06 UTC 2015
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.
> > > >
> >
More information about the Glasgow-haskell-users
mailing list