Proposal: add Int indexing functions to Data.Set

Wolfram Kahl kahl at
Fri Apr 29 16:26:53 CEST 2011

On Fri, Apr 29, 2011 at 11:34:33AM +0200, Balazs Komuves wrote:
> Isn't for example "elemAt k someMapOrSet" equivalent (but much faster) to
> "(toList someMapOrSet) !! k",


(If this specification (probably better with toAscList)
 is not documented, it should be.)

> and similarly for all the other index functions? So how does it break any
> abstraction?
> While I have to agree (referring to the old discussion) that the Map/Set API
> is far from perfect,
> I'm much more in favour of exposing efficient functionality than removing
> useful stuff...



More information about the Libraries mailing list