Skip to content
Open
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
25 changes: 25 additions & 0 deletions changelog.md
Original file line number Diff line number Diff line change
@@ -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)
Expand Down
12 changes: 11 additions & 1 deletion src/Data/Text.hs
Original file line number Diff line number Diff line change
Expand Up @@ -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))

Expand Down Expand Up @@ -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:
--
Expand Down Expand Up @@ -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",""]
--
Expand Down Expand Up @@ -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

Expand Down
6 changes: 6 additions & 0 deletions src/Data/Text/Lazy.hs
Original file line number Diff line number Diff line change
Expand Up @@ -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"
Expand Down Expand Up @@ -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",""]
--
Expand Down Expand Up @@ -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
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.4
version: 2.1.5

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