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
-- check invariants valid :: Text -> Bool
For strict text it would check that array is big enough to have offset+length, and that the slice is valid utf8.
For lazy text it would check the above, and chunk invariants.
These functions would be very useful (in writing tests) when one tinkers with internals. (Either in text itself, or other packages).
text
There are strictInvariant and lazyVariant for lazy text, but they error. Not entirely, but almost useless in tests.
strictInvariant
lazyVariant
error
The text was updated successfully, but these errors were encountered:
I'd prefer isValid, but otherwise I'm in favor of this.
isValid
Sorry, something went wrong.
valid is inspired by the name in containers. Whatever works.
valid
containers
Also: https://hackage.haskell.org/package/perhaps-0/docs/Data-Perhaps.html is one nice way to combine error messages with Bool. (That would be great, but not worth dependency, just FYI).
Bool
No branches or pull requests
For strict text it would check that array is big enough to have offset+length, and that the slice is valid utf8.
For lazy text it would check the above, and chunk invariants.
These functions would be very useful (in writing tests) when one tinkers with internals. (Either in
text
itself, or other packages).There are
strictInvariant
andlazyVariant
for lazy text, but theyerror
. Not entirely, but almost useless in tests.The text was updated successfully, but these errors were encountered: