TorchLean API

NN.API.Json.Core

API Json #

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

The functions here fail fast with contextual messages. This module stays focused: 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

        Require a JSON string and report ctx in the error message on mismatch.

        Instances For

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

          Instances For

            Require a JSON array and return its entries.

            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