Proposal: add Int indexing functions to Data.Set

wren ng thornton wren at
Sat Apr 30 23:34:46 CEST 2011

On 4/29/11 2:08 AM, Luis Casillas wrote:
> El abr 28, 2011, a las 10:42 p.m., Ivan Lazar Miljenovic escribió:
>> Well, before we talk about modifications, etc.: is there a _need_ for
>> this kind of indexing in a Set?
> Well, to take a step back, the reasoning that led me to make this proposal is really no better than this:
> 1. Map already has analogues to the Set functions I'm proposing.
> 2. There is some good reason why Map should have those functions.
> 3. Whatever reason that is, it also applies to Set.
> 4. Ergo, Set should have these functions.
> It looks to me like you disagree with (2) or (3), and you're the second person to do so (out of three who have responded so far).  If the majority of responses turn out like this, well, then the case for my proposal is just not as strong as I assumed it would be.

I'm on the side of disagreeing with (2)/(3).

Perhaps there's a good reason for them to be there, but I've yet to see 
it. They look to me like the kind of clutter that tends to accrue in the 
interfaces you see in OO and imperative code; they may have been 
pragmatic once for somebody, but they don't make sense to the 
abstraction being provided by the API (and they don't appear to make 
enough sense to alter the abstraction to include them either).

Live well,

More information about the Libraries mailing list