ox-arrays stopped compiling due to recent GHC commits: "Could not solve: ‘forall (n :: Maybe Nat). Eq (Const i n)’"
Summary
Package ox-arrays compiles fine with GHC 9.12.2 and a slightly earlier version of ox-arrays compiled fine with !10479 (closed) from a month ago or so. It does not compile with branch ghc-9.14, commit 7b814248, which is after the merge of @simonpj's final !10479 (closed).
Opimization is disabled in this example to work around #26314 (closed).
cabal test -w /home/mikolaj/r/ghc.pre9.14/ghc/_build/stage1/bin/ghc --allow-newer --disable-optimization
...
[ 2 of 16] Compiling Data.Array.Nested.Mixed.Shape ( src/Data/Array/Nested/Mixed/Shape.hs, dist-newstyle/build/x86_64-linux/ghc-9.14.0.20250815/ox-arrays-0.1.0.0/noopt/build/Data/Array/Nested/Mixed/Shape.o, dist-newstyle/build/x86_64-linux/ghc-9.14.0.20250815/ox-arrays-0.1.0.0/noopt/build/Data/Array/Nested/Mixed/Shape.dyn_o )
src/Data/Array/Nested/Mixed/Shape.hs:176:13: error: [GHC-05617]
• Could not solve: ‘forall (n :: Maybe Nat). Eq (Const i n)’
arising from the 'deriving' clause of a data type declaration
• When deriving the instance for (Eq (IxX sh i))
|
176 | deriving (Eq, Ord, Generic)
| ^^
src/Data/Array/Nested/Mixed/Shape.hs:176:17: error: [GHC-05617]
• Could not solve: ‘forall (n :: Maybe Nat). Ord (Const i n)’
arising from the 'deriving' clause of a data type declaration
• When deriving the instance for (Ord (IxX sh i))
|
176 | deriving (Eq, Ord, Generic)
| ^^^
src/Data/Array/Nested/Mixed/Shape.hs:325:13: error: [GHC-05617]
• Could not solve: ‘forall (n :: Maybe Nat). Eq (SMayNat i SNat n)’
arising from the 'deriving' clause of a data type declaration
• When deriving the instance for (Eq (ShX sh i))
|
325 | deriving (Eq, Ord, Generic)
| ^^
src/Data/Array/Nested/Mixed/Shape.hs:325:17: error: [GHC-05617]
• Could not solve: ‘forall (n :: Maybe Nat).
Ord (SMayNat i SNat n)’
arising from the 'deriving' clause of a data type declaration
• When deriving the instance for (Ord (ShX sh i))
|
325 | deriving (Eq, Ord, Generic)
| ^^^
Steps to reproduce
Unfortunately, this is not minimized in any way and depends on typing plugins.
git clone https://git.tomsmeding.com/ox-arrays
cd ox-arrays
git checkout repro-9.14-branch
rm -f cabal.project.local
rm -rf ~/.cabal/packages/head.hackage.ghc.haskell.org
cabal update
cabal test -w /home/mikolaj/r/ghc.pre9.14/ghc/_build/stage1/bin/ghc --allow-newer --disable-optimization
Expected behavior
Compiles.
Environment
- GHC version used: branch ghc-9.14, commit 7b814248
Optional:
- Operating System: Linux
- System Architecture: amd64