Bounds checking in array functions
- Dominant language
- Haskell
- Stars
- 123
- Forks
- 60
- PR merge metrics
- No merged PRs in 30d
Description
We discovered today that array functions do not do bounds checking, which was surprising to us. The expectation was that unless the function is prefixed with "unsafe" it's supposed to do bounds checking.
After discovering this I checked the haddocks, but there's literally no mention to bounds checking in any of the array modules or at the top level. At the very least we should mention in bold letters that the array modules do not do bounds checking, and are completely unsafe.
For long-time primitive users and maintainers this is probably obvious, but it's far from being obvious from a user's point of view.
I realize that it's hard to change this behavior now, so perhaps we should just update the documentation. Ideally it'd be great to have `writeArray` that does bounds checking, and `unsafeWriteArray` that omits it though.
Contributor guide
No contributing guide indexed for this repository
Assessment
This issue has not been assessed yet.