Skip to content
New issue

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

Prepare text-2.1.1 release #561

Merged
merged 3 commits into from
Feb 15, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
15 changes: 15 additions & 0 deletions changelog.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,18 @@
### 2.1.1

* Add pure Haskell implementations as an alternative to C-based ones,
suitable for JavaScript backend.

* [Add type synonyms for lazy and strict text flavours](https://github.com/haskell/text/pull/547)

* [Share empty `Text` values](https://github.com/haskell/text/pull/493)

* [Fix bug in `isValidUtf8ByteArray`](https://github.com/haskell/text/pull/553)

* [Optimize the implementation of `Data.Text.concat`](https://github.com/haskell/text/pull/551)

* [Fix `filter/filter` rules for `Text` and lazy `Text`](https://github.com/haskell/text/pull/560)

### 2.1

* [Switch `Data.Text.Array` to `Data.Array.Byte`](https://github.com/haskell/text/pull/474)
Expand Down
6 changes: 4 additions & 2 deletions src/Data/Text/Internal/Encoding.hs
Original file line number Diff line number Diff line change
Expand Up @@ -244,8 +244,10 @@ validateUtf8Chunk bs = validateUtf8ChunkFrom 0 bs (,)
{-# INLINE validateUtf8ChunkFrom #-}
validateUtf8ChunkFrom :: forall r. Int -> ByteString -> (Int -> Maybe Utf8State -> r) -> r
validateUtf8ChunkFrom ofs bs k
-- B.isValidUtf8 is buggy before bytestring-0.11.5.0
#if defined(SIMDUTF) || MIN_VERSION_bytestring(0,11,5)
-- B.isValidUtf8 is buggy before bytestring-0.11.5.3 / bytestring-0.12.1.0.
-- MIN_VERSION_bytestring does not allow us to differentiate
-- between 0.11.5.2 and 0.11.5.3 so no choice except demanding 0.12.1+.
#if defined(SIMDUTF) || MIN_VERSION_bytestring(0,12,1)
| guessUtf8Boundary > 0 &&
-- the rest of the bytestring is valid utf-8 up to the boundary
(
Expand Down
5 changes: 4 additions & 1 deletion src/Data/Text/Internal/Validate.hs
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,7 @@
import Data.Text.Internal.Unsafe (unsafeWithForeignPtr)
import Data.Text.Internal.Validate.Simd (c_is_valid_utf8_bytearray_safe,c_is_valid_utf8_bytearray_unsafe,c_is_valid_utf8_ptr_unsafe)
#else
import qualified Data.ByteString as B

Check warning on line 40 in src/Data/Text/Internal/Validate.hs

View workflow job for this annotation

GitHub Actions / build (ubuntu-latest, latest)

The qualified import of ‘Data.ByteString’ is redundant

Check warning on line 40 in src/Data/Text/Internal/Validate.hs

View workflow job for this annotation

GitHub Actions / build (windows-latest, latest)

The qualified import of ‘Data.ByteString’ is redundant

Check warning on line 40 in src/Data/Text/Internal/Validate.hs

View workflow job for this annotation

GitHub Actions / build (windows-latest, latest)

The qualified import of ‘Data.ByteString’ is redundant
import qualified Data.Text.Internal.Validate.Native as N
#endif

Expand All @@ -47,7 +47,10 @@
isValidUtf8ByteString bs = withBS bs $ \fp len -> unsafeDupablePerformIO $
unsafeWithForeignPtr fp $ \ptr -> (/= 0) <$> c_is_valid_utf8_ptr_unsafe ptr (fromIntegral len)
#else
#if MIN_VERSION_bytestring(0,11,2)
-- B.isValidUtf8 is buggy before bytestring-0.11.5.3 / bytestring-0.12.1.0.
-- MIN_VERSION_bytestring does not allow us to differentiate
-- between 0.11.5.2 and 0.11.5.3 so no choice except demanding 0.12.1+.
#if MIN_VERSION_bytestring(0,12,1)
isValidUtf8ByteString = B.isValidUtf8
#else
isValidUtf8ByteString = N.isValidUtf8ByteStringHaskell
Expand Down
2 changes: 1 addition & 1 deletion text.cabal
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
cabal-version: 2.2
name: text
version: 2.1
version: 2.1.1

homepage: https://github.com/haskell/text
bug-reports: https://github.com/haskell/text/issues
Expand Down
Loading