Why do the docs for List.len
say
One List can store up to 2,147,483,648 elements (just over 2 billion), which is exactly equal to the highest valid #I32 value. This means the #U32 this function returns can always be safely converted to an #I32 without losing any data.
I would've thought that, at least on a 64-bit machine, the maximum length would be closer to 2^63, and this expectation seems to be backed up by the design document for seamless slices. 2 billion items is very possible to reach by accident, so I don't think that limit would be a good choice for a correctness-oriented language like Roc
Docs are wrong unless you are on a 32bit system
yeah looks like there was a mistaken edit there
that part is true on 32-bit targets but not on 64-bit targets
so it should be updated!
Fixed in PR#6612 :)
Last updated: Jul 06 2025 at 12:14 UTC