[Haskell-cafe] vector to uvector and back again
Dan Doel
dan.doel at gmail.com
Fri Feb 26 01:29:33 EST 2010
On Friday 26 February 2010 12:13:56 am Bryan O'Sullivan wrote:
> Dan, do you think you might be releasing your port of uvector-algorithms to
> vector any time soon? I've ported mwc-random to use vector, and I'd like to
> move statistics (which needs uvector-algorithms) and criterion (ditto) too.
I don't want to hold anything up, so I've released the port to vector. It's
available on hackage as vector-algorithms 0.3:
http://hackage.haskell.org/package/vector-algorithms
It's mostly a straight port, so not much new to learn.
- There's no ".Array" in the module names anymore.
- The Schwartzian transform combinators are gone from
Data.Vector.Algorithms.Combinators, because I haven't decided on the best
way to handle those yet (the existing implementation won't work on all
vectors in the MVector class). Hope that isn't a problem.
- There's also a new module D.V.A.Search, which so far implements a couple
variations on binary search. It was something I was starting before the
switch to vector, so it isn't complete yet.
There are some moderate performance regressions on some of the algorithms, but
nothing major. Also, the optimizer in 6.12 seems to get very confused when
working with IO as the PrimMonad in question, resulting in significantly worse
performance. So, I'd recommend sticking with ST, or at least making sure the
algorithms are called in ST, with stToIO. HEAD is better on both these fronts,
so things should get better in the future.
Let me know if there are any issues.*
-- Dan
* P.S. I just noticed I left the .cabal recommending -O2 and -fvia-c -optc-O3.
That's obviously not current since the .cabal is set to compile with -Odph and
with the NCG. I'll amend that in a later version. :)
More information about the Haskell-Cafe
mailing list