racket-collections icon indicating copy to clipboard operation
racket-collections copied to clipboard

Some APIs could encode more finiteness information in their results

Open countvajhula opened this issue 2 years ago • 0 comments

Some APIs do not return known-finite results even when such an inference could reliably be made. These in particular:

rest
take
drop
filter
map
reverse

In the seq library, these APIs are overridden with ones that annotate the result with finiteness information based on whether the input is known-finite or not. I did this purely for expediency as I was fleshing out the interfaces in that library, but it's very likely that these changes would be better incorporated upstream in data/collection, since otherwise, in order to use these libraries together, you need to:

(require (except-in data/collection rest take drop ...)
         seq)

instead of just

(require data/collection seq)

countvajhula avatar Mar 29 '22 00:03 countvajhula