cassava icon indicating copy to clipboard operation
cassava copied to clipboard

Support Data.Vector.Storable

Open afwlehmann opened this issue 9 years ago • 4 comments

Hi,

decode currently returns a Data.Vector.Vector. If, however, you want to parse CSV data for further numerical processing, e.g. with hmatrix, then a Data.Vector.Storable.Vector would be required. Manual conversion between both types can be cumbersome, so the question is whether cassava could support both Vector and Storable.Vector?

afwlehmann avatar Nov 16 '15 11:11 afwlehmann

Making the inner vector (i.e. when we return a Vector (Vector a))) Storable should work, we already support unboxed inner vectors. Making the outermost vector storable is a bit trickier, as the decode function would need to be even more polymorphic in its return type.

tibbe avatar Nov 16 '15 12:11 tibbe

Thanks for answering so quickly. By "should work" you mean that it should already work out of the box or that it should (more or less easily) work out to implement it this way in cassava?

afwlehmann avatar Nov 16 '15 16:11 afwlehmann

The latter.

tibbe avatar Nov 16 '15 16:11 tibbe

Alright, thanks.

afwlehmann avatar Nov 16 '15 16:11 afwlehmann