[Haskell-cafe] [ANN] random-shuffle package
Manlio Perillo
manlio_perillo at libero.it
Thu Mar 19 10:41:45 EDT 2009
I'm pleased to announce the availability of random-shuffle package.
The cabalized package is available at
http://haskell.mperillo.ath.cx/random-shuffle-0.0.2.tar.gz
The code is based on http://okmij.org/ftp/Haskell/perfect-shuffle.txt
Thanks to Oleg Kiselyov for sharing this!
I have made some changes to Oleg code:
- changed coding style to what seems to be a more common
Haskell coding style
- Used Int, instead of Integer, for the index type
- Forced some strict evaluation.
It was a trial and error effort (I'm not an expert),
but results are very impressive.
Example program and timings/memory usage, are on:
http://hpaste.org/fastcgi/hpaste.fcgi/view?id=2600
NOTE: I don't plan to upload the package to Hackage, for the near future.
I'm thinking to add some other functions that operate on lists,
like Python random module (random.choice, random.sample), and the
partitioning function I have posted the other day (although I'm not sure
this is a generic useful function).
However, in this case, the package name should be changed.
I'm not sure it is a good idea to release a package that implements only
one function (but I may be wrong).
Feedbacks (on current random-shuffle and future additions) are welcomed.
Regards Manlio Perillo
More information about the Haskell-Cafe
mailing list