diff options
author | Joachim Breitner <mail@joachim-breitner.de> | 2022-10-08 11:12:36 +0200 |
---|---|---|
committer | Joachim Breitner <mail@joachim-breitner.de> | 2022-10-08 11:12:36 +0200 |
commit | c95e004b1221976e2685b39c309906379267f330 (patch) | |
tree | 30c2d0e24ed74f731fae8461497fa4938987279f | |
parent | d83a92e6b3ac4609fe0e1159ced59f12dcf622bc (diff) | |
download | haskell-wip/joachim/escapeJsonString.tar.gz |
Utils.JSON: do not escapeJsonString in ToJson String instancewip/joachim/escapeJsonString
as `escapeJsonString` is used in `renderJSON`, so the `JSString`
constructor is meant to carry the unescaped string.
-rw-r--r-- | compiler/GHC/Utils/Json.hs | 3 |
1 files changed, 2 insertions, 1 deletions
diff --git a/compiler/GHC/Utils/Json.hs b/compiler/GHC/Utils/Json.hs index 3654ccd8b7..acccc88658 100644 --- a/compiler/GHC/Utils/Json.hs +++ b/compiler/GHC/Utils/Json.hs @@ -14,6 +14,7 @@ data JsonDoc where JSBool :: Bool -> JsonDoc JSInt :: Int -> JsonDoc JSString :: String -> JsonDoc + -- ^ The 'String' is unescaped JSArray :: [JsonDoc] -> JsonDoc JSObject :: [(String, JsonDoc)] -> JsonDoc @@ -57,7 +58,7 @@ class ToJson a where json :: a -> JsonDoc instance ToJson String where - json = JSString . escapeJsonString + json = JSString instance ToJson Int where json = JSInt |