Rewrite rules for Lazy.compareLength are too lazy
- Dominant language
- Haskell
- Stars
- 301
- Forks
- 144
- Avg merge
- 7d 22h
- Merged PRs (30d)
- 1
Description
`Lazy.length s` must force the entirety of `s`, while (by design) `Lazy.compareLength s 10` stops after finding at least 11 words. And yet we try to rewrite `Lazy.length s > 10` to `Lazy.compareLength s 10 == GT`. I can't quickly think of any "reasonable-looking" example where this change will actually cause problems, but I am deeply skeptical of a rewrite rule that silently changes strictness behavior in this way, especially since it is common for forcing a lazy bytestring to mean performing deferred I/O actions.
(Also, `Int64` overflow can happen in `Lazy.length` but not in `Lazy.compareLength`, though it's probably only possible to actually observe that difference in behavior by doing something rather stupid.)
Contributor guide
No contributing guide indexed for this repository
Assessment
This issue has not been assessed yet.