Doesn't work with vector 0.10 / GHC 7.4
Closed this issue · 3 comments
I'm trying to build HEAD of the math-functions package, and in my automated build log for GHC 7.4 I get a weird compilation error.
Preprocessing library math-functions-0.1.4.0...
[1 of 6] Compiling Numeric.Sum ( Numeric/Sum.hs, dist/build/Numeric/Sum.o )
Loading package ghc-prim ... linking ... done.
Loading package integer-gmp ... linking ... done.
Loading package base ... linking ... done.
Loading package array-0.4.0.0 ... linking ... done.
Loading package deepseq-1.3.0.0 ... linking ... done.
Loading package containers-0.4.2.1 ... linking ... done.
Loading package pretty-1.1.1.0 ... linking ... done.
Loading package template-haskell ... linking ... done.
Loading package primitive-0.5.0.1 ... linking ... done.
Loading package vector-0.10.0.1 ... linking ... done.
Loading package vector-th-unbox-0.2.0.1 ... linking ... done.
Loading package erf-2.0.0.0 ... linking ... done.
Numeric/Sum.hs:80:1:
`basicUnsafeFreeze' is not a (visible) method of class `Data.Vector.Generic.Base.Vector'
Numeric/Sum.hs:80:1:
`basicUnsafeThaw' is not a (visible) method of class `Data.Vector.Generic.Base.Vector'
Numeric/Sum.hs:80:1:
`basicLength' is not a (visible) method of class `Data.Vector.Generic.Base.Vector'
... etc, etc ...
My GHC 7.6 build also uses vector 0.10.0.1, but has no such problem. Any idea what might be going on?
Bringing classes into scope fixed issue. (GHC 7.4.2). Apparently GHC-7.4 cannot create instances if type class method isn't in scope.
I fixed this in the math-functions repo with haskell/math-functions@ace6a55. It would be helpful to make this need clear in the documentation.
It is mentioned in the documentation… “Older versions of GHC needs the Vector and MVector class method names in scope”… but it doesn't say GHC 7.4.* specifically. I've clarified the snippet in 6c12af2, and released 0.2.0.2.