linear-base
linear-base copied to clipboard
Ambiguous occurrence Generically when building with GHC 9.4
Describe the bug
linear-base-0.2.0
fails to build against GHC 9.4 alpha 1, because GHC.Generics
now exports Generically
.
To Reproduce
cabal unpack linear-base-0.2.0
cd linear-base-0.2.0
cabal build -w ghc-9.4.0.20220501 --allow-newer
src/Data/Unrestricted/Linear/Internal/Consumable.hs:76:3: error:
Ambiguous occurrence ‘Generically’
It could refer to
either ‘Generics.Linear.Generically’,
imported from ‘Generics.Linear’ at src/Data/Unrestricted/Linear/Internal/Consumable.hs:39:1-22
(and originally defined in ‘GHC.Generics’)
or ‘Prelude.Linear.Generically.Generically’,
imported from ‘Prelude.Linear.Generically’ at src/Data/Unrestricted/Linear/Internal/Consumable.hs:40:1-33
(and originally defined
at src/Prelude/Linear/Generically.hs:16:1-37)
|
76 | Generically Prelude.Char
|
Expected behavior Expected a successful build.
Thanks @Bodigrim .
I hadn't tried, but let's just say that I'm not surprised. I was sort of expecting this to happen even. I'm not 100% sure how best to make a version which is compatible with both GHC 9.2 and GHC 9.4 yet. (I've been having issues with just being compatible with GHC 9.2, see #414 )
My favoured plan is to make two files which export Generically
, one that defines it, and one that re-exports base's one. Build with the former in GHC 9.2 and with the latter in GHC 9.4.
All that being said, I'm a bit swamped right now, so I'll be slow to implement any solution.
There's an additional issue here when building with 9.4:
• The ‘~’ operator is out of scope.
Assuming it to stand for an equality constraint.
• NB: ‘~’ used to be built-in syntax but now is a regular type operator
exported from Data.Type.Equality and Prelude.
If you are using a custom Prelude, consider re-exporting it.
• This will become an error in a future GHC release.
|
157 | n ~ Arity b f
| ^
The recommendation from here appears to fix it:
module Prelude.Linear.Internal
( module Prelude.Linear.Internal
, module Data.Type.Equality
) where
I think this proposal would be the reason.
Yeah, thanks. Just updated the previous comment :)
https://hackage.haskell.org/package/generically ?
Don't we always want our own version?
I didn't know about the generically package, thanks for point it out @L-as. It would have worked, but we ended up deploying our own version. in #427 . This issue should have been closed (I'll close it now), but we mistakenly didn't.
I'll release very soon, I just need a couple of hours of focus time to push a few PRs and make the release.
I am still getting issues with the dep tasty-hedgehog being marked as broken when testing this on ghc 9.4 using nix (probably out of scope), maybe a hackage release with different bounds can help though?