JSON encoder and decoder

Author(s): Jose F. Morales.

Stability: [devel] Currently the subject of active development and/or research. Functionality may be limited and API and/or functionality may change without warning or deprecation period. Not recommended yet for use in production.


This module defines a term representation for JSON (JavaScript Object Notation), as well as encoders and decoders.

Usage and interface

Documentation on exports

REGTYPEjson/1

Usage:

A JSON object.

json(json(Attrs)) :-
    json_attrs(Attrs).

    Usage:

    Attributes (pairs of key/value) of a JSON object.

    json_attrs([]).
    json_attrs([X|Xs]) :-
        json_attr(X),
        json_attrs(Xs).
    

      A regular type, defined as follows:
      json_attr(Id=Val) :-
          atm(Id),
          json_val(Val).
      

      REGTYPEjson_val/1
      A regular type, defined as follows:
      json_val(string(X)) :-
          string(X).
      json_val(X) :-
          number(X).
      json_val(X) :-
          json(X).
      json_val(X) :-
          json_list(X).
      json_val(true).
      json_val(false).
      json_val(null).
      

      Usage:

      A list of JSON elements

        Usage:json_to_string(Term,String)

        Encode a JSON value Term as a character list.

        Usage:string_to_json(String,Term)

        Decode a character list as a JSON value Term.

        PREDICATEjson_get/3
        No further documentation available for this predicate.

        No further documentation available for this predicate.

        No further documentation available for this predicate.

        No further documentation available for this predicate.

        PREDICATEjson_as_atm/2
        No further documentation available for this predicate.

        PREDICATEjson_as_num/2
        No further documentation available for this predicate.

        Documentation on imports

        This module has the following direct dependencies: