我已经安装了该Vector
软件包并REPA
使用 Cabal for GHC 7.10.2。运行这个程序:
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
已经安装了(它是 Base 的一部分吗?),但它没有暴露Data.Vector.Unboxed
. 我该如何解决这个问题?