Breaking changes to the base library

Ben Gamari ben at smart-cactus.org
Sun Jun 20 11:43:07 UTC 2021


Harendra Kumar <harendra.kumar at gmail.com> 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

-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 487 bytes
Desc: not available
URL: <http://mail.haskell.org/pipermail/ghc-devs/attachments/20210620/24803ab2/attachment.sig>


More information about the ghc-devs mailing list