Module

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.

#Json Source

data Json :: Type

The type of JSON data. The underlying representation is the same as what would be returned from JavaScript's JSON.parse function; that is, ordinary JavaScript booleans, strings, arrays, objects, etc.

Instances

#caseJson Source

caseJson :: forall a. (Unit -> a) -> (Boolean -> a) -> (Number -> a) -> (String -> a) -> (Array Json -> a) -> (Object Json -> a) -> Json -> a

Case analysis for Json values. See the README for more information.

#caseJsonNull Source

caseJsonNull :: forall a. a -> (Unit -> a) -> Json -> a

A 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 -> a

A 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 -> a

A 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 -> a

A 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 -> a

A 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 -> a

A simpler version of caseJson which accepts a callback for when the Json argument was an Object, and a default value for all other cases.

#isBoolean Source

#fromBoolean Source

#fromNumber Source

#fromString Source

#jsonNull Source

#jsonTrue Source

#jsonFalse Source

#jsonZero Source

#jsonEmptyString Source

#jsonEmptyArray Source

#jsonSingletonArray Source

#jsonEmptyObject Source

#jsonSingletonObject Source

#stringify Source