-
Notifications
You must be signed in to change notification settings - Fork 13
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Add support for GHC 9.10
.
#74
Conversation
This commit fixes a build failure that occurs when compiling with GHC version `>= 9.10` and base version `>= 4.20.0.0`: ``` [1 of 2] Compiling Codec.Binary.Bech32.Internal src/Codec/Binary/Bech32/Internal.hs:93:1: error: [GHC-66111] The import of ‘Data.Foldable’ is redundant except perhaps to import instances from ‘Data.Foldable’ To import instances alone, use: import Data.Foldable() | 93 | import Data.Foldable | ^^^^^^^^^^^^^^^^^^^^... ``` Related issue: haskell/core-libraries-committee#167
c05b98e
to
2eb9c30
Compare
3014c17
to
26a1802
Compare
@@ -72,40 +72,73 @@ module Codec.Binary.Bech32.Internal | |||
|
|||
) where | |||
|
|||
import Prelude |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
do you really think it is good idea?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The release of GHC 9.10.1
made the following change to base
:
This leads to the following build failure, when compiled with GHC 9.10.1
:
[1 of 2] Compiling Codec.Binary.Bech32.Internal
src/Codec/Binary/Bech32/Internal.hs:93:1: error: [GHC-66111]
The import of ‘Data.Foldable’ is redundant
except perhaps to import instances from ‘Data.Foldable’
To import instances alone, use: import Data.Foldable()
|
93 | import Data.Foldable
| ^^^^^^^^^^^^^^^^^^^^...
The error occurs because foldl'
is now imported both by Data.Foldable
and by Prelude
.
Supposing that we only had to support GHC ≥ 9.10
, then we could use either of the following solutions:
- hide
foldl'
withimport Prelude hiding (foldl')
- remove the redundant
import Data.Foldable (foldl')
However, both of these solutions will lead to compile errors on GHC < 9.10
, which we still have to support.
The solution used by this PR is to replace all implicit imports with explicit imports: this should guarantee we import exactly the same set of symbols across different GHC versions.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@paweljakubas Here's a similar change made in another library: blamario/monoid-subclasses@de06735
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
thanks for the explanation! very unfortunate change I must say ....
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
thanks for the explanation! very unfortunate change I must say ....
Yeah, I'm guessing it caused headaches for a few people!
On the bright side though, we now have foldl'
in Prelude
. 😄
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
🥇
34367af
to
4527f06
Compare
This PR adds support for GHC
9.10
andbase
version4.20.0.0
.