Skip to content

Core lint error when compiling matrix with GHC 9.2.5

Summary

matrix-0.3.6.1 fails to compile with -dcore-lint

Steps to reproduce

$ cabal get matrix-0.3.6.1
$ cat > cabal.project << EOF
packages: .
package matrix
  ghc-options: -dcore-lint
EOF
$ cabal build
Click to expand
*** Core Lint errors : in result of Static argument ***
Data/Matrix.hs:1307:1: warning:
    Mismatch in type between binder and occurrence
    Binder: recLUDecomp'_r2jm :: forall {a}.
                                 (Ord a_a7aP, Fractional a_a7aP) =>
                                 Matrix a_a7aP
                                 -> Matrix a_a7aP
                                 -> Matrix a_a7aP
                                 -> Matrix a_a7aP
                                 -> a_a7aP
                                 -> a_a7aP
                                 -> Int
                                 -> Int
                                 -> Maybe
                                      (Matrix a_a7aP, Matrix a_a7aP, Matrix a_a7aP, Matrix a_a7aP,
                                       a_a7aP, a_a7aP)
    Occurrence: recLUDecomp' :: forall a.
                                (Ord a, Fractional a) =>
                                Matrix a
                                -> Matrix a
                                -> Matrix a
                                -> Matrix a
                                -> a
                                -> a
                                -> Int
                                -> Int
                                -> Maybe (Matrix a, Matrix a, Matrix a, Matrix a, a, a)
      Before subst: forall a.
                    (Ord a, Fractional a) =>
                    Matrix a
                    -> Matrix a
                    -> Matrix a
                    -> Matrix a
                    -> a
                    -> a
                    -> Int
                    -> Int
                    -> Maybe (Matrix a, Matrix a, Matrix a, Matrix a, a, a)
    In the RHS of recLUDecomp' :: forall a.
                                  (Ord a, Fractional a) =>
                                  Matrix a
                                  -> Matrix a
                                  -> Matrix a
                                  -> Matrix a
                                  -> a
                                  -> a
                                  -> Int
                                  -> Int
                                  -> Maybe (Matrix a, Matrix a, Matrix a, Matrix a, a, a)
    In the body of lambda with binder a_a7aP :: *
    In the body of lambda with binder $dOrd_a7aQ :: Ord a_a7aP
    In the body of lambda with binder $dFractional_a7aR :: Fractional
                                                             a_a7aP
    In the body of lambda with binder eta_B0 :: Matrix a_a7aP
    In the body of lambda with binder eta_B1 :: Matrix a_a7aP
    In the body of lambda with binder eta_B2 :: Matrix a_a7aP
    In the body of lambda with binder eta_B3 :: Matrix a_a7aP
    In the body of lambda with binder eta_B4 :: a_a7aP
    In the body of lambda with binder eta_B5 :: a_a7aP
    In the body of lambda with binder eta_B6 :: Int
    In the body of lambda with binder eta_B7 :: Int
    In the RHS of sat_worker_s9pN :: Matrix a_a7aP
                                     -> Matrix a_a7aP
                                     -> Matrix a_a7aP
                                     -> Matrix a_a7aP
                                     -> a_a7aP
                                     -> a_a7aP
                                     -> Int
                                     -> Maybe
                                          (Matrix a_a7aP, Matrix a_a7aP, Matrix a_a7aP,
                                           Matrix a_a7aP, a_a7aP, a_a7aP)
    In the body of lambda with binder eta_B0 :: Matrix a_a7aP
    In the body of lambda with binder eta_B1 :: Matrix a_a7aP
    In the body of lambda with binder eta_B2 :: Matrix a_a7aP
    In the body of lambda with binder eta_B3 :: Matrix a_a7aP
    In the body of lambda with binder eta_B4 :: a_a7aP
    In the body of lambda with binder eta_B5 :: a_a7aP
    In the body of lambda with binder eta_B6 :: Int
    In the body of letrec with binders recLUDecomp'_r2jm :: forall {a}.
                                                            (Ord a_a7aP, Fractional a_a7aP) =>
                                                            Matrix a_a7aP
                                                            -> Matrix a_a7aP
                                                            -> Matrix a_a7aP
                                                            -> Matrix a_a7aP
                                                            -> a_a7aP
                                                            -> a_a7aP
                                                            -> Int
                                                            -> Int
                                                            -> Maybe
                                                                 (Matrix a_a7aP, Matrix a_a7aP,
                                                                  Matrix a_a7aP, Matrix a_a7aP,
                                                                  a_a7aP, a_a7aP)
    In the body of letrec with binders $dNum_a7HJ :: Num a_a7aP
    In the body of letrec with binders $dEq_a7HI :: Eq a_a7aP
    In the body of letrec with binders ds_d8gN :: (Int, Int)
    In the body of letrec with binders i_a2BY :: Int
    In the body of letrec with binders j_a2BZ :: Int
    In the body of letrec with binders u'_a2C0 :: Matrix a_a7aP
    In the body of letrec with binders ukk_a2C9 :: a_a7aP
    In the body of letrec with binders ds_d8gb :: (Matrix a_a7aP,
                                                   Matrix a_a7aP)
    In the body of letrec with binders u''_a2C7 :: Matrix a_a7aP
    In a case alternative: (False)
    In a case alternative: (False)
    In an occurrence of recLUDecomp' :: forall a.
                                        (Ord a, Fractional a) =>
                                        Matrix a
                                        -> Matrix a
                                        -> Matrix a
                                        -> Matrix a
                                        -> a
                                        -> a
                                        -> Int
                                        -> Int
                                        -> Maybe (Matrix a, Matrix a, Matrix a, Matrix a, a, a)
    Substitution: [TCvSubst
                     In scope: InScope {a_a7aP}
                     Type env: [a7aP :-> a_a7aP]
                     Co env: []]

*** End of Offense ***


<no location info>: error: 
Compilation had errors

## Expected behavior

Environment

  • GHC version used: 9.2.5
To upload designs, you'll need to enable LFS and have an admin enable hashed storage. More information