[Haskell-cafe] uvector and the stream interface

Don Stewart dons at galois.com
Mon Jul 14 13:19:19 EDT 2008


jules:
> Don Stewart wrote:
> >sk:
> >>currently i'm working on stuff that looks something like this:
> >>
> >>1 read soundfile from disk in blocks of N samples (IOCArray, hsndfile  
> >>package)
> >>2 convert to CArray with unsafeFreeze (simple O(1) cast, carray package)
> >>3 perform FFT (CArray, fftw package)
> >>4 convert to UArr (uvector package)
> >>5 do some stuff with vectors
> 
> [snip]
> 
> >It would be helpful to see the programs people are writing with uvector,
> >so I can polish up the API some more :)
> 
> It would also be helpful to have someone explain why we have:
> 
> Ptr a
> ByteString
> IOUArray
> IOCArray
> Data.Storable.StorableArray
> UArr
> 
> Of course, I know the answers to some of those questions, ByteString is 
> obviously less polymorphic than all the others there, and Ptr a doesn't 
> contain size information. But it seems we have a rapidly bifurcating 
> profusion of 'typed interfaces to chunks of memory' with no obvious 
> consistency to their naming scheme and I think it's starting to get 
> confusing...
> 
> Jules

An abstraction stack:


    Impure              Pure
    -------------------------------
Further from the machine:
 
                        UArr
    hmatrix/blas/fftw
    IOUArr
    CArray
                        ByteString
    StorableArray
                STUArr
    MUArr
    ForeginPtr
    Ptr
    Addr#

Closer to machine

The key now is to ensure we have enough introduction and elimination
forms, and perhaps a few mergers can also take place.

-- Don


More information about the Haskell-Cafe mailing list