[Haskell-cafe] Creating Repa arrays from unboxed vectors

Ivan Lazar Miljenovic ivan.miljenovic at gmail.com
Thu Oct 4 13:10:03 CEST 2012


On 4 October 2012 20:50, Janek S. <fremenzone at poczta.onet.pl> wrote:
> 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)
>
> <interactive>:5:16:
>     Couldn't match expected type `vector-0.9.1:Data.Vector.Unboxed.Base.Vector
>                                     e0'
>                 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)

This makes it look like you've got two versions of vector installed,
with Repa built against the version that _isn't_ 0.9.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.
>
> Janek
>
> _______________________________________________
> Haskell-Cafe mailing list
> Haskell-Cafe at haskell.org
> http://www.haskell.org/mailman/listinfo/haskell-cafe



-- 
Ivan Lazar Miljenovic
Ivan.Miljenovic at gmail.com
http://IvanMiljenovic.wordpress.com



More information about the Haskell-Cafe mailing list