Find any shortest matching prefix function
Status: Beta
Brought to you by:
igor_chalenko
Is it possible with HAMT, to *efficiently* find
any item, which has the shortest possible partial
key match.
Example:
(just ignoring the data being stored, and
examining the behaviour with respect to the keys):
With stored Keys:
"abc"
"abcde"
"abcdf"
findAnyShortestPrefix("ab") -> "abc"
findAnyShortestPrefix("abcd") -> "abcde" OR "abcde"
(either would be ok)
findAnyShortestPrefix("abcde") -> "abcde"
Thanks for a great package :-)