[Haskell-cafe] bytestring vs. uvector
Bulat Ziganshin
bulat.ziganshin at gmail.com
Tue Mar 10 16:55:35 EDT 2009
Hello Don,
Tuesday, March 10, 2009, 11:01:31 PM, you wrote:
>> if uavector use ghc's built-in unboxed array operations (as
>> Data.Array.Unboxed does) then it's necessarily bounded to types
>> supported by those operations
> And what is Storable limited to?
> Ultimately they're all limited to the primops for reading and writing,
the full story:
ghc up to 6.6 has slow access to ForeignArrays, as you may recall
therefore, those primitives was added. ByteArra# plus those primitives
was the only way to have unboxed arrays with fast access
starting with 6.6, ForeignArray access is no-op, so we can just use
obvious Ptr operations (via Storable class) to get unboxed arrays fast
access. so, no more need for those special ByteArray# access operations
but Array library still old, so any effort based on its spources, got
the same restrictions
also, ByteArray# may be unpinned, but afaik, this isn't really
important - it can be coerced to Ptr for the period of one operation
--
Best regards,
Bulat mailto:Bulat.Ziganshin at gmail.com
More information about the Haskell-Cafe
mailing list