[Haskell-cafe] Dealing with GHC 7.10 prelude imports

Brendan Hay brendan.g.hay at gmail.com
Sun Apr 12 19:45:22 UTC 2015


Thanks for the tips!

On 12 April 2015 at 12:37, Benno Fünfstück <benno.fuenfstueck at gmail.com>
wrote:

> > I've run into a couple of cases when attempting to support multiple GHC
> versions in my libraries (7.6.3 -> 7.10) where I've repeatedly made
> mistakes due to being warned about unused imports for various modules that
> are now part of the Prelude such as Data.Monoid, Data.Foldable, etc. which
> I subsequently remove either manually or via editor automation sufficiently
> indistinguishable from magic.
>
> A trick is to import Prelude at the very end, like:
>
> import Control.Applicative
> import Data.Monoid
> ...
> import Prelude
>
> Since the unused import check is done from top to bottom, and you almost
> always use *something* from the Prelude, this will suppress the warning.
>
> There are some problems with qualified/explicit import lists if I recall
> correctly though. But it works for me most of the time.
>
> Regards,
> Benno
>
> _______________________________________________
> Haskell-Cafe mailing list
> Haskell-Cafe at haskell.org
> http://mail.haskell.org/cgi-bin/mailman/listinfo/haskell-cafe
>
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mail.haskell.org/pipermail/haskell-cafe/attachments/20150412/366c6fef/attachment.html>


More information about the Haskell-Cafe mailing list