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
163163toNumber :: Json -> Maybe Number
164164toNumber = toJsonType caseJsonNumber
165165
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`.
167168toString :: Json -> Maybe String
168169toString = toJsonType caseJsonString
169170
@@ -230,7 +231,8 @@ jsonSingletonArray j = fromArray [j]
230231jsonSingletonObject :: String -> Json -> Json
231232jsonSingletonObject key val = fromObject (Obj .singleton key val)
232233
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`.
234236foreign import stringify :: Json -> String
235237
236238foreign import _caseJson
Original file line number Diff line number Diff line change @@ -7,5 +7,6 @@ import Data.Function.Uncurried (Fn3, runFn3)
77foreign import _jsonParser :: forall a . Fn3 (String -> a ) (Json -> a ) String a
88
99-- | Parse a JSON string, constructing the `Json` value described by the string.
10+ -- | To convert a string into a `Json` string, see `fromString`.
1011jsonParser :: String -> Either String Json
1112jsonParser j = runFn3 _jsonParser Left Right j
You can’t perform that action at this time.
0 commit comments