Proposed additions to Data.Map: lookupFloor and lookupCeiling

Sean Leather leather at cs.uu.nl
Mon Mar 1 02:39:04 EST 2010


> -- | /O(log n)/. Find the greatest key that is smaller or equal
> -- to the given target key.   This \"floor\" key is returned,
>


> -- | /O(log n)/. Find the smallest key that is greater or equal
> -- to the given target key.   This \"ceiling\" key is returned,
>

It seems more intuitive to reverse the naming. The key parameter to
lookupFloor is actually the ceiling, and the key returned is the greatest
key less than or equal to the ceiling. Since there is no floor involved
here, I would call the function lookupCeiling.

Regards,
Sean
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://www.haskell.org/pipermail/libraries/attachments/20100301/11e1d927/attachment.html


More information about the Libraries mailing list