packages feed

hydra-kernel-0.18.1: hydra-kernel-json/hydra/core/extract/util.json

{
  "name": "hydra.core.extract.util",
  "metadata": {"description": "Extraction and validation for hydra.core.util types", "comments": [], "seeAlso": [], "provisions": []},
  "dependencies": [
    {"module": "hydra.core.errors"},
    {"module": "hydra.core.extract.model"},
    {"module": "hydra.core.lib.eithers"},
    {"module": "hydra.core.lib.equality"},
    {"module": "hydra.core.lib.logic"},
    {"module": "hydra.core.model"},
    {"module": "hydra.core.util"}],
  "definitions": [
    {
      "term": {
        "name": "hydra.core.extract.util.comparison",
        "signature": {
          "typeParameters": [{"name": "t0", "constraints": []}],
          "parameters": [
            {"name": "arg0", "type": {"variable": "t0"}, "isLazy": false},
            {"name": "arg1", "type": {"variable": "hydra.core.graph.Graph"}, "isLazy": false},
            {"name": "arg2", "type": {"variable": "hydra.core.model.Term"}, "isLazy": false}],
          "result": {
            "type": {"either": {"left": {"variable": "hydra.core.errors.Error"}, "right": {"variable": "hydra.core.util.Comparison"}}}}},
        "body": {
          "typeLambda": {
            "parameter": "t0",
            "body": {
              "annotated": {
                "body": {
                  "lambda": {
                    "parameter": "cx",
                    "domain": {"variable": "t0"},
                    "body": {
                      "lambda": {
                        "parameter": "graph",
                        "domain": {"variable": "hydra.core.graph.Graph"},
                        "body": {
                          "lambda": {
                            "parameter": "term",
                            "domain": {"variable": "hydra.core.model.Term"},
                            "body": {
                              "application": {
                                "function": {
                                  "application": {
                                    "function": {
                                      "typeApplication": {
                                        "body": {
                                          "typeApplication": {
                                            "body": {
                                              "typeApplication": {"body": {"variable": "hydra.core.lib.eithers.bind"}, "type": {"variable": "hydra.core.errors.Error"}}},
                                            "type": {"variable": "hydra.core.model.Name"}}},
                                        "type": {"variable": "hydra.core.util.Comparison"}}},
                                    "argument": {
                                      "application": {
                                        "function": {
                                          "application": {
                                            "function": {
                                              "application": {
                                                "function": {"variable": "hydra.core.extract.model.unitVariant"},
                                                "argument": {"wrap": {"typeName": "hydra.core.model.Name", "body": {"literal": {"string": "hydra.core.util.Comparison"}}}}}},
                                            "argument": {"variable": "graph"}}},
                                        "argument": {"variable": "term"}}}}},
                                "argument": {
                                  "lambda": {
                                    "parameter": "fname",
                                    "domain": {"variable": "hydra.core.model.Name"},
                                    "body": {
                                      "application": {
                                        "function": {
                                          "application": {
                                            "function": {
                                              "application": {
                                                "function": {
                                                  "typeApplication": {
                                                    "body": {"variable": "hydra.core.lib.logic.ifElse"},
                                                    "type": {"either": {"left": {"variable": "hydra.core.errors.Error"}, "right": {"variable": "hydra.core.util.Comparison"}}}}},
                                                "argument": {
                                                  "application": {
                                                    "function": {
                                                      "application": {
                                                        "function": {"typeApplication": {"body": {"variable": "hydra.core.lib.equality.equal"}, "type": {"literal": "string"}}},
                                                        "argument": {"application": {"function": {"unwrap": "hydra.core.model.Name"}, "argument": {"variable": "fname"}}}}},
                                                    "argument": {"literal": {"string": "equalTo"}}}}}},
                                            "argument": {
                                              "typeApplication": {
                                                "body": {
                                                  "typeApplication": {
                                                    "body": {
                                                      "either": {"right": {"inject": {"typeName": "hydra.core.util.Comparison", "field": {"name": "equalTo", "term": "unit"}}}}},
                                                    "type": {"variable": "hydra.core.errors.Error"}}},
                                                "type": {"variable": "hydra.core.util.Comparison"}}}}},
                                        "argument": {
                                          "application": {
                                            "function": {
                                              "application": {
                                                "function": {
                                                  "application": {
                                                    "function": {
                                                      "typeApplication": {
                                                        "body": {"variable": "hydra.core.lib.logic.ifElse"},
                                                        "type": {"either": {"left": {"variable": "hydra.core.errors.Error"}, "right": {"variable": "hydra.core.util.Comparison"}}}}},
                                                    "argument": {
                                                      "application": {
                                                        "function": {
                                                          "application": {
                                                            "function": {"typeApplication": {"body": {"variable": "hydra.core.lib.equality.equal"}, "type": {"literal": "string"}}},
                                                            "argument": {"application": {"function": {"unwrap": "hydra.core.model.Name"}, "argument": {"variable": "fname"}}}}},
                                                        "argument": {"literal": {"string": "lessThan"}}}}}},
                                                "argument": {
                                                  "typeApplication": {
                                                    "body": {
                                                      "typeApplication": {
                                                        "body": {
                                                          "either": {"right": {"inject": {"typeName": "hydra.core.util.Comparison", "field": {"name": "lessThan", "term": "unit"}}}}},
                                                        "type": {"variable": "hydra.core.errors.Error"}}},
                                                    "type": {"variable": "hydra.core.util.Comparison"}}}}},
                                            "argument": {
                                              "application": {
                                                "function": {
                                                  "application": {
                                                    "function": {
                                                      "application": {
                                                        "function": {
                                                          "typeApplication": {
                                                            "body": {"variable": "hydra.core.lib.logic.ifElse"},
                                                            "type": {"either": {"left": {"variable": "hydra.core.errors.Error"}, "right": {"variable": "hydra.core.util.Comparison"}}}}},
                                                        "argument": {
                                                          "application": {
                                                            "function": {
                                                              "application": {
                                                                "function": {"typeApplication": {"body": {"variable": "hydra.core.lib.equality.equal"}, "type": {"literal": "string"}}},
                                                                "argument": {"application": {"function": {"unwrap": "hydra.core.model.Name"}, "argument": {"variable": "fname"}}}}},
                                                            "argument": {"literal": {"string": "greaterThan"}}}}}},
                                                    "argument": {
                                                      "typeApplication": {
                                                        "body": {
                                                          "typeApplication": {
                                                            "body": {
                                                              "either": {"right": {"inject": {"typeName": "hydra.core.util.Comparison", "field": {"name": "greaterThan", "term": "unit"}}}}},
                                                            "type": {"variable": "hydra.core.errors.Error"}}},
                                                        "type": {"variable": "hydra.core.util.Comparison"}}}}},
                                                "argument": {
                                                  "typeApplication": {
                                                    "body": {
                                                      "typeApplication": {
                                                        "body": {
                                                          "either": {
                                                            "left": {
                                                              "inject": {
                                                                "typeName": "hydra.core.errors.Error",
                                                                "field": {
                                                                  "name": "extraction",
                                                                  "term": {
                                                                    "inject": {
                                                                      "typeName": "hydra.core.errors.ExtractionError",
                                                                      "field": {
                                                                        "name": "unexpectedShape",
                                                                        "term": {
                                                                          "record": {
                                                                            "typeName": "hydra.core.errors.UnexpectedShapeError",
                                                                            "fields": [
                                                                              {"name": "expected", "term": {"literal": {"string": "comparison"}}},
                                                                              {
                                                                                "name": "actual",
                                                                                "term": {"application": {"function": {"unwrap": "hydra.core.model.Name"}, "argument": {"variable": "fname"}}}}]}}}}}}}}}},
                                                        "type": {"variable": "hydra.core.errors.Error"}}},
                                                    "type": {"variable": "hydra.core.util.Comparison"}}}}}}}}}}}}}}}}}}},
                "annotation": {"map": [{"key": {"variable": "description"}, "value": {"literal": {"string": "Extract a comparison from a term"}}}]}}}}}}}]}