
18 Feb
2008
18 Feb
'08
10:31 p.m.
On Tue, Feb 19, 2008 at 1:27 PM, Isaac Dupree
the "without replacement" thing is more specific. Although maybe the design could accomodate selection-with-replacement in the same package too
Once you have without-replacement, with-replacement is easy: just re-use the old structure instead of the new one. Laziness means that you don't even pay the cost of deletion. (Multiple-with-replacement takes a little more work, because you can't just re-use the multiple-without-replacement function if you want each draw to be independent.)
or RandomPool? RandomHat? OutOfAHat? :-)
I'm currently leaning towards something like "Data.Random.WeightedPool". (I really love Hat and Urn, but I now think they're a little *too* cute.) Stuart