packages feed

hydra-kernel-0.18.1: hydra-kernel-json/hydra/core/decode/time.json

{
  "name": "hydra.core.decode.time",
  "metadata": {"description": "Term decoders for hydra.core.time", "comments": [], "seeAlso": [], "provisions": []},
  "dependencies": [
    {"module": "hydra.core.extract.model"},
    {"module": "hydra.core.lexical"},
    {"module": "hydra.core.rewriting"},
    {"module": "hydra.core.time"},
    {"module": "hydra.core.util"}],
  "definitions": [
    {
      "term": {
        "name": "hydra.core.decode.time.timespec",
        "signature": {
          "typeParameters": [],
          "parameters": [
            {"name": "arg0", "type": {"variable": "hydra.core.graph.Graph"}, "isLazy": false},
            {"name": "arg1", "type": {"variable": "hydra.core.model.Term"}, "isLazy": false}],
          "result": {
            "type": {"either": {"left": {"variable": "hydra.core.errors.DecodingError"}, "right": {"variable": "hydra.core.time.Timespec"}}}}},
        "body": {
          "annotated": {
            "body": {
              "lambda": {
                "parameter": "cx",
                "domain": {"variable": "hydra.core.graph.Graph"},
                "body": {
                  "lambda": {
                    "parameter": "raw",
                    "domain": {"variable": "hydra.core.model.Term"},
                    "body": {
                      "application": {
                        "function": {
                          "application": {
                            "function": {
                              "application": {
                                "function": {
                                  "typeApplication": {
                                    "body": {
                                      "typeApplication": {
                                        "body": {
                                          "typeApplication": {"body": {"variable": "hydra.core.lib.eithers.either"}, "type": {"variable": "hydra.core.errors.DecodingError"}}},
                                        "type": {"variable": "hydra.core.model.Term"}}},
                                    "type": {"either": {"left": {"variable": "hydra.core.errors.DecodingError"}, "right": {"variable": "hydra.core.time.Timespec"}}}}},
                                "argument": {
                                  "lambda": {
                                    "parameter": "err",
                                    "domain": {"variable": "hydra.core.errors.DecodingError"},
                                    "body": {
                                      "typeApplication": {
                                        "body": {
                                          "typeApplication": {"body": {"either": {"left": {"variable": "err"}}}, "type": {"variable": "hydra.core.errors.DecodingError"}}},
                                        "type": {"variable": "hydra.core.time.Timespec"}}}}}}},
                            "argument": {
                              "lambda": {
                                "parameter": "stripped",
                                "domain": {"variable": "hydra.core.model.Term"},
                                "body": {
                                  "application": {
                                    "function": {
                                      "cases": {
                                        "typeName": "hydra.core.model.Term",
                                        "default": {
                                          "typeApplication": {
                                            "body": {
                                              "typeApplication": {
                                                "body": {
                                                  "either": {
                                                    "left": {
                                                      "wrap": {
                                                        "typeName": "hydra.core.errors.DecodingError",
                                                        "body": {"literal": {"string": "expected a record of type hydra.core.time.Timespec"}}}}}},
                                                "type": {"variable": "hydra.core.errors.DecodingError"}}},
                                            "type": {"variable": "hydra.core.time.Timespec"}}},
                                        "cases": [
                                          {
                                            "name": "record",
                                            "handler": {
                                              "lambda": {
                                                "parameter": "record",
                                                "domain": {"variable": "hydra.core.model.Record"},
                                                "body": {
                                                  "let": {
                                                    "bindings": [
                                                      {
                                                        "name": "fieldMap",
                                                        "term": {"application": {"function": {"variable": "hydra.core.extract.model.toFieldMap"}, "argument": {"variable": "record"}}},
                                                        "typeScheme": {
                                                          "variables": [],
                                                          "body": {"map": {"keys": {"variable": "hydra.core.model.Name"}, "values": {"variable": "hydra.core.model.Term"}}},
                                                          "constraints": []}}],
                                                    "body": {
                                                      "application": {
                                                        "function": {
                                                          "application": {
                                                            "function": {
                                                              "typeApplication": {
                                                                "body": {
                                                                  "typeApplication": {
                                                                    "body": {
                                                                      "typeApplication": {"body": {"variable": "hydra.core.lib.eithers.bind"}, "type": {"variable": "hydra.core.errors.DecodingError"}}},
                                                                    "type": {"literal": {"integer": "int64"}}}},
                                                                "type": {"variable": "hydra.core.time.Timespec"}}},
                                                            "argument": {
                                                              "application": {
                                                                "function": {
                                                                  "application": {
                                                                    "function": {
                                                                      "application": {
                                                                        "function": {
                                                                          "application": {
                                                                            "function": {
                                                                              "typeApplication": {
                                                                                "body": {
                                                                                  "typeApplication": {
                                                                                    "body": {
                                                                                      "typeApplication": {"body": {"variable": "hydra.core.extract.model.requireField"}, "type": {"variable": "hydra.core.graph.Graph"}}},
                                                                                    "type": {"variable": "hydra.core.model.Term"}}},
                                                                                "type": {"literal": {"integer": "int64"}}}},
                                                                            "argument": {"literal": {"string": "seconds"}}}},
                                                                        "argument": {
                                                                          "lambda": {
                                                                            "parameter": "cx",
                                                                            "domain": {"variable": "hydra.core.graph.Graph"},
                                                                            "body": {
                                                                              "lambda": {
                                                                                "parameter": "raw",
                                                                                "domain": {"variable": "hydra.core.model.Term"},
                                                                                "body": {
                                                                                  "application": {
                                                                                    "function": {
                                                                                      "application": {
                                                                                        "function": {
                                                                                          "application": {
                                                                                            "function": {
                                                                                              "typeApplication": {
                                                                                                "body": {
                                                                                                  "typeApplication": {
                                                                                                    "body": {
                                                                                                      "typeApplication": {"body": {"variable": "hydra.core.lib.eithers.either"}, "type": {"variable": "hydra.core.errors.DecodingError"}}},
                                                                                                    "type": {"variable": "hydra.core.model.Term"}}},
                                                                                                "type": {"either": {"left": {"variable": "hydra.core.errors.DecodingError"}, "right": {"literal": {"integer": "int64"}}}}}},
                                                                                            "argument": {
                                                                                              "lambda": {
                                                                                                "parameter": "err",
                                                                                                "domain": {"variable": "hydra.core.errors.DecodingError"},
                                                                                                "body": {
                                                                                                  "typeApplication": {
                                                                                                    "body": {
                                                                                                      "typeApplication": {"body": {"either": {"left": {"variable": "err"}}}, "type": {"variable": "hydra.core.errors.DecodingError"}}},
                                                                                                    "type": {"literal": {"integer": "int64"}}}}}}}},
                                                                                        "argument": {
                                                                                          "lambda": {
                                                                                            "parameter": "stripped",
                                                                                            "domain": {"variable": "hydra.core.model.Term"},
                                                                                            "body": {
                                                                                              "application": {
                                                                                                "function": {
                                                                                                  "cases": {
                                                                                                    "typeName": "hydra.core.model.Term",
                                                                                                    "default": {
                                                                                                      "typeApplication": {
                                                                                                        "body": {
                                                                                                          "typeApplication": {
                                                                                                            "body": {
                                                                                                              "either": {"left": {"wrap": {"typeName": "hydra.core.errors.DecodingError", "body": {"literal": {"string": "expected literal"}}}}}},
                                                                                                            "type": {"variable": "hydra.core.errors.DecodingError"}}},
                                                                                                        "type": {"literal": {"integer": "int64"}}}},
                                                                                                    "cases": [
                                                                                                      {
                                                                                                        "name": "literal",
                                                                                                        "handler": {
                                                                                                          "lambda": {
                                                                                                            "parameter": "v",
                                                                                                            "domain": {"variable": "hydra.core.model.Literal"},
                                                                                                            "body": {
                                                                                                              "application": {
                                                                                                                "function": {
                                                                                                                  "cases": {
                                                                                                                    "typeName": "hydra.core.model.Literal",
                                                                                                                    "default": {
                                                                                                                      "typeApplication": {
                                                                                                                        "body": {
                                                                                                                          "typeApplication": {
                                                                                                                            "body": {
                                                                                                                              "either": {
                                                                                                                                "left": {"wrap": {"typeName": "hydra.core.errors.DecodingError", "body": {"literal": {"string": "expected int64 literal"}}}}}},
                                                                                                                            "type": {"variable": "hydra.core.errors.DecodingError"}}},
                                                                                                                        "type": {"literal": {"integer": "int64"}}}},
                                                                                                                    "cases": [
                                                                                                                      {
                                                                                                                        "name": "integer",
                                                                                                                        "handler": {
                                                                                                                          "cases": {
                                                                                                                            "typeName": "hydra.core.model.IntegerValue",
                                                                                                                            "default": {
                                                                                                                              "typeApplication": {
                                                                                                                                "body": {
                                                                                                                                  "typeApplication": {
                                                                                                                                    "body": {
                                                                                                                                      "either": {
                                                                                                                                        "left": {"wrap": {"typeName": "hydra.core.errors.DecodingError", "body": {"literal": {"string": "expected int64 value"}}}}}},
                                                                                                                                    "type": {"variable": "hydra.core.errors.DecodingError"}}},
                                                                                                                                "type": {"literal": {"integer": "int64"}}}},
                                                                                                                            "cases": [
                                                                                                                              {
                                                                                                                                "name": "int64",
                                                                                                                                "handler": {
                                                                                                                                  "lambda": {
                                                                                                                                    "parameter": "i",
                                                                                                                                    "domain": {"literal": {"integer": "int64"}},
                                                                                                                                    "body": {
                                                                                                                                      "typeApplication": {
                                                                                                                                        "body": {
                                                                                                                                          "typeApplication": {"body": {"either": {"right": {"variable": "i"}}}, "type": {"variable": "hydra.core.errors.DecodingError"}}},
                                                                                                                                        "type": {"literal": {"integer": "int64"}}}}}}}]}}}]}},
                                                                                                                "argument": {"variable": "v"}}}}}}]}},
                                                                                                "argument": {"variable": "stripped"}}}}}}},
                                                                                    "argument": {
                                                                                      "application": {
                                                                                        "function": {
                                                                                          "application": {"function": {"variable": "hydra.core.extract.model.stripWithDecodingError"}, "argument": {"variable": "cx"}}},
                                                                                        "argument": {"variable": "raw"}}}}}}}}}}},
                                                                    "argument": {"variable": "fieldMap"}}},
                                                                "argument": {"variable": "cx"}}}}},
                                                        "argument": {
                                                          "lambda": {
                                                            "parameter": "field_seconds",
                                                            "domain": {"literal": {"integer": "int64"}},
                                                            "body": {
                                                              "application": {
                                                                "function": {
                                                                  "application": {
                                                                    "function": {
                                                                      "typeApplication": {
                                                                        "body": {
                                                                          "typeApplication": {
                                                                            "body": {
                                                                              "typeApplication": {"body": {"variable": "hydra.core.lib.eithers.bind"}, "type": {"variable": "hydra.core.errors.DecodingError"}}},
                                                                            "type": {"literal": {"integer": "uint32"}}}},
                                                                        "type": {"variable": "hydra.core.time.Timespec"}}},
                                                                    "argument": {
                                                                      "application": {
                                                                        "function": {
                                                                          "application": {
                                                                            "function": {
                                                                              "application": {
                                                                                "function": {
                                                                                  "application": {
                                                                                    "function": {
                                                                                      "typeApplication": {
                                                                                        "body": {
                                                                                          "typeApplication": {
                                                                                            "body": {
                                                                                              "typeApplication": {"body": {"variable": "hydra.core.extract.model.requireField"}, "type": {"variable": "hydra.core.graph.Graph"}}},
                                                                                            "type": {"variable": "hydra.core.model.Term"}}},
                                                                                        "type": {"literal": {"integer": "uint32"}}}},
                                                                                    "argument": {"literal": {"string": "nanoseconds"}}}},
                                                                                "argument": {
                                                                                  "lambda": {
                                                                                    "parameter": "cx",
                                                                                    "domain": {"variable": "hydra.core.graph.Graph"},
                                                                                    "body": {
                                                                                      "lambda": {
                                                                                        "parameter": "raw",
                                                                                        "domain": {"variable": "hydra.core.model.Term"},
                                                                                        "body": {
                                                                                          "application": {
                                                                                            "function": {
                                                                                              "application": {
                                                                                                "function": {
                                                                                                  "application": {
                                                                                                    "function": {
                                                                                                      "typeApplication": {
                                                                                                        "body": {
                                                                                                          "typeApplication": {
                                                                                                            "body": {
                                                                                                              "typeApplication": {"body": {"variable": "hydra.core.lib.eithers.either"}, "type": {"variable": "hydra.core.errors.DecodingError"}}},
                                                                                                            "type": {"variable": "hydra.core.model.Term"}}},
                                                                                                        "type": {"either": {"left": {"variable": "hydra.core.errors.DecodingError"}, "right": {"literal": {"integer": "uint32"}}}}}},
                                                                                                    "argument": {
                                                                                                      "lambda": {
                                                                                                        "parameter": "err",
                                                                                                        "domain": {"variable": "hydra.core.errors.DecodingError"},
                                                                                                        "body": {
                                                                                                          "typeApplication": {
                                                                                                            "body": {
                                                                                                              "typeApplication": {"body": {"either": {"left": {"variable": "err"}}}, "type": {"variable": "hydra.core.errors.DecodingError"}}},
                                                                                                            "type": {"literal": {"integer": "uint32"}}}}}}}},
                                                                                                "argument": {
                                                                                                  "lambda": {
                                                                                                    "parameter": "stripped",
                                                                                                    "domain": {"variable": "hydra.core.model.Term"},
                                                                                                    "body": {
                                                                                                      "application": {
                                                                                                        "function": {
                                                                                                          "cases": {
                                                                                                            "typeName": "hydra.core.model.Term",
                                                                                                            "default": {
                                                                                                              "typeApplication": {
                                                                                                                "body": {
                                                                                                                  "typeApplication": {
                                                                                                                    "body": {
                                                                                                                      "either": {"left": {"wrap": {"typeName": "hydra.core.errors.DecodingError", "body": {"literal": {"string": "expected literal"}}}}}},
                                                                                                                    "type": {"variable": "hydra.core.errors.DecodingError"}}},
                                                                                                                "type": {"literal": {"integer": "uint32"}}}},
                                                                                                            "cases": [
                                                                                                              {
                                                                                                                "name": "literal",
                                                                                                                "handler": {
                                                                                                                  "lambda": {
                                                                                                                    "parameter": "v",
                                                                                                                    "domain": {"variable": "hydra.core.model.Literal"},
                                                                                                                    "body": {
                                                                                                                      "application": {
                                                                                                                        "function": {
                                                                                                                          "cases": {
                                                                                                                            "typeName": "hydra.core.model.Literal",
                                                                                                                            "default": {
                                                                                                                              "typeApplication": {
                                                                                                                                "body": {
                                                                                                                                  "typeApplication": {
                                                                                                                                    "body": {
                                                                                                                                      "either": {
                                                                                                                                        "left": {"wrap": {"typeName": "hydra.core.errors.DecodingError", "body": {"literal": {"string": "expected uint32 literal"}}}}}},
                                                                                                                                    "type": {"variable": "hydra.core.errors.DecodingError"}}},
                                                                                                                                "type": {"literal": {"integer": "uint32"}}}},
                                                                                                                            "cases": [
                                                                                                                              {
                                                                                                                                "name": "integer",
                                                                                                                                "handler": {
                                                                                                                                  "cases": {
                                                                                                                                    "typeName": "hydra.core.model.IntegerValue",
                                                                                                                                    "default": {
                                                                                                                                      "typeApplication": {
                                                                                                                                        "body": {
                                                                                                                                          "typeApplication": {
                                                                                                                                            "body": {
                                                                                                                                              "either": {
                                                                                                                                                "left": {"wrap": {"typeName": "hydra.core.errors.DecodingError", "body": {"literal": {"string": "expected uint32 value"}}}}}},
                                                                                                                                            "type": {"variable": "hydra.core.errors.DecodingError"}}},
                                                                                                                                        "type": {"literal": {"integer": "uint32"}}}},
                                                                                                                                    "cases": [
                                                                                                                                      {
                                                                                                                                        "name": "uint32",
                                                                                                                                        "handler": {
                                                                                                                                          "lambda": {
                                                                                                                                            "parameter": "i",
                                                                                                                                            "domain": {"literal": {"integer": "uint32"}},
                                                                                                                                            "body": {
                                                                                                                                              "typeApplication": {
                                                                                                                                                "body": {
                                                                                                                                                  "typeApplication": {"body": {"either": {"right": {"variable": "i"}}}, "type": {"variable": "hydra.core.errors.DecodingError"}}},
                                                                                                                                                "type": {"literal": {"integer": "uint32"}}}}}}}]}}}]}},
                                                                                                                        "argument": {"variable": "v"}}}}}}]}},
                                                                                                        "argument": {"variable": "stripped"}}}}}}},
                                                                                            "argument": {
                                                                                              "application": {
                                                                                                "function": {
                                                                                                  "application": {"function": {"variable": "hydra.core.extract.model.stripWithDecodingError"}, "argument": {"variable": "cx"}}},
                                                                                                "argument": {"variable": "raw"}}}}}}}}}}},
                                                                            "argument": {"variable": "fieldMap"}}},
                                                                        "argument": {"variable": "cx"}}}}},
                                                                "argument": {
                                                                  "lambda": {
                                                                    "parameter": "field_nanoseconds",
                                                                    "domain": {"literal": {"integer": "uint32"}},
                                                                    "body": {
                                                                      "typeApplication": {
                                                                        "body": {
                                                                          "typeApplication": {
                                                                            "body": {
                                                                              "either": {
                                                                                "right": {
                                                                                  "record": {
                                                                                    "typeName": "hydra.core.time.Timespec",
                                                                                    "fields": [
                                                                                      {"name": "seconds", "term": {"variable": "field_seconds"}},
                                                                                      {"name": "nanoseconds", "term": {"variable": "field_nanoseconds"}}]}}}},
                                                                            "type": {"variable": "hydra.core.errors.DecodingError"}}},
                                                                        "type": {"variable": "hydra.core.time.Timespec"}}}}}}}}}}}}}}}}]}},
                                    "argument": {"variable": "stripped"}}}}}}},
                        "argument": {
                          "application": {
                            "function": {
                              "application": {"function": {"variable": "hydra.core.extract.model.stripWithDecodingError"}, "argument": {"variable": "cx"}}},
                            "argument": {"variable": "raw"}}}}}}}}},
            "annotation": {
              "map": [{"key": {"variable": "description"}, "value": {"literal": {"string": "Decoder for hydra.core.time.Timespec"}}}]}}}}}]}