1
我已經使用Cabal for GHC 7.10.2安裝了Vector
包和REPA
。運行這個程序:GHC 7.10.2 Data.Vector.Unboxed與REPA的衝突3.4.0.1
import qualified Data.Array.Repa as R
import qualified Data.Vector.Unboxed as U
main = print $ R.fromUnboxed (R.Z R.:. 16 R.:. 16) (U.replicate 10 0)
我收到以下錯誤:
repa.hs:4:53:
Couldn't match expected type ‘vector-0.10.12.3:Data.Vector.Unboxed.Base.Vector
e0’
with actual type ‘U.Vector a0’
NB: ‘vector-0.10.12.3:Data.Vector.Unboxed.Base.Vector’
is defined in ‘Data.Vector.Unboxed.Base’
in package ‘vector-0.10.12.3’
‘U.Vector’
is defined in ‘Data.Vector.Unboxed.Base’
in package ‘vector-0.11.0.0’
In the second argument of ‘R.fromUnboxed’, namely
‘(U.replicate 10 0)’
In the second argument of ‘($)’, namely
‘R.fromUnboxed (R.Z R.:. 16 R.:. 16) (U.replicate 10 0)’
運行ghc-pkg list | grep vector
,我注意到2個版本矢量包:
vector-0.10.12.3
vector-0.11.0.0
vector-th-unbox-0.2.1.2
我跑ghc-pkg hide vector-0.10.12.3
,並試圖重新編譯,但錯誤仍然存在。看起來vector-0.10.12.3
已經安裝(是它的一部分?),但它並沒有暴露Data.Vector.Unboxed
。我該如何解決這個問題?