Ludwig.JSON

Module Members

check

(Function)

Example:

x: JSON.check('{"key": 123}') => Validation.Success
y: JSON.check('{"key: 123}') => Validation.Failure("invalid JSON")

Type Signature

 fun (String) -> Validation
Argument: s
Type: String
Returns:
Type: Validation

parse

(Function)

Type Signature

 fun (String) -> Optional<JSON>
Argument: s
Type: String
Returns:
Type: Optional<JSON>

stringify

(Function)

Type Signature

 fun (JSON) -> String
Argument: j
Type: JSON
Returns:
Type: String

JSON

(Type)

type JSON:
  | Object Dictionary<JSON>
  | Array List<JSON>
  | String String
  | Number Float
  | Bool Bool
  | Null

Array

(Constructor)

Argument:
Ludwig.List<JSON>

Bool

(Constructor)

Argument:
Ludwig.Bool

Null

(Constructor)

Number

(Constructor)

Argument:
Ludwig.Float

Object

(Constructor)

Argument:
Ludwig.Dictionary<JSON>

String

(Constructor)

Argument:
Ludwig.String