Data.IntMap/IntSet inconsistencies

Evan Laforge qdunkan at gmail.com
Mon Nov 2 15:30:49 EST 2009


> I would prefer that partial functions return 'Maybe' - then I can pick
> whether or not I want 'Prelude.maybe' behavior or
> 'Data.Maybe.fromMaybe' behavior. I would prefer seeing findMax :: Map
> k a -> Maybe (k, a).
>
> It's also easier to read the function signature and know what is going
> to happen, rather than giving the function three parameters.

Sure, this is reasonable too.

[ ross ]

> Proposal: deprecate and then remove find, findIndex, findMin, findMax,
> deleteFindMin and deleteFindMax.

List.find?  No thanks, I use that all the time.

As far as findMin, toAscList works just as well, so fine, let's kill
it.  For findMax, toDescList, which I thought was patched in a year
ago, still doesn't appear in the latest version of collections, so as
far as I know there's no alternative for it.

As far as findIndex, are there any known uses for indexed Maps?  I
haven't used it but maybe there's some important use I don't know
about.


More information about the Libraries mailing list