Skip to content

Avoid name clash with Data.List.unsnoc in extra-1.7.13

Tobias Haslop requested to merge tobias/head.hackage:unsnoc into master

Currently head-hackage fails building the extra-1.7.13 package due to the addition of unsnoc to the Data.List module in ghc!10442 (diffs)

Click to see the error message.
Build profile: -w ghc-9.7.20230528 -O1
In order, the following will be built (use -v for more details):
 - extra-1.7.13 (lib) (requires build)
 - test-extra-1.0 (lib) (first run)
Starting     extra-1.7.13 (lib)
Building     extra-1.7.13 (lib)

Failed to build extra-1.7.13.
Build log (
/home/tobias/.cabal/logs/ghc-9.7.20230528/extra-1.7.13-dda2dd8b26638de4572f9000c162e5ffa4357e909a3f1a82fb397f1ef721b662.log
):
Configuring library for extra-1.7.13..
Preprocessing library for extra-1.7.13..
Building library for extra-1.7.13..
[ 1 of 22] Compiling Data.IORef.Extra ( src/Data/IORef/Extra.hs, dist/build/Data/IORef/Extra.o, dist/build/Data/IORef/Extra.dyn_o )
[ 2 of 22] Compiling Data.Monoid.Extra ( src/Data/Monoid/Extra.hs, dist/build/Data/Monoid/Extra.o, dist/build/Data/Monoid/Extra.dyn_o )
[ 3 of 22] Compiling Data.Tuple.Extra ( src/Data/Tuple/Extra.hs, dist/build/Data/Tuple/Extra.o, dist/build/Data/Tuple/Extra.dyn_o )
[ 4 of 22] Compiling Data.Typeable.Extra ( src/Data/Typeable/Extra.hs, dist/build/Data/Typeable/Extra.o, dist/build/Data/Typeable/Extra.dyn_o )
[ 5 of 22] Compiling Numeric.Extra    ( src/Numeric/Extra.hs, dist/build/Numeric/Extra.o, dist/build/Numeric/Extra.dyn_o )
[ 6 of 22] Compiling Partial          ( src/Partial.hs, dist/build/Partial.o, dist/build/Partial.dyn_o )
[ 7 of 22] Compiling Data.List.Extra  ( src/Data/List/Extra.hs, dist/build/Data/List/Extra.o, dist/build/Data/List/Extra.dyn_o )

src/Data/List/Extra.hs:200:24: error: [GHC-87543]
    Ambiguous occurrence ‘unsnoc’.
    It could refer to
       either ‘Data.List.unsnoc’,
              imported from ‘Data.List’ at src/Data/List/Extra.hs:41:1-16
              (and originally defined in ‘GHC.List’),
           or ‘Data.List.Extra.unsnoc’,
              defined at src/Data/List/Extra.hs:197:1.
    |
200 |     where Just (a,b) = unsnoc xs
    |                        ^^^^^^
[10 of 22] Compiling Data.Either.Extra ( src/Data/Either/Extra.hs, dist/build/Data/Either/Extra.o, dist/build/Data/Either/Extra.dyn_o )
[16 of 22] Compiling System.Environment.Extra ( src/System/Environment/Extra.hs, dist/build/System/Environment/Extra.o, dist/build/System/Environment/Extra.dyn_o )
[18 of 22] Compiling System.Info.Extra ( src/System/Info/Extra.hs, dist/build/System/Info/Extra.o, dist/build/System/Info/Extra.dyn_o )
[22 of 22] Compiling Text.Read.Extra  ( src/Text/Read/Extra.hs, dist/build/Text/Read/Extra.o, dist/build/Text/Read/Extra.dyn_o )
cabal: Failed to build extra-1.7.13 (which is required by test-extra-1.0). See
the build log above for details.

This commit applies the fix suggested in https://github.com/ndmitchell/extra/pull/103

The related core libraries issue for this user facing change is: https://github.com/haskell/core-libraries-committee/issues/165

Merge request reports