From 5293f728648a2c9cb2daf402b48c51bb37a07593 Mon Sep 17 00:00:00 2001 From: Li-yao Xia Date: Sun, 22 Nov 2026 22:03:39 +0100 Subject: [PATCH 1/2] doc: Add `@since` 2.1.5 --- src/Data/Text.hs | 12 +++++++++++- src/Data/Text/Lazy.hs | 6 ++++++ 2 files changed, 17 insertions(+), 1 deletion(-) diff --git a/src/Data/Text.hs b/src/Data/Text.hs index 6f50e15b..a3401dcf 100644 --- a/src/Data/Text.hs +++ b/src/Data/Text.hs @@ -1682,6 +1682,10 @@ break p = span (not . p) break (`eqChar` c) = breakOn (singleton c) #-} +-- | Split a @t@ into a pair @(t1, t2)@ where @t2@ is the longest suffix of @t@ +-- whose characters satisfy the given predicate. +-- +-- @since 2.1.5 spanEnd :: (Char -> Bool) -> Text -> (Text, Text) spanEnd = coerce (spanEndM :: (Char -> Identity Bool) -> Text -> Identity (Text, Text)) @@ -1859,7 +1863,9 @@ splitOn pat #-} -- | Similar to 'splitOn', except that it returns @'NonEmpty' 'Text'@ instead --- of @['Text']@.. +-- of @['Text']@. +-- +-- @since 2.1.5 -- -- Examples: -- @@ -1915,6 +1921,8 @@ split p = NonEmptyList.toList . splitNE p -- | Similar to 'split', except that it returns @'NonEmpty' 'Text'@ instead of -- @['Text']@. -- +-- @since 2.1.5 +-- -- >>> splitNE (=='a') "aabbaca" -- "" :| ["","bb","c",""] -- @@ -2412,6 +2420,8 @@ word8ToInt8 :: Word8 -> Int8 word8ToInt8 = P.fromIntegral -- | Synonym of 'pack' for the sake of @{-# LANGUAGE QualifiedStrings #-}@. +-- +-- @since 2.1.5 fromString :: String -> Text fromString = pack diff --git a/src/Data/Text/Lazy.hs b/src/Data/Text/Lazy.hs index 71e6e77c..0b6e9437 100644 --- a/src/Data/Text/Lazy.hs +++ b/src/Data/Text/Lazy.hs @@ -1664,6 +1664,8 @@ splitOn pat -- | Similar to 'splitOn', except that it returns @'NonEmpty' 'Text'@ instead -- of @['Text']@. -- +-- @since 2.1.5 +-- -- Examples: -- -- >>> splitOnNE "\r\n" "a\r\nb\r\nd\r\ne" @@ -1719,6 +1721,8 @@ split p = NE.toList . splitNE p -- | Similar to 'split', except that it returns @'NonEmpty' 'Text'@ instead of -- @['Text']@. -- +-- @since 2.1.5 +-- -- >>> splitNE (=='a') "aabbaca" -- "" :| ["","bb","c",""] -- @@ -2038,5 +2042,7 @@ int64ToInt :: Int64 -> Exts.Int int64ToInt = fromIntegral -- | Synonym of 'pack' for the sake of @{-# LANGUAGE QualifiedStrings #-}@. +-- +-- @since 2.1.5 fromString :: String -> Text fromString = pack From 649b10fa8c9bd4bda51de938c2b0df63b856fcc5 Mon Sep 17 00:00:00 2001 From: Li-yao Xia Date: Sun, 22 Nov 2026 21:54:09 +0100 Subject: [PATCH 2/2] Release text 2.1.5 --- changelog.md | 25 +++++++++++++++++++++++++ text.cabal | 2 +- 2 files changed, 26 insertions(+), 1 deletion(-) diff --git a/changelog.md b/changelog.md index 11b5f666..60d24e9a 100644 --- a/changelog.md +++ b/changelog.md @@ -1,3 +1,28 @@ +### 2.1.5 - 2026-11-23 + +* [Update case mappings to Unicode 18.0](https://github.com/haskell/text/pull/708) + +Additions + +* [Add `splitNE` and `splitOnNE` that return `NonEmpty`](https://github.com/haskell/text/pull/711) +* [Add `fromString = pack` to work with upcoming `QualifiedStrings`](https://github.com/haskell/text/pull/709) +* Add `spanEnd` ([strict](https://github.com/haskell/text/pull/701), [lazy](https://github.com/haskell/text/pull/724)) +* [Export `decimalInteger` and `hexadecimalInteger`, and improve performance of printing big integers](https://github.com/haskell/text/pull/716) + +Fixes + +* [Fix lazy `toTitle` to not consider chunk boundaries as word boundaris](https://github.com/haskell/text/pull/722) +* [Fix `hGetContents` to close handle on exception](https://github.com/haskell/text/pull/718) +* [Fix `readFile` to close handle on exception](https://github.com/haskell/text/pull/714) +* [Make `iter` return 1 on continuation bytes](https://github.com/haskell/text/pull/705) +* [Preserve exception contexts when rethrowing exceptions in `Handle` reads](https://github.com/haskell/text/pull/719) + +Performance improvements + +* [Improve performance of parsing big integers](https://github.com/haskell/text/pull/717) +* [Improve performance of `indices` using `memchr`](https://github.com/haskell/text/pull/702) +* [Add RULES for `break`, `takeWhile`, `dropWhile` on single character](https://github.com/haskell/text/pull/707) + ### 2.1.4 - 2026-01-27 * [Upgrade to Unicode 17.0](https://github.com/haskell/text/pull/658) + [Fix `CaseMapping` generation script to not depend on GHC's Unicode data](https://github.com/haskell/text/pull/687) diff --git a/text.cabal b/text.cabal index d9057701..a2f55f9f 100644 --- a/text.cabal +++ b/text.cabal @@ -1,6 +1,6 @@ cabal-version: 2.2 name: text -version: 2.1.4 +version: 2.1.5 homepage: https://github.com/haskell/text bug-reports: https://github.com/haskell/text/issues