[Haskell-cafe] bytestring vs. uvector

Don Stewart dons at galois.com
Tue Mar 10 17:12:07 EDT 2009


bulat.ziganshin:
> 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


Right, so my point stands: there's no difference now. If you can write a
Storable instance, you can write a UA et al instance.

And GHC 6.6 was released what, 11 October 2006? So this has been the
case for a long time.

-- Don


More information about the Haskell-Cafe mailing list