Module

Data.Argonaut

Package
purescript-argonaut
Repository
purescript-contrib/purescript-argonaut

Re-exports from Data.Argonaut.Core

#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

#JString Source

type JString = String

A String value inside some JSON data. Note that this type is exactly the same as the primitive String type; this synonym acts only to help indicate intent.

#JObject Source

type JObject = StrMap Json

A JSON object; a JavaScript object containing Json values.

#JNumber Source

type JNumber = Number

A Number value inside some JSON data. Note that this type is exactly the same as the primitive Number type; this synonym acts only to help indicate intent.

#JNull Source

data JNull :: Type

The type of null values inside JSON data. There is exactly one value of this type: in JavaScript, it is written null. This module exports this value as jsonNull.

Instances

#JBoolean Source

type JBoolean = Boolean

A Boolean value inside some JSON data. Note that this type is exactly the same as the primitive Boolean type; this synonym acts only to help indicate intent.

#JArray Source

type JArray = Array Json

A JSON array; an array containing Json values.

#jsonZero Source

#jsonTrue Source

#jsonSingletonObject Source

#jsonSingletonArray Source

#jsonNull Source

#jsonFalse Source

#jsonEmptyObject Source

#jsonEmptyArray Source

#isBoolean Source

#fromString Source

#fromObject Source

#fromNumber Source

#fromNull Source

#fromBoolean Source

#fromArray Source

#foldJsonString Source

foldJsonString :: forall a. a -> (JString -> a) -> Json -> a

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

#foldJsonObject Source

foldJsonObject :: forall a. a -> (JObject -> a) -> Json -> a

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

#foldJsonNumber Source

foldJsonNumber :: forall a. a -> (JNumber -> a) -> Json -> a

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

#foldJsonNull Source

foldJsonNull :: forall a. a -> (JNull -> a) -> Json -> a

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

#foldJsonBoolean Source

foldJsonBoolean :: forall a. a -> (JBoolean -> a) -> Json -> a

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

#foldJsonArray Source

foldJsonArray :: forall a. a -> (JArray -> a) -> Json -> a

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

#foldJson Source

foldJson :: forall a. (JNull -> a) -> (JBoolean -> a) -> (JNumber -> a) -> (JString -> a) -> (JArray -> a) -> (JObject -> a) -> Json -> a

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

Re-exports from Data.Argonaut.Decode

#getField Source

getField :: forall a. DecodeJson a => JObject -> String -> Either String a

#(.?) Source

Operator alias for Data.Argonaut.Decode.Combinators.getField (non-associative / precedence 7)

Re-exports from Data.Argonaut.Encode

#extend Source

extend :: forall a. EncodeJson a => JAssoc -> a -> Json

The named implementation of the (~>) operator.

#assoc Source

assoc :: forall a. EncodeJson a => String -> a -> JAssoc

The named implementation of the (:=) operator.

#(~>) Source

Operator alias for Data.Argonaut.Encode.Combinators.extend (right-associative / precedence 6)

Extends a Json object with a JAssoc property.

#(:=) Source

Operator alias for Data.Argonaut.Encode.Combinators.assoc (non-associative / precedence 7)

Creates a JAssoc entry, representing a key/value pair for an object.

Re-exports from Data.Argonaut.JCursor

#JsonPrim Source

newtype JsonPrim

Constructors

Instances

#runJsonPrim Source

runJsonPrim :: JsonPrim -> (forall a. (JNull -> a) -> (JBoolean -> a) -> (JNumber -> a) -> (JString -> a) -> a)

#inferEmpty Source

#fail Source

fail :: forall b a. Show a => a -> Either String b

#downIndex Source

#cursorSet Source

Re-exports from Data.Argonaut.Parser

Re-exports from Data.Argonaut.Prisms

Re-exports from Data.Argonaut.Traversals

Modules
Data.Argonaut