Proposal: add Int indexing functions to Data.Set

Luis Casillas luis at casillas.org
Fri Apr 29 23:26:51 CEST 2011


On Apr 29, 2011, at 11:53 AM, Gwern Branwen wrote:

> On Fri, Apr 29, 2011 at 12:08 AM, Luis Casillas <luis at casillas.org> wrote:
>> updateAt :: (k -> a -> Maybe a) -> Int -> Map k a -> Map k a
> 
> I took a look at all my local repos (c.h.o, Patch-tag, misc repos, and
> GitHub since I recently re-ran
> http://www.gwern.net/haskell/Archiving%20GitHub.html ).
> 
> A grep* for updateAt (randomly picked one whose name looked like it'd
> be fairly unique) turned up what seems to be very few actual uses of
> updateAt, and mostly similarly named functions and various
> implementations of updateAt.

Thanks Gwern.

For the record, though, my patch doesn't add a Set.updateAt operation, because it just didn't make sense.  Map.updateAt is about updating the *value* that a key is mapped to, but the elements of a set correspond to the keys of a map.



More information about the Libraries mailing list