
On Mon, 4 Oct 2021, PICCA Frederic-Emmanuel wrote:
Set Int is not lazy. [Int] is lazy, but it is inefficient for eliminating duplicates. IntSet is also strict, but internally it is almost a bit vector, i.e. storage efficient. If the ranges are really large, then you might need data-interval&friends. However, a list of numbers of image files might not be that large, and IntSet will probably be a good choice.
We have 100 files with 3000 images.
300000 * 4 bytes = 1.2 M
is it that big ?
I am afraid, I still do not understand where you need the list of Ranges. In the original post you said, you want to parse a list of ranges like the one for pages to print in a printer dialog. Is it to select files from the 100 ones or is it to select images from the 300,000 ones? In the first case I would use IntMap, in the latter case I would use Interval data structures.