[Haskell-cafe] Creating Repa arrays from unboxed vectors

Janek S. fremenzone at poczta.onet.pl
Thu Oct 4 12:50:10 CEST 2012

Dear list,

I'm trying to create unboxed REPA array from unboxed Vector, but I keep getting this type error:

ghci> :m + Data.Array.Repa
ghci> :m + Data.Array.Repa.Repr.Unboxed
ghci> :m + Data.Vector.Unboxed
ghci> fromUnboxed Z (Data.Vector.Unboxed.singleton 1)

    Couldn't match expected type `vector-0.9.1:Data.Vector.Unboxed.Base.Vector
                with actual type `Data.Vector.Unboxed.Vector a0'
    In the return type of a call of `Data.Vector.Unboxed.singleton'
    In the second argument of `fromUnboxed', namely
      `(Data.Vector.Unboxed.singleton 1)'
    In the expression: fromUnboxed Z (Data.Vector.Unboxed.singleton 1)

I am confused, because REPA documentation lists Vector from Data.Vector.Unboxed package as its 
second parameter. Why am I getting this error? I have Repa 3.2 an vector 0.9.1.


More information about the Haskell-Cafe mailing list