On Thu, Jan 19, 2012 at 10:15 AM, Dominic Espinosa <dces...@fastmail.fm> wrote: > Hello, > > I'm trying to use the fftw binding, and its functions operate on CArrays of > Complex. My data is coming from hsndfile, so it starts out as a Vector of > Double. How do I convert this data to CArray? The API functions in the > CArray module don't seem to indicate how.
My first recommendation would be to use the vector-fftw package, which uses Vectors instead of CArrays. But as the author of that package I may be a bit biased. Alternately, converting between CArrays and Vectors isn't too hard if you want to do it directly. For example, you can convert from Vector to CArray by using Data.Vector.Storable.unsafeToForeignPtr and Data.Array.CArray.Base.unsafeForeignPtrToIOCArray. Other functions in those modules will let you go in the other direction. Best, -Judah _______________________________________________ Haskell-Cafe mailing list Haskell-Cafe@haskell.org http://www.haskell.org/mailman/listinfo/haskell-cafe