TorchLean API

NN.API.Json

API Json #

Small conservative JSON helpers shared by public artifact loaders and verification tools.

The functions here fail fast with contextual messages. This module is intentionally small: not a schema library, just the common parsing substrate for TorchLean JSON artifacts.

def NN.API.Json.fail {α : Type} (msg : String) :

Throw an Except String parse error.

Instances For

    Parse a JSON value as an object.

    Instances For

      Extract a required field from a JSON object.

      Instances For

        Parse a JSON string.

        Instances For

          Parse a JSON natural number, accepting either a JSON number or a decimal string.

          Instances For

            Parse a JSON array.

            Instances For

              Parse an optional JSON boolean field with a default.

              Instances For

                Parse a JSON array of natural numbers.

                Instances For

                  Parse a JSON file from disk.

                  Instances For