-
Notifications
You must be signed in to change notification settings - Fork 145
Open
Labels
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.)