unicode-transforms 0.3.8 → 0.4.0
raw patch · 6 files changed
+43/−27 lines, 6 filesdep −getopt-genericsdep ~basedep ~ghc-primdep ~text
Dependencies removed: getopt-generics
Dependency ranges changed: base, ghc-prim, text, unicode-data
Files
- Changelog.md +7/−0
- Data/Unicode/Internal/NormalizeStream.hs +14/−4
- README.md +1/−1
- download-ucd-files.sh +2/−2
- test/data/NormalizationTest.txt too large to diff
- unicode-transforms.cabal +19/−20
Changelog.md view
@@ -1,3 +1,10 @@+## 0.4.0 (November 2021)++* Bump `unicode-data` to `0.2`+* Allow `text 2.0`+* Update to Unicode version 14.0.0+* Drop support for GHC 7.10+ ## 0.3.8 * Allow ghc-prim 0.7
Data/Unicode/Internal/NormalizeStream.hs view
@@ -1,5 +1,6 @@ {-# OPTIONS_GHC -funbox-strict-fields #-} {-# LANGUAGE BangPatterns #-}+{-# LANGUAGE CPP #-} {-# LANGUAGE LambdaCase #-} {-# LANGUAGE TupleSections #-} -- |@@ -22,7 +23,6 @@ ) where -import Data.Bits (shiftR) import Data.Char (chr, ord) import GHC.ST (ST(..)) import GHC.Types (SPEC(..))@@ -30,13 +30,21 @@ import qualified Data.Text.Array as A import qualified Unicode.Char as UC +#if MIN_VERSION_text(2,0,0)+import Data.Text.Internal.Fusion (stream)+#else+import Data.Bits (shiftR)+import Data.Text.Internal.Unsafe.Char (unsafeChr)+import Data.Text.Internal.Fusion.Size (betweenSize)+import Data.Text.Internal.Encoding.Utf16 (chr2)+#endif+ -- Internal modules import Data.Text.Internal (Text(..))-import Data.Text.Internal.Fusion.Size (betweenSize, upperBound)+import Data.Text.Internal.Fusion.Size (upperBound) import Data.Text.Internal.Fusion.Types (Step(..), Stream(..)) import Data.Text.Internal.Private (runText)-import Data.Text.Internal.Unsafe.Char (unsafeChr, unsafeWrite)-import Data.Text.Internal.Encoding.Utf16 (chr2)+import Data.Text.Internal.Unsafe.Char (unsafeWrite) ------------------------------------------------------------------------------- -- Reorder buffer to hold characters till the next starter boundary@@ -142,6 +150,7 @@ n <- unsafeWrite arr j c return (j + n, Empty) +#if !MIN_VERSION_text(2,0,0) -- | /O(n)/ Convert a 'Text' into a 'Stream Char'. stream :: Text -> Stream Char stream (Text arr off len) = Stream next off (betweenSize (len `shiftR` 1) len)@@ -158,6 +167,7 @@ n = A.unsafeIndex arr i n2 = A.unsafeIndex arr (i + 1) {-# INLINE [0] stream #-}+#endif -- | /O(n)/ Convert a 'Stream Char' into a decompose-normalized 'Text'. unstream :: UC.DecomposeMode -> Stream Char -> Text
README.md view
@@ -5,7 +5,7 @@ [](https://ci.appveyor.com/project/harendra-kumar/unicode-transforms) [](https://coveralls.io/github/composewell/unicode-transforms?branch=master) -Fast Unicode 13.0.0 normalization in Haskell (NFC, NFKC, NFD, NFKD).+Fast Unicode 14.0.0 normalization in Haskell (NFC, NFKC, NFD, NFKD). ## What is normalization?
download-ucd-files.sh view
@@ -4,11 +4,11 @@ # we used to generate them earlier are exactly the same as the ones we are # downloading. To ensure that verfication of the checksum is necessary. -VERSION=13.0.0+VERSION=14.0.0 SRC_FILE="https://www.unicode.org/Public/$VERSION/ucd/NormalizationTest.txt" DST_FILE="test/data/NormalizationTest.txt"-SRC_FILE_CKSUM="d60ee55dd9169444652e48d337109cc814ecc59a9d3122eedddf7de388f2e01d"+SRC_FILE_CKSUM="7cb30cc2abe6c29c292b99095865d379ce1213045c78c4ff59c7e9391bbe2331" # Download the file
test/data/NormalizationTest.txt view
file too large to diff
unicode-transforms.cabal view
@@ -1,9 +1,9 @@ cabal-version: 2.2 name: unicode-transforms-version: 0.3.8+version: 0.4.0 synopsis: Unicode normalization-description: Fast Unicode 13.0.0 normalization in Haskell (NFC, NFKC, NFD, NFKD).+description: Fast Unicode 14.0.0 normalization in Haskell (NFC, NFKC, NFD, NFKD). category: Data,Text,Unicode stability: Experimental homepage: http://github.com/composewell/unicode-transforms@@ -14,14 +14,14 @@ 2014–2015 Antonio Nikishaev license: BSD-3-Clause license-file: LICENSE-tested-with: GHC==7.10.3- , GHC==8.0.2+tested-with: GHC==8.0.2 , GHC==8.2.2 , GHC==8.4.4 , GHC==8.6.5 , GHC==8.8.4- , GHC==8.10.3+ , GHC==8.10.7 , GHC==9.0.1+ , GHC==9.2.1 build-type: Simple extra-source-files: Changelog.md@@ -82,14 +82,14 @@ hs-source-dirs: . ghc-options: -Wall -fwarn-identities -fwarn-incomplete-record-updates -fwarn-incomplete-uni-patterns -fwarn-tabs build-depends:- base >=4.8 && <5- , unicode-data >= 0.1 && <0.2- , bytestring >=0.9 && <0.12- , ghc-prim >= 0.2 && < 0.8+ base >= 4.8 && < 5+ , unicode-data >= 0.2 && < 0.3+ , bytestring >= 0.9 && < 0.12+ , ghc-prim >= 0.2 && < 0.9 -- We depend on a lot of internal modules in text. We keep the upper bound -- inclusive of the latest stable version.- , text >= 1.1.1 && <= 1.2.4.1+ , text >=1.1.1 && <=1.2.5.0 || >=2.0 && <2.1 if flag(dev) ghc-options: -O0 else@@ -110,7 +110,7 @@ QuickCheck >=2.1 && <2.15 , base >=4.7 && <5 , deepseq >=1.1 && <1.5- , text >=1.1.1 && <1.3+ , text , unicode-transforms if flag(dev) ghc-options: -O0@@ -129,12 +129,12 @@ test ghc-options: -Wall -fwarn-identities -fwarn-incomplete-record-updates -fwarn-incomplete-uni-patterns -fwarn-tabs build-depends:- QuickCheck >=2.1 && <2.15- , unicode-data >= 0.1 && <0.2- , base >=4.7 && <5- , deepseq >=1.1 && <1.5- , hspec >= 2.0 && < 3- , text >=1.1.1 && <1.3+ QuickCheck >= 2.1 && < 2.15+ , unicode-data >= 0.2 && < 0.3+ , base >= 4.7 && < 5+ , deepseq >= 1.1 && < 1.5+ , hspec >= 2.0 && < 3+ , text , unicode-transforms if flag(dev) ghc-options: -O0@@ -156,9 +156,8 @@ ghc-options: -Wall -fwarn-identities -fwarn-incomplete-record-updates -fwarn-incomplete-uni-patterns -fwarn-tabs build-depends: base >=4.7 && <5- , getopt-generics >=0.11 && <0.14 , split >=0.1 && <0.3- , text >=1.1.1 && <1.3+ , text , unicode-transforms if flag(dev) ghc-options: -O0@@ -180,7 +179,7 @@ , filepath >=1.0 && <2 , path >=0.0.0 && <0.9 , path-io >=0.1.0 && <1.7- , text >=1.1.1 && <1.3+ , text , unicode-transforms if flag(use-gauge) build-depends: gauge >=0.2.0 && <0.3