Library proposal: add a Location interface for element-wise operations on Data.Map (#4887)

Iavor Diatchki iavor.diatchki at gmail.com
Sun Jan 9 00:55:42 CET 2011


Hi,
I think that Henning probably meant that those functions should return a
value of type Maybe (a, Location k a): Nothing when the Map is empty, and
Just (...) otherwise.  This seems like a good idea to me.  The API looks
nice otherwise.
-Iavor

On Sat, Jan 8, 2011 at 7:28 AM, Ross Paterson <ross at soi.city.ac.uk> wrote:

> On Sat, Jan 08, 2011 at 04:21:54PM +0100, Henning Thielemann wrote:
> > On Sat, 8 Jan 2011, Ross Paterson wrote:
> > >That would work well for search, but then index, minLocation and
> maxLocation
> > >would return Locations that value was always mapped to Just something.
> > >Extra invariants like that feel wrong to me.
> >
> > 'index' can be out of range and then return Nothing. minLocation and
> > maxLocation return Nothing if the Map is empty.
>
> But what is the key in those cases?
>
> _______________________________________________
> Libraries mailing list
> Libraries at haskell.org
> http://www.haskell.org/mailman/listinfo/libraries
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://www.haskell.org/pipermail/libraries/attachments/20110108/d6690dad/attachment-0001.htm>


More information about the Libraries mailing list