We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
import qualified Data.Text as T main = print $ T.filter (const undefined) $ T.filter (const False) $ T.singleton 'a'
Without optimizations, prints
""
With optimizations,
tfilter: Prelude.undefined CallStack (from HasCallStack): undefined, called at tfilter.hs:2:32 in main:Main
text/src/Data/Text.hs
Lines 1660 to 1663 in 456783a
text/src/Data/Text/Lazy.hs
Lines 1691 to 1694 in 456783a
The problem is that the predicate of the inner filter is not checked first.
The rule in the stream code is, however, correct
text/src/Data/Text/Internal/Fusion/Common.hs
Lines 1113 to 1116 in 456783a
The text was updated successfully, but these errors were encountered:
For the record, I happened to notice this in the code. I did not find this out the hard way.
Sorry, something went wrong.
Successfully merging a pull request may close this issue.
Without optimizations, prints
With optimizations,
text/src/Data/Text.hs
Lines 1660 to 1663 in 456783a
text/src/Data/Text/Lazy.hs
Lines 1691 to 1694 in 456783a
The problem is that the predicate of the inner filter is not checked first.
The rule in the stream code is, however, correct
text/src/Data/Text/Internal/Fusion/Common.hs
Lines 1113 to 1116 in 456783a
The text was updated successfully, but these errors were encountered: