Skip to content
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

sparse-linear-algebra 0.3 and 0.3.1 fail to build with GHC 9.4 #79

Open
andreasabel opened this issue Dec 27, 2022 · 8 comments
Open

sparse-linear-algebra 0.3 and 0.3.1 fail to build with GHC 9.4 #79

andreasabel opened this issue Dec 27, 2022 · 8 comments

Comments

@andreasabel
Copy link

andreasabel commented Dec 27, 2022

src/Data/Sparse/PPrint.hs:60:29: error:
    • Could not deduce (RealFloat a) arising from a use of ‘f’
      from the context: (PrintfArg a, Epsilon a, Epsilon (Complex a),
                         Ord a)
        bound by the type signature for:
                   printCN :: forall a.
                              (PrintfArg a, Epsilon a, Epsilon (Complex a), Ord a) =>
                              Int -> Int -> PPrintOptions -> [Complex a] -> String
        at src/Data/Sparse/PPrint.hs:(58,1)-(59,57)
      Possible fix:
        add (RealFloat a) to the context of
          the type signature for:
            printCN :: forall a.
                       (PrintfArg a, Epsilon a, Epsilon (Complex a), Ord a) =>
                       Int -> Int -> PPrintOptions -> [Complex a] -> String
    • In the third argument of ‘printNpad’, namely ‘f’
      In the expression: printNpad l n f
      In an equation for ‘printCN’:
          printCN l n
            = printNpad l n f
            where
                f o x
                  | nearZero (re x) && isNz (imagPart x)
                  = printf (prepD o (imagPart x) ++ "i") (aim x)
                  | nearZero (imagPart x) && isNz (re x)
                  = printf (prepD o (realPart x)) (re x)
                  | isNz x = printf (prepC o x) (re x) (aim x)
                  | otherwise = printf "_"
   |
60 | printCN l n = printNpad l n f where

Lifted from:

In my role as Hackage Trustee, I revised base to <4.17: https://hackage.haskell.org/package/sparse-linear-algebra-0.3.1/revisions/

@andreasabel andreasabel changed the title sparse-linear-algebra-0.3.1 fails to build with GHC 9.4 sparse-linear-algebra 0.3 and 0.3.1 fail to build with GHC 9.4 Dec 27, 2022
@adamConnerSax
Copy link

adamConnerSax commented Dec 29, 2022

I have a branch that compiles with ghc 9.4.4

  1. Added RealFloat constraint to fix above error
  2. Added TypeOperators extension to one file to silence some warnings
  3. Added a cabal.project file to allow cabal solution. Not sure if this is necessary.
    Would you like to me to make a PR?
    Branch is here: https://github.com/adamConnerSax/sparse-linear-algebra/tree/GHC94

@andreasabel
Copy link
Author

@adamConnerSax : There has been no activity on the code here for 3 years now, judging from the commits, so I would be afraid the PR would just be stuck here.
Maybe you want to take over this package? See procedure at: https://wiki.haskell.org/Taking_over_a_package

@ocramz
Copy link
Owner

ocramz commented Dec 29, 2022 via email

@andreasabel
Copy link
Author

andreasabel commented Dec 29, 2022

@ocramz : Thanks for chiming in!
You can facilitate the takeover (if @adamConnerSax agrees) by:

  1. Adding @adamConnerSax by his Hackage ID to https://hackage.haskell.org/package/sparse-linear-algebra/maintainers/
  2. Giving him write access to this repo.

The second step is optional but I supposed would be easiest because maintaining on a fork is troublesome on github. (An alternative would be to transfer this repo e.g. to a new dedicated github organisation.)

Btw, here is a list of (some of) the public users of this library: https://packdeps.haskellers.com/reverse/sparse-linear-algebra

@adamConnerSax
Copy link

I'm going to respectfully decline.

Given @ocramz comment above and the fact that I have no experience with sparse-matrix code except as an occasional user, I think I will shift away from this library (I wasn't using it for much except a storage format). I do think sparse-matrix libs are a gap in the Haskell numerics ecosystem but I am not going to be able to move this one forward.

@andreasabel
Copy link
Author

Maybe @GregorySchwartz would be interested to keep this project alive?

@GregorySchwartz
Copy link
Contributor

Unfortunately I do not have time, but this library has a great API so I would love for it to be supported still.

@andreasabel
Copy link
Author

@GregorySchwartz @adamConnerSax Maybe you can recruit someone, but I do not think this library has a ton of users. Try to search through the maintainers of the packages that depend on sparse-linear-algebra (see my link above).

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

4 participants