Skip to content

Commit 50aa717

Browse files
authored
Remove dollar operator to fix GHC 9.6 build
Also, stop building with GHC 9.4 in CI since this library no longer supports GHC 9.4.
1 parent 3ff36c9 commit 50aa717

File tree

3 files changed

+11
-12
lines changed

3 files changed

+11
-12
lines changed

CHANGELOG.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
# Revision history for json-syntax
22

3-
## 0.3.0.1 -- 2025-07-14
3+
## 0.3.0.2 -- 2025-07-14
44

55
* Switch from ShortText to Text. In many cases, this makes it possible for the
66
resulting Value to share the input byte array instead of allocating additional

json-syntax.cabal

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
cabal-version: 2.2
22
name: json-syntax
3-
version: 0.3.0.1
3+
version: 0.3.0.2
44
synopsis: High-performance JSON parser and encoder
55
description:
66
This library parses JSON into a @Value@ type that is consistent with the
@@ -28,7 +28,7 @@ extra-doc-files:
2828
CHANGELOG.md
2929
README.md
3030

31-
tested-with: GHC ==9.4.8 || ==9.6.3 || ==9.8.1
31+
tested-with: GHC ==9.6.3 || ==9.8.1
3232

3333
common build-settings
3434
default-language: Haskell2010

src/Json.hs

Lines changed: 8 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -83,7 +83,7 @@ import Control.Monad.ST (ST, runST)
8383
import Control.Monad.ST.Run (runSmallArrayST)
8484
import Control.Monad.Trans.Class (lift)
8585
import Control.Monad.Trans.Except (except, runExceptT)
86-
import Data.Bits (unsafeShiftR, (.&.), (.|.), xor)
86+
import Data.Bits (unsafeShiftR, (.&.), (.|.))
8787
import Data.Builder.ST (Builder)
8888
import Data.Bytes.Chunks (Chunks)
8989
import Data.Bytes.Parser (Parser)
@@ -94,12 +94,12 @@ import Data.Number.Scientific (Scientific)
9494
import Data.Primitive (Array, ByteArray (ByteArray), MutableByteArray, Prim, PrimArray, SmallArray)
9595
import Data.Text.Internal (Text(Text))
9696
import Data.Text.Short (ShortText)
97-
import GHC.Exts (Char (C#), Int (I#), chr#, gtWord#, ltWord#, word2Int#, minusWord#)
98-
import GHC.Exts (Int#, ByteArray#, word8ToWord#, word16ToWord#)
97+
import GHC.Exts (Char (C#), Int (I#), ltWord#, minusWord#)
98+
import GHC.Exts (Int#, ByteArray#, word8ToWord#)
9999
import GHC.Exts (RuntimeRep(IntRep,TupleRep,BoxedRep), Levity(Unlifted))
100100
import GHC.Exts (and#, xor#)
101101
import GHC.Int (Int16, Int32, Int64, Int8)
102-
import GHC.Word (Word16(W16#), Word32, Word64, Word8(W8#), Word(W#))
102+
import GHC.Word (Word16, Word32, Word64, Word8(W8#), Word(W#))
103103

104104
import qualified Data.Builder.ST as B
105105
import qualified Data.ByteString.Short.Internal as BSS
@@ -115,11 +115,9 @@ import qualified Data.List as List
115115
import qualified Data.Number.Scientific as SCI
116116
import qualified Data.Primitive as PM
117117
import qualified Data.Primitive.Contiguous as Contiguous
118-
import qualified Data.Text
119118
import qualified Data.Text.Short as TS
120119
import qualified Data.Text.Short.Unsafe as TS
121120
import qualified Prelude
122-
import qualified Data.Bytes.Parser.Rebindable as RB
123121

124122
{- | The JSON syntax tree described by the ABNF in RFC 7159. Notable
125123
design decisions include:
@@ -552,9 +550,10 @@ copyAndEscape# !maxLen =
552550
0x22 ->
553551
(P.effect (PM.unsafeFreezeByteArray =<< PM.resizeMutableByteArray dst ix))
554552
`P.bindFromLiftedToByteArrayIntInt` \str ->
555-
P.pureByteArrayIntInt $ case byteArrayToShortByteString str of
556-
BSS.SBS str' -> -- error ("Escaped string: " ++ Data.Text.unpack (Text (ByteArray str') 0 (I# ix#)))
557-
(# str', 0#, ix# #)
553+
P.pureByteArrayIntInt
554+
( case byteArrayToShortByteString str of
555+
BSS.SBS str' -> (# str', 0#, ix# #)
556+
)
558557
_ | theCharW >= 0x20, theCharW < 127 ->
559558
(P.effect (PM.writeByteArray dst ix theCharW))
560559
`P.bindFromLiftedToByteArrayIntInt` \_ ->

0 commit comments

Comments
 (0)