
Please see attached 2 patches (and 1 misc patch) to Data.Map which add the ability to lookup entries by proximity. For example, if I have a Map which relates times to the state of a system at that time: let m = Map.fromList [(1, x), (10, y), (15, z)] Then, if I want to find out the state at time 5: Map.nearestLesserOrEqual 5 m -> (1, x) In a similar fashion, nearestGreaterOrEqual and nearest are also provided. Thanks AGL Tue May 22 10:15:05 PDT 2007 agl@imperialviolet.org * Add proximal lookup functions in Map These functions require the key to be an instance of Num, because they use the numerical distance, |x-y|, to find elements in a map which are close to a query key. This is useful, for example, if the map is mapping times to state changes and you want to find out the state at any given time. Tue May 22 10:16:00 PDT 2007 agl@imperialviolet.org * Update deprecated Debug.QuickCheck name Tue May 22 10:16:28 PDT 2007 agl@imperialviolet.org * Add tests for proximal lookup functions -- Adam Langley agl@imperialviolet.org http://www.imperialviolet.org 650-283-9641