Open ahgibbons opened 7 years ago
I guess it needs an instance for Target
. I don't know if it is that this can not be implemented, if it was just not done yet... if you try it out and it works send a PR? (:
iirc ByteString
is backed by ForeignPtr
, which has a Target
instance already, so this should be doable.
@tmcdonell It does seem that the implementation of Target
is a bit tricky, since Data.ByteString
does not have a mutable interface. For example, newMVec
is easy for vector because of the Data.Vector.Mutable.new
function, but there is no equivalent for ByteString. One way around this is to just define everything in terms of ForeignPtr Word8
which would mean the Target
class looks identical to that for ForeignPtr
but with e
specified to Word8.
This might be desired just for completeness of the module.
The
Data.Array.Repa.Repr.ByteString
module provides a way to make arrays fromByteString
types usingfromByteString
. The resulting array has the typeArray B sh Word8
. It seems that this type is not very useful as there is no equivalent ofcomputeS
orcomputeP
for this representation type. Importantly, there seems to be no way to convert any other type of array to anArray B
.Is this implementation incomplete?