File tree Expand file tree Collapse file tree 2 files changed +5
-2
lines changed Expand file tree Collapse file tree 2 files changed +5
-2
lines changed Original file line number Diff line number Diff line change @@ -163,7 +163,8 @@ toBoolean = toJsonType caseJsonBoolean
163
163
toNumber :: Json -> Maybe Number
164
164
toNumber = toJsonType caseJsonNumber
165
165
166
- -- | Convert `Json` to a `String` value, if the `Json` is a string.
166
+ -- | Convert `Json` to a `String` value, if the `Json` is a string. To write a
167
+ -- | `Json` value to a JSON string, see `stringify`.
167
168
toString :: Json -> Maybe String
168
169
toString = toJsonType caseJsonString
169
170
@@ -230,7 +231,8 @@ jsonSingletonArray j = fromArray [j]
230
231
jsonSingletonObject :: String -> Json -> Json
231
232
jsonSingletonObject key val = fromObject (Obj .singleton key val)
232
233
233
- -- | Converts a `Json` value to a JSON string.
234
+ -- | Converts a `Json` value to a JSON string. To retrieve a string from a `Json`
235
+ -- | string value, see `fromString`.
234
236
foreign import stringify :: Json -> String
235
237
236
238
foreign import _caseJson
Original file line number Diff line number Diff line change @@ -7,5 +7,6 @@ import Data.Function.Uncurried (Fn3, runFn3)
7
7
foreign import _jsonParser :: forall a . Fn3 (String -> a ) (Json -> a ) String a
8
8
9
9
-- | Parse a JSON string, constructing the `Json` value described by the string.
10
+ -- | To convert a string into a `Json` string, see `fromString`.
10
11
jsonParser :: String -> Either String Json
11
12
jsonParser j = runFn3 _jsonParser Left Right j
You can’t perform that action at this time.
0 commit comments