[Haskell-cafe] naming a data structure for weighted random selection without replacement

Isaac Dupree isaacdupree at charter.net
Mon Feb 18 21:27:04 EST 2008


Michał Pałka wrote:
> On Mon, 2008-02-18 at 11:37 +0000, Luke Palmer wrote:
>> On Feb 18, 2008 5:11 AM, Stuart Cook <scook0 at gmail.com> wrote:
>>> A while ago I wrote a little data structure that allows weighted
>>> random selection-without-replacement from a collection of values in
>>> O(log n) time.[1] I'm now in the process of packaging it up for
>>> Hackage, but I'm looking for good names for both the type and its
>>> operations.
>> I'm pretty sure it should have Random in the name whatever it is
>> called.
> 
> Obvious idea: How about WeightedRandom?

the "without replacement" thing is more specific. Although maybe the 
design could accomodate selection-with-replacement in the same package too

or RandomPool? RandomHat? OutOfAHat? :-)

-Isaac


More information about the Haskell-Cafe mailing list