Proposal: add 'findLess' and variants to containers

Milan Straka fox at ucw.cz
Sat Mar 3 10:17:58 CET 2012


Hi,

> On 12/02/12 14:14, Twan van Laarhoven wrote:
> >Discussion deadline: 2 weeks from now; Sunday, 26 February 2012.
> 
> The deadline for discussion has passed. There were no explicit votes
> for or against, but 4 reactions that count as positive, and 1 as
> unconvinced.
> 
> The only issue seems to be the names:
> 
> >Thanks for the benchmark. In light of this and your other arguments I
> >think we should add the functions. Lets settle on the names.
> 
> I have made a case for /lookup(Less|Greater)(Equal)?/, based on the
> fact that lookup* functions return "Maybe x" values, while find*
> functions return values without a maybe wrapper. But I don't really
> care that much. Flipping a coin between "find" and "lookup" will
> also work for me :)

I would go with

lookupLT, lookupLE, lookupGE, lookupGT

The names are short, and LT/GT are universally known from the Ordering
type.

Cheers,
Milan



More information about the Libraries mailing list