Data.Argonaut.Core
- Package
- purescript-argonaut-core
- Repository
- purescript-contrib/purescript-argonaut-core
This module defines a data type and various functions for creating and manipulating JSON values. The README contains additional documentation for this module.
#caseJsonNull Source
caseJsonNull :: forall a. a -> (Unit -> a) -> Json -> aA simpler version of caseJson which accepts a callback for when the
Json argument was null, and a default value for all other cases.
#caseJsonBoolean Source
caseJsonBoolean :: forall a. a -> (Boolean -> a) -> Json -> aA simpler version of caseJson which accepts a callback for when the
Json argument was a Boolean, and a default value for all other cases.
#caseJsonNumber Source
caseJsonNumber :: forall a. a -> (Number -> a) -> Json -> aA simpler version of caseJson which accepts a callback for when the
Json argument was a Number, and a default value for all other cases.
#caseJsonString Source
caseJsonString :: forall a. a -> (String -> a) -> Json -> aA simpler version of caseJson which accepts a callback for when the
Json argument was a String, and a default value for all other cases.
#caseJsonArray Source
caseJsonArray :: forall a. a -> (Array Json -> a) -> Json -> aA simpler version of caseJson which accepts a callback for when the
Json argument was a Array Json, and a default value for all other cases.
#caseJsonObject Source
caseJsonObject :: forall a. a -> (Object Json -> a) -> Json -> aA simpler version of caseJson which accepts a callback for when the
Json argument was an Object, and a default value for all other cases.
#fromBoolean Source
fromBoolean :: Boolean -> JsonConstruct Json from a Boolean value
#fromNumber Source
fromNumber :: Number -> JsonConstruct Json from a Number value
#fromString Source
fromString :: String -> JsonConstruct the Json representation of a String value.
Note that this function only produces Json containing a single piece of String
data (similar to fromBoolean, fromNumber, etc.).
This function does NOT convert the String encoding of a JSON value to Json - For that
purpose, you'll need to use jsonParser.
#jsonEmptyString Source
jsonEmptyString :: JsonAn empty string represented as Json
#jsonEmptyArray Source
jsonEmptyArray :: JsonAn empty array represented as Json
#jsonSingletonArray Source
jsonSingletonArray :: Json -> JsonConstructs a Json array value containing only the provided value
#jsonEmptyObject Source
jsonEmptyObject :: JsonAn empty object represented as Json
#jsonSingletonObject Source
jsonSingletonObject :: String -> Json -> JsonConstructs a Json object value containing only the provided key and value
#stringifyWithIndent Source
stringifyWithIndent :: Int -> Json -> StringConverts a Json value to a JSON string.
The first Int argument specifies the amount of white space characters to use as indentation.
This number is capped at 10 (if it is greater, the value is just 10). Values less than 1 indicate that no space should be used.