sorted_set
sorted_set copied to clipboard
Get subset by range
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})