Problem
rel8-1.7.0.0 fails to compile when semialign >= 1.3 is resolved. semialign-1.3 made Unzip a superclass of Semialign, but Rel8.Schema.HTable.Vectorize defines instance Semialign (First a) without a corresponding Unzip (First a) instance.
Error:
src/Rel8/Schema/HTable/Vectorize.hs:200:10: error: [GHC-39999]
• No instance for 'Unzip (First a)'
arising from the superclasses of an instance declaration
• In the instance declaration for 'Semialign (First a)'
|
200 | instance Semialign (First a) where
| ^^^^^^^^^^^^^^^^^^^
Root cause
In semialign >= 1.3, the class hierarchy changed so that Semialign requires Unzip as a superclass (class Unzip f => Semialign f). The Unzip import in Vectorize.hs also omits (..), so the methods are not in scope.
Who is affected
Any project that depends on both rel8 and a package that transitively requires semialign >= 1.3. In practice, aeson >= 2.2 pulls in semialign >= 1.3, so users of rel8 + aeson >= 2.2 on a clean build will hit this.
rel8's own cabal.project uses allow-newer: *:base which forces semialign-1.2.x and hides the issue.
Fix
Two changes to src/Rel8/Schema/HTable/Vectorize.hs:
- Import
Unzip with its methods: import Data.Zip (Unzip (..), Zip, Zippy(..), zipWith)
- Add the missing instance before
Semialign (First a):
instance Unzip (First a) where
unzipWith _ (First a) = (First a, First a)
A working patch is available at: https://github.com/MMZK1526/rel8/tree/fix-unzip (based on the 0e1acf0 / v1.7.0 commit).
Environment
- GHC 9.6.7
- rel8 1.7.0.0
- semialign 1.3+ (e.g. 1.4)
- aeson 2.2+
Problem
rel8-1.7.0.0fails to compile whensemialign >= 1.3is resolved.semialign-1.3madeUnzipa superclass ofSemialign, butRel8.Schema.HTable.Vectorizedefinesinstance Semialign (First a)without a correspondingUnzip (First a)instance.Error:
Root cause
In
semialign >= 1.3, the class hierarchy changed so thatSemialignrequiresUnzipas a superclass (class Unzip f => Semialign f). TheUnzipimport inVectorize.hsalso omits(..), so the methods are not in scope.Who is affected
Any project that depends on both
rel8and a package that transitively requiressemialign >= 1.3. In practice,aeson >= 2.2pulls insemialign >= 1.3, so users ofrel8+aeson >= 2.2on a clean build will hit this.rel8's own
cabal.projectusesallow-newer: *:basewhich forcessemialign-1.2.xand hides the issue.Fix
Two changes to
src/Rel8/Schema/HTable/Vectorize.hs:Unzipwith its methods:import Data.Zip (Unzip (..), Zip, Zippy(..), zipWith)Semialign (First a):A working patch is available at: https://github.com/MMZK1526/rel8/tree/fix-unzip (based on the
0e1acf0/ v1.7.0 commit).Environment