[Haskell-cafe] Array, Vector, Bytestring

Clark Gaebel cgaebel at uwaterloo.ca
Tue Jun 4 05:19:38 CEST 2013

That's absolutely true. Wrappers around vector for your multidimensional
access is probably best, but Vectors of Vectors are usually easier.

But again, you're right. Multidimensional access is a pain. If it's a
"matrix" of numerical values, you could take a look at 'hmatrix'.

  - Clark

On Monday, June 3, 2013, Jason Dagit wrote:

> On Mon, Jun 3, 2013 at 7:45 PM, Clark Gaebel <cgaebel at uwaterloo.ca<javascript:;>>
> wrote:
> > How is this a problem?
> >
> > If you're representing text, use 'text'.
> > If you're representing a string of bytes, use 'bytestring'.
> > If you want an "array" of values, think c++ and use 'vector'.
> > If you want to mutate arrays, first, make sure you do. You probably
> don't.
> > If you're sure, use MVector.
> >
> > Don't use String, except to interface with legacy code. You probably want
> > 'text'.
> > Don't use Array. Anything it can be used for, can be done with 'vector'.
> You have to build multidimensional accessors for vector yourself.
> Array supports them out of the box. I still prefer vector, but it's
> only fair to note that multidimensional data is a weak spot of vector.
> Jason
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://www.haskell.org/pipermail/haskell-cafe/attachments/20130603/1e73ae60/attachment.htm>

More information about the Haskell-Cafe mailing list