Closed mroch closed 1 year ago
I'd like List.take t n to return t when n >= List.length t. then I can tell if any were dropped if t != t'.
List.take t n
t
n >= List.length t
t != t'
right now, it does when n > List.length t:
n > List.length t
https://github.com/janestreet/base/blob/041bbbba50cf25a35c14e7c042ba4fe33521851e/src/list.ml#L1430
but it unnecessarily clones when the length is exactly n.
n
it'd be great to mention this in the docs so it's part of the public API :)
Done!
I'd like
List.take t n
to returnt
whenn >= List.length t
. then I can tell if any were dropped ift != t'
.right now, it does when
n > List.length t
:https://github.com/janestreet/base/blob/041bbbba50cf25a35c14e7c042ba4fe33521851e/src/list.ml#L1430
but it unnecessarily clones when the length is exactly
n
.it'd be great to mention this in the docs so it's part of the public API :)