text 1.2.1.2 → 1.2.1.3
raw patch · 5 files changed
+40/−6 lines, 5 files
Files
- Data/Text/Show.hs +4/−4
- changelog.md +8/−0
- tests/LiteralRuleTest.hs +21/−0
- tests/Makefile +6/−1
- text.cabal +1/−1
Data/Text/Show.hs view
@@ -50,19 +50,19 @@ unpackCString# addr# = unstream (S.streamCString# addr#) {-# NOINLINE unpackCString# #-} -{-# RULES "TEXT literal" [2] forall a.+{-# RULES "TEXT literal" [1] forall a. unstream (S.map safe (S.streamList (GHC.unpackCString# a))) = unpackCString# a #-} -{-# RULES "TEXT literal UTF8" [2] forall a.+{-# RULES "TEXT literal UTF8" [1] forall a. unstream (S.map safe (S.streamList (GHC.unpackCStringUtf8# a))) = unpackCString# a #-} -{-# RULES "TEXT empty literal" [2]+{-# RULES "TEXT empty literal" [1] unstream (S.map safe (S.streamList [])) = empty_ #-} -{-# RULES "TEXT singleton literal" [2] forall a.+{-# RULES "TEXT singleton literal" [1] forall a. unstream (S.map safe (S.streamList [a])) = singleton_ a #-}
changelog.md view
@@ -1,3 +1,11 @@+1.2.1.3++* Bug fix: As it turns out, moving the literal rewrite rules to simplifier + phase 2 does not prevent competition with the `unpack` rule, which is+ also active in this phase. Unfortunately this was hidden due to a silly+ test environment mistake. Moving literal rules back to phase 1 finally+ fixes GHC Trac #10528 correctly.+ 1.2.1.2 * Bug fix: Run literal rewrite rules in simplifier phase 2.
+ tests/LiteralRuleTest.hs view
@@ -0,0 +1,21 @@+{-# LANGUAGE OverloadedStrings #-}++module LiteralRuleTest where++import Data.Text (Text)++-- This should produce 8 firings of the "TEXT literal" rule+strings :: [Text]+strings = [ "abstime", "aclitem", "bit", "bool", "box", "bpchar", "bytea", "char" ]++-- This should produce 7 firings of the "TEXT literal UTF8" rule+utf8Strings :: [Text]+utf8Strings = [ "\0abstime", "\0aclitem", "\xfefe bit", "\0bool", "\0box", "\0bpchar", "\0bytea" ]++-- This should produce 4 firings of the "TEXT empty literal" rule+empties :: [Text]+empties = [ "", "", "", "" ]++-- This should produce 5 firings of the "TEXT empty literal" rule+--singletons :: [Text]+--singletons = [ "a", "b", "c", "d", "e" ]
tests/Makefile view
@@ -1,5 +1,10 @@ count = 1000 +all: coverage literal-rule-test++literal-rule-test:+ ./literal-rule-test.sh+ coverage: build coverage/hpc_index.html build: text-test-data@@ -32,4 +37,4 @@ clean: rm -rf dist coverage .hpc -.PHONY: build coverage+.PHONY: build coverage all literal-rule-test
text.cabal view
@@ -1,5 +1,5 @@ name: text-version: 1.2.1.2+version: 1.2.1.3 homepage: https://github.com/bos/text bug-reports: https://github.com/bos/text/issues synopsis: An efficient packed Unicode text type.