haskell / haskell/text

Add valid functions

Open
#406 2 comments 0 reactions 0 assignees View on GitHub
feature request
Dominant language
Haskell
Stars
421
Forks
163
PR merge metrics
No merged PRs in 30d

Description

```haskell
-- 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).

There are `strictInvariant` and `lazyVariant` for lazy text, but they `error`. Not entirely, but almost useless in tests.

Contributor guide

No contributing guide indexed for this repository

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.