GHC 7.10 regression when using foldr

Edward Z. Yang ezyang at mit.edu
Tue Jan 20 23:27:39 UTC 2015


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