
Just an aside. I looked up the GHC user guide and found this:
-Wcompat-unqualified-imports
Warns on qualified imports of core library modules which are subject to
change in future GHC releases.
I got confused by the text. I guess it was meant to be "Warns on
unqualified imports".
-harendra
On Sun, 20 Jun 2021 at 20:39, Oleg Grenrus
What is the reason that -Wcompat flags are not enabled by -Wall? The unqualified Data.List import was warned by -Wcompat about since GHC-8.10, I'm surprised that it still surprise people.
Should -Wcompat be implied by -Wall? Why not? I think that people who won't ever consider upgrading GHC to be a very very small minority, and they can suppress these warnings with `-Wall -Wno-compat`.
- Oleg
On 20.6.2021 17.57, Edward Kmett wrote:
The breakage concern is why Data.List wound up in its limbo-like state of re-exporting the Foldable-polymorphic combinators since 7.10 -- while "weird", it was the only option that didn't have to choose between removing the names from Data.List exports entirely and breaking unqualified imports of Data.List.
With the monomorphized combinators in place, Data.List should be considered a 'qualified' import like Data.Map. We definitely need to do more to communicate that this is changing and how users should adjust their code to suit. After all, by far the most common intended import from Data.List is the humble 'sort', which doesn't conflict.
-Edward
On Sun, Jun 20, 2021 at 4:45 AM Chris Smith
wrote: Yikes, this is going to break nearly everything. Definitely good to let people know.
On Sun, Jun 20, 2021 at 7:43 AM Ben Gamari
wrote: Harendra Kumar
writes: I see the following errors when compiling with ghc head version:
$ ghc-stage2 --version The Glorious Glasgow Haskell Compilation System, version 9.3.20210608
$ cabal build --with-compiler ghc-stage2 --allow-newer
Data/Colour/CIE.hs:80:12: error: Ambiguous occurrence ‘sum’ It could refer to either ‘Prelude.sum’, imported from ‘Prelude’ at Data/Colour/CIE.hs:25:8-22 (and originally defined in ‘Data.Foldable’) or ‘Data.List.sum’, imported from ‘Data.List’ at Data/Colour/CIE.hs:41:1-16 (and originally defined in ‘GHC.List’) | 80 | total = sum $ map fst l | ^^^
Can someone briefly describe this change and what's the recommended way of fixing this? Just hide the Data.List definition? I do not see this mentioned in the release notes of 9.2/9.4 here: https://ghc.gitlab.haskell.org/ghc/doc/users_guide/9.2.1-notes.html
Indeed, this is due to the monomorphic Data.List proposal, which the CLC decided would accompany the addition of Data.List.singleton. The correct fix here is to either qualify the import of `Data.List` or add an explicit import list. I'll try to remember to add a note about this to the release notes and migration guide.
Cheers,
- Ben
_______________________________________________ ghc-devs mailing list ghc-devs@haskell.org http://mail.haskell.org/cgi-bin/mailman/listinfo/ghc-devs
_______________________________________________ ghc-devs mailing list ghc-devs@haskell.org http://mail.haskell.org/cgi-bin/mailman/listinfo/ghc-devs
_______________________________________________ ghc-devs mailing listghc-devs@haskell.orghttp://mail.haskell.org/cgi-bin/mailman/listinfo/ghc-devs
_______________________________________________ ghc-devs mailing list ghc-devs@haskell.org http://mail.haskell.org/cgi-bin/mailman/listinfo/ghc-devs