sorted_set icon indicating copy to clipboard operation
sorted_set copied to clipboard

Get subset by range

Open tyre opened this issue 9 years ago • 1 comments

tyre avatar Jul 17 '15 16:07 tyre

The API could be:

def filter_range(set, min \\ nil, max \\ nil) -> list of members

I think filter is too similar to Enum.filter/2, one would expect it to take a function.

Also I think min and max should be inclusive by default; it may be specified explicitly with tuples: SortedSet.filter_range(set, {10, :exclusive}, {20, :inclusive})

flupke avatar Jul 17 '15 17:07 flupke