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
。我该如何解决这个问题?