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

Build failure with GHC 8.2 #232

Closed
snoyberg opened this issue Jul 31, 2017 · 9 comments
Closed

Build failure with GHC 8.2 #232

snoyberg opened this issue Jul 31, 2017 · 9 comments

Comments

@snoyberg
Copy link

src/Internal/Util.hs:625:5: error:
    • Could not deduce (Eq t)
      from the context: (Indexable (c t) a, Indexable (c t) t,
                         Linear t c, Num (c t), Fractional t, Num a, Eq a)
        bound by the inferred type for ‘redu’:
                   forall a t (c :: * -> *).
                   (Indexable (c t) a, Indexable (c t) t, Linear t c, Num (c t),
                    Fractional t, Num a, Eq a) =>
                   (Int, [c t]) -> [c t]
        at src/Internal/Util.hs:(625,5)-(632,20)
    • In the ambiguity check for the inferred type for ‘redu’
      To defer the ambiguity check to use sites, enable AllowAmbiguousTypes
      When checking the inferred type
        redu :: forall a t (c :: * -> *).
                (Indexable (c t) a, Indexable (c t) t, Linear t c, Num (c t),
                 Fractional t, Num a, Eq a) =>
                (Int, [c t]) -> [c t]
      In an equation for ‘pivotDown’:
          pivotDown t n xs
            | t == n = []
            | otherwise = y : pivotDown t (n + 1) ys
            where
                y : ys = redu (pivot n xs)
                pivot k
                  = (const k &&& id) . sortBy (flip compare `on` (abs . (! k)))
                redu (k, x : zs)
                  | p == 0 = error "gauss: singular!"
                  | otherwise = u : map f zs
                  where
                      p = x ! k
                      u = scale (recip (x ! k)) x
                      ....
                redu (_, []) = []
    |
625 |     redu (k,x:zs)
    |     ^^^^^^^^^^^^^...
snoyberg added a commit to commercialhaskell/stackage that referenced this issue Jul 31, 2017
@albertoruiz
Copy link
Collaborator

I think this problem has been solved in #231

snoyberg added a commit to commercialhaskell/stackage that referenced this issue Aug 3, 2017
@mstksg
Copy link
Contributor

mstksg commented Aug 6, 2017

Anything in particular keeping this from being pushed to hackage? :)

@albertoruiz
Copy link
Collaborator

I'm on a trip, without a computer :) I will push a new version to hackage in a few days.

@albertoruiz
Copy link
Collaborator

I have pushed the package. Please check that it works, I cannot properly test it at the moment.

@aligusnet
Copy link

Yes, it works now, thanks.

I have successfully built my mltool with the following stack.yaml:

resolver: nightly-2017-08-09
packages:
- '.'
extra-deps: [hmatrix-0.18.1.0, hmatrix-gsl-0.18.0.1, hmatrix-gsl-stats-0.4.1.6]
flags: {}
extra-package-dbs: []
extra-lib-dirs: [/usr/lib]

@idontgetoutmuch
Copy link
Member

It doesn't work for me

nix-shell -p "haskell.packages.ghc822.ghcWithPackages (pkgs: [pkgs.hmatrix-gsl])"
[20 of 27] Compiling Internal.Util    ( src/Internal/Util.hs, dist/build/Internal/Util.o )

src/Internal/Util.hs:625:5: error:
    • Could not deduce (Eq t)
      from the context: (Indexable (c t) a, Indexable (c t) t,
                         Linear t c, Num (c t), Fractional t, Num a, Eq a)
        bound by the inferred type for ‘redu’:
                   forall a t (c :: * -> *).
                   (Indexable (c t) a, Indexable (c t) t, Linear t c, Num (c t),
                    Fractional t, Num a, Eq a) =>
                   (Int, [c t]) -> [c t]
        at src/Internal/Util.hs:(625,5)-(632,20)
    • In the ambiguity check for the inferred type for ‘redu’
      To defer the ambiguity check to use sites, enable AllowAmbiguousTypes
      When checking the inferred type
        redu :: forall a t (c :: * -> *).
                (Indexable (c t) a, Indexable (c t) t, Linear t c, Num (c t),
                 Fractional t, Num a, Eq a) =>
                (Int, [c t]) -> [c t]
      In an equation for ‘pivotDown’:
          pivotDown t n xs
            | t == n = []
            | otherwise = y : pivotDown t (n + 1) ys
            where
                y : ys = redu (pivot n xs)
                pivot k
                  = (const k &&& id) . sortBy (flip compare `on` (abs . (! k)))
                redu (k, x : zs)
                  | p == 0 = error "gauss: singular!"
                  | otherwise = u : map f zs
                  where
                      p = x ! k
                      u = scale (recip (x ! k)) x
                      ....
                redu (_, []) = []
    |
625 |     redu (k,x:zs)
    |     ^^^^^^^^^^^^^...

@idontgetoutmuch
Copy link
Member

Must be an old version of nixpkgs. I downloaded it from git and now it works.

nix-shell -p "haskell.packages.ghc822.ghcWithPackages (pkgs: [pkgs.hmatrix-gsl])" -I nixpkgs=/Users/dom/nixpkgs

@idontgetoutmuch
Copy link
Member

@albertoruiz @snoyberg I think this ticket can be closed?

@albertoruiz
Copy link
Collaborator

Yes, thanks!

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

5 participants