packages feed

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

{
  "name": "hydra.core.decode.query",
  "metadata": {"description": "Term decoders for hydra.core.query", "comments": [], "seeAlso": [], "provisions": []},
  "dependencies": [
    {"module": "hydra.core.extract.model"},
    {"module": "hydra.core.lexical"},
    {"module": "hydra.core.rewriting"},
    {"module": "hydra.core.query"},
    {"module": "hydra.core.util"},
    {"module": "hydra.core.decode.model"}],
  "definitions": [
    {
      "term": {
        "name": "hydra.core.decode.query.comparisonConstraint",
        "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.query.ComparisonConstraint"}}}}},
        "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.query.ComparisonConstraint"}}}}},
                                "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.query.ComparisonConstraint"}}}}}}},
                            "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 union"}}}}}},
                                                "type": {"variable": "hydra.core.errors.DecodingError"}}},
                                            "type": {"variable": "hydra.core.query.ComparisonConstraint"}}},
                                        "cases": [
                                          {
                                            "name": "inject",
                                            "handler": {
                                              "lambda": {
                                                "parameter": "inj",
                                                "domain": {"variable": "hydra.core.model.Injection"},
                                                "body": {
                                                  "let": {
                                                    "bindings": [
                                                      {
                                                        "name": "field",
                                                        "term": {
                                                          "application": {
                                                            "function": {"project": {"typeName": "hydra.core.model.Injection", "fieldName": "field"}},
                                                            "argument": {"variable": "inj"}}},
                                                        "typeScheme": {"variables": [], "body": {"variable": "hydra.core.model.Field"}, "constraints": []}},
                                                      {
                                                        "name": "fname",
                                                        "term": {
                                                          "application": {
                                                            "function": {"project": {"typeName": "hydra.core.model.Field", "fieldName": "name"}},
                                                            "argument": {"variable": "field"}}},
                                                        "typeScheme": {"variables": [], "body": {"variable": "hydra.core.model.Name"}, "constraints": []}},
                                                      {
                                                        "name": "fterm",
                                                        "term": {
                                                          "application": {
                                                            "function": {"project": {"typeName": "hydra.core.model.Field", "fieldName": "term"}},
                                                            "argument": {"variable": "field"}}},
                                                        "typeScheme": {"variables": [], "body": {"variable": "hydra.core.model.Term"}, "constraints": []}},
                                                      {
                                                        "name": "variantMap",
                                                        "term": {
                                                          "application": {
                                                            "function": {
                                                              "typeApplication": {
                                                                "body": {
                                                                  "typeApplication": {"body": {"variable": "hydra.core.lib.maps.fromList"}, "type": {"variable": "hydra.core.model.Name"}}},
                                                                "type": {
                                                                  "function": {
                                                                    "domain": {"variable": "hydra.core.model.Term"},
                                                                    "codomain": {
                                                                      "either": {
                                                                        "left": {"variable": "hydra.core.errors.DecodingError"},
                                                                        "right": {"variable": "hydra.core.query.ComparisonConstraint"}}}}}}},
                                                            "argument": {
                                                              "list": [
                                                                {
                                                                  "typeApplication": {
                                                                    "body": {
                                                                      "typeApplication": {
                                                                        "body": {
                                                                          "pair": {
                                                                            "first": {"wrap": {"typeName": "hydra.core.model.Name", "body": {"literal": {"string": "equal"}}}},
                                                                            "second": {
                                                                              "lambda": {
                                                                                "parameter": "input",
                                                                                "domain": {"variable": "hydra.core.model.Term"},
                                                                                "body": {
                                                                                  "application": {
                                                                                    "function": {
                                                                                      "application": {
                                                                                        "function": {
                                                                                          "typeApplication": {
                                                                                            "body": {
                                                                                              "typeApplication": {
                                                                                                "body": {"typeApplication": {"body": {"variable": "hydra.core.lib.eithers.map"}, "type": "unit"}},
                                                                                                "type": {"variable": "hydra.core.query.ComparisonConstraint"}}},
                                                                                            "type": {"variable": "hydra.core.errors.DecodingError"}}},
                                                                                        "argument": {
                                                                                          "lambda": {
                                                                                            "parameter": "t",
                                                                                            "domain": "unit",
                                                                                            "body": {"inject": {"typeName": "hydra.core.query.ComparisonConstraint", "field": {"name": "equal", "term": {"variable": "t"}}}}}}}},
                                                                                    "argument": {
                                                                                      "application": {
                                                                                        "function": {
                                                                                          "application": {
                                                                                            "function": {
                                                                                              "lambda": {
                                                                                                "parameter": "cx",
                                                                                                "domain": {"variable": "hydra.core.graph.Graph"},
                                                                                                "body": {
                                                                                                  "lambda": {
                                                                                                    "parameter": "t",
                                                                                                    "domain": {"variable": "hydra.core.model.Term"},
                                                                                                    "body": {
                                                                                                      "application": {
                                                                                                        "function": {"application": {"function": {"variable": "hydra.core.extract.model.decodeUnit"}, "argument": {"variable": "cx"}}},
                                                                                                        "argument": {"variable": "t"}}}}}}},
                                                                                            "argument": {"variable": "cx"}}},
                                                                                        "argument": {"variable": "input"}}}}}}}}},
                                                                        "type": {"variable": "hydra.core.model.Name"}}},
                                                                    "type": {
                                                                      "function": {
                                                                        "domain": {"variable": "hydra.core.model.Term"},
                                                                        "codomain": {
                                                                          "either": {
                                                                            "left": {"variable": "hydra.core.errors.DecodingError"},
                                                                            "right": {"variable": "hydra.core.query.ComparisonConstraint"}}}}}}},
                                                                {
                                                                  "typeApplication": {
                                                                    "body": {
                                                                      "typeApplication": {
                                                                        "body": {
                                                                          "pair": {
                                                                            "first": {"wrap": {"typeName": "hydra.core.model.Name", "body": {"literal": {"string": "notEqual"}}}},
                                                                            "second": {
                                                                              "lambda": {
                                                                                "parameter": "input",
                                                                                "domain": {"variable": "hydra.core.model.Term"},
                                                                                "body": {
                                                                                  "application": {
                                                                                    "function": {
                                                                                      "application": {
                                                                                        "function": {
                                                                                          "typeApplication": {
                                                                                            "body": {
                                                                                              "typeApplication": {
                                                                                                "body": {"typeApplication": {"body": {"variable": "hydra.core.lib.eithers.map"}, "type": "unit"}},
                                                                                                "type": {"variable": "hydra.core.query.ComparisonConstraint"}}},
                                                                                            "type": {"variable": "hydra.core.errors.DecodingError"}}},
                                                                                        "argument": {
                                                                                          "lambda": {
                                                                                            "parameter": "t",
                                                                                            "domain": "unit",
                                                                                            "body": {
                                                                                              "inject": {"typeName": "hydra.core.query.ComparisonConstraint", "field": {"name": "notEqual", "term": {"variable": "t"}}}}}}}},
                                                                                    "argument": {
                                                                                      "application": {
                                                                                        "function": {
                                                                                          "application": {
                                                                                            "function": {
                                                                                              "lambda": {
                                                                                                "parameter": "cx",
                                                                                                "domain": {"variable": "hydra.core.graph.Graph"},
                                                                                                "body": {
                                                                                                  "lambda": {
                                                                                                    "parameter": "t",
                                                                                                    "domain": {"variable": "hydra.core.model.Term"},
                                                                                                    "body": {
                                                                                                      "application": {
                                                                                                        "function": {"application": {"function": {"variable": "hydra.core.extract.model.decodeUnit"}, "argument": {"variable": "cx"}}},
                                                                                                        "argument": {"variable": "t"}}}}}}},
                                                                                            "argument": {"variable": "cx"}}},
                                                                                        "argument": {"variable": "input"}}}}}}}}},
                                                                        "type": {"variable": "hydra.core.model.Name"}}},
                                                                    "type": {
                                                                      "function": {
                                                                        "domain": {"variable": "hydra.core.model.Term"},
                                                                        "codomain": {
                                                                          "either": {
                                                                            "left": {"variable": "hydra.core.errors.DecodingError"},
                                                                            "right": {"variable": "hydra.core.query.ComparisonConstraint"}}}}}}},
                                                                {
                                                                  "typeApplication": {
                                                                    "body": {
                                                                      "typeApplication": {
                                                                        "body": {
                                                                          "pair": {
                                                                            "first": {"wrap": {"typeName": "hydra.core.model.Name", "body": {"literal": {"string": "lessThan"}}}},
                                                                            "second": {
                                                                              "lambda": {
                                                                                "parameter": "input",
                                                                                "domain": {"variable": "hydra.core.model.Term"},
                                                                                "body": {
                                                                                  "application": {
                                                                                    "function": {
                                                                                      "application": {
                                                                                        "function": {
                                                                                          "typeApplication": {
                                                                                            "body": {
                                                                                              "typeApplication": {
                                                                                                "body": {"typeApplication": {"body": {"variable": "hydra.core.lib.eithers.map"}, "type": "unit"}},
                                                                                                "type": {"variable": "hydra.core.query.ComparisonConstraint"}}},
                                                                                            "type": {"variable": "hydra.core.errors.DecodingError"}}},
                                                                                        "argument": {
                                                                                          "lambda": {
                                                                                            "parameter": "t",
                                                                                            "domain": "unit",
                                                                                            "body": {
                                                                                              "inject": {"typeName": "hydra.core.query.ComparisonConstraint", "field": {"name": "lessThan", "term": {"variable": "t"}}}}}}}},
                                                                                    "argument": {
                                                                                      "application": {
                                                                                        "function": {
                                                                                          "application": {
                                                                                            "function": {
                                                                                              "lambda": {
                                                                                                "parameter": "cx",
                                                                                                "domain": {"variable": "hydra.core.graph.Graph"},
                                                                                                "body": {
                                                                                                  "lambda": {
                                                                                                    "parameter": "t",
                                                                                                    "domain": {"variable": "hydra.core.model.Term"},
                                                                                                    "body": {
                                                                                                      "application": {
                                                                                                        "function": {"application": {"function": {"variable": "hydra.core.extract.model.decodeUnit"}, "argument": {"variable": "cx"}}},
                                                                                                        "argument": {"variable": "t"}}}}}}},
                                                                                            "argument": {"variable": "cx"}}},
                                                                                        "argument": {"variable": "input"}}}}}}}}},
                                                                        "type": {"variable": "hydra.core.model.Name"}}},
                                                                    "type": {
                                                                      "function": {
                                                                        "domain": {"variable": "hydra.core.model.Term"},
                                                                        "codomain": {
                                                                          "either": {
                                                                            "left": {"variable": "hydra.core.errors.DecodingError"},
                                                                            "right": {"variable": "hydra.core.query.ComparisonConstraint"}}}}}}},
                                                                {
                                                                  "typeApplication": {
                                                                    "body": {
                                                                      "typeApplication": {
                                                                        "body": {
                                                                          "pair": {
                                                                            "first": {"wrap": {"typeName": "hydra.core.model.Name", "body": {"literal": {"string": "greaterThan"}}}},
                                                                            "second": {
                                                                              "lambda": {
                                                                                "parameter": "input",
                                                                                "domain": {"variable": "hydra.core.model.Term"},
                                                                                "body": {
                                                                                  "application": {
                                                                                    "function": {
                                                                                      "application": {
                                                                                        "function": {
                                                                                          "typeApplication": {
                                                                                            "body": {
                                                                                              "typeApplication": {
                                                                                                "body": {"typeApplication": {"body": {"variable": "hydra.core.lib.eithers.map"}, "type": "unit"}},
                                                                                                "type": {"variable": "hydra.core.query.ComparisonConstraint"}}},
                                                                                            "type": {"variable": "hydra.core.errors.DecodingError"}}},
                                                                                        "argument": {
                                                                                          "lambda": {
                                                                                            "parameter": "t",
                                                                                            "domain": "unit",
                                                                                            "body": {
                                                                                              "inject": {"typeName": "hydra.core.query.ComparisonConstraint", "field": {"name": "greaterThan", "term": {"variable": "t"}}}}}}}},
                                                                                    "argument": {
                                                                                      "application": {
                                                                                        "function": {
                                                                                          "application": {
                                                                                            "function": {
                                                                                              "lambda": {
                                                                                                "parameter": "cx",
                                                                                                "domain": {"variable": "hydra.core.graph.Graph"},
                                                                                                "body": {
                                                                                                  "lambda": {
                                                                                                    "parameter": "t",
                                                                                                    "domain": {"variable": "hydra.core.model.Term"},
                                                                                                    "body": {
                                                                                                      "application": {
                                                                                                        "function": {"application": {"function": {"variable": "hydra.core.extract.model.decodeUnit"}, "argument": {"variable": "cx"}}},
                                                                                                        "argument": {"variable": "t"}}}}}}},
                                                                                            "argument": {"variable": "cx"}}},
                                                                                        "argument": {"variable": "input"}}}}}}}}},
                                                                        "type": {"variable": "hydra.core.model.Name"}}},
                                                                    "type": {
                                                                      "function": {
                                                                        "domain": {"variable": "hydra.core.model.Term"},
                                                                        "codomain": {
                                                                          "either": {
                                                                            "left": {"variable": "hydra.core.errors.DecodingError"},
                                                                            "right": {"variable": "hydra.core.query.ComparisonConstraint"}}}}}}},
                                                                {
                                                                  "typeApplication": {
                                                                    "body": {
                                                                      "typeApplication": {
                                                                        "body": {
                                                                          "pair": {
                                                                            "first": {"wrap": {"typeName": "hydra.core.model.Name", "body": {"literal": {"string": "lessThanOrEqual"}}}},
                                                                            "second": {
                                                                              "lambda": {
                                                                                "parameter": "input",
                                                                                "domain": {"variable": "hydra.core.model.Term"},
                                                                                "body": {
                                                                                  "application": {
                                                                                    "function": {
                                                                                      "application": {
                                                                                        "function": {
                                                                                          "typeApplication": {
                                                                                            "body": {
                                                                                              "typeApplication": {
                                                                                                "body": {"typeApplication": {"body": {"variable": "hydra.core.lib.eithers.map"}, "type": "unit"}},
                                                                                                "type": {"variable": "hydra.core.query.ComparisonConstraint"}}},
                                                                                            "type": {"variable": "hydra.core.errors.DecodingError"}}},
                                                                                        "argument": {
                                                                                          "lambda": {
                                                                                            "parameter": "t",
                                                                                            "domain": "unit",
                                                                                            "body": {
                                                                                              "inject": {"typeName": "hydra.core.query.ComparisonConstraint", "field": {"name": "lessThanOrEqual", "term": {"variable": "t"}}}}}}}},
                                                                                    "argument": {
                                                                                      "application": {
                                                                                        "function": {
                                                                                          "application": {
                                                                                            "function": {
                                                                                              "lambda": {
                                                                                                "parameter": "cx",
                                                                                                "domain": {"variable": "hydra.core.graph.Graph"},
                                                                                                "body": {
                                                                                                  "lambda": {
                                                                                                    "parameter": "t",
                                                                                                    "domain": {"variable": "hydra.core.model.Term"},
                                                                                                    "body": {
                                                                                                      "application": {
                                                                                                        "function": {"application": {"function": {"variable": "hydra.core.extract.model.decodeUnit"}, "argument": {"variable": "cx"}}},
                                                                                                        "argument": {"variable": "t"}}}}}}},
                                                                                            "argument": {"variable": "cx"}}},
                                                                                        "argument": {"variable": "input"}}}}}}}}},
                                                                        "type": {"variable": "hydra.core.model.Name"}}},
                                                                    "type": {
                                                                      "function": {
                                                                        "domain": {"variable": "hydra.core.model.Term"},
                                                                        "codomain": {
                                                                          "either": {
                                                                            "left": {"variable": "hydra.core.errors.DecodingError"},
                                                                            "right": {"variable": "hydra.core.query.ComparisonConstraint"}}}}}}},
                                                                {
                                                                  "typeApplication": {
                                                                    "body": {
                                                                      "typeApplication": {
                                                                        "body": {
                                                                          "pair": {
                                                                            "first": {"wrap": {"typeName": "hydra.core.model.Name", "body": {"literal": {"string": "greaterThanOrEqual"}}}},
                                                                            "second": {
                                                                              "lambda": {
                                                                                "parameter": "input",
                                                                                "domain": {"variable": "hydra.core.model.Term"},
                                                                                "body": {
                                                                                  "application": {
                                                                                    "function": {
                                                                                      "application": {
                                                                                        "function": {
                                                                                          "typeApplication": {
                                                                                            "body": {
                                                                                              "typeApplication": {
                                                                                                "body": {"typeApplication": {"body": {"variable": "hydra.core.lib.eithers.map"}, "type": "unit"}},
                                                                                                "type": {"variable": "hydra.core.query.ComparisonConstraint"}}},
                                                                                            "type": {"variable": "hydra.core.errors.DecodingError"}}},
                                                                                        "argument": {
                                                                                          "lambda": {
                                                                                            "parameter": "t",
                                                                                            "domain": "unit",
                                                                                            "body": {
                                                                                              "inject": {
                                                                                                "typeName": "hydra.core.query.ComparisonConstraint",
                                                                                                "field": {"name": "greaterThanOrEqual", "term": {"variable": "t"}}}}}}}},
                                                                                    "argument": {
                                                                                      "application": {
                                                                                        "function": {
                                                                                          "application": {
                                                                                            "function": {
                                                                                              "lambda": {
                                                                                                "parameter": "cx",
                                                                                                "domain": {"variable": "hydra.core.graph.Graph"},
                                                                                                "body": {
                                                                                                  "lambda": {
                                                                                                    "parameter": "t",
                                                                                                    "domain": {"variable": "hydra.core.model.Term"},
                                                                                                    "body": {
                                                                                                      "application": {
                                                                                                        "function": {"application": {"function": {"variable": "hydra.core.extract.model.decodeUnit"}, "argument": {"variable": "cx"}}},
                                                                                                        "argument": {"variable": "t"}}}}}}},
                                                                                            "argument": {"variable": "cx"}}},
                                                                                        "argument": {"variable": "input"}}}}}}}}},
                                                                        "type": {"variable": "hydra.core.model.Name"}}},
                                                                    "type": {
                                                                      "function": {
                                                                        "domain": {"variable": "hydra.core.model.Term"},
                                                                        "codomain": {
                                                                          "either": {
                                                                            "left": {"variable": "hydra.core.errors.DecodingError"},
                                                                            "right": {"variable": "hydra.core.query.ComparisonConstraint"}}}}}}}]}}},
                                                        "typeScheme": {
                                                          "variables": [],
                                                          "body": {
                                                            "map": {
                                                              "keys": {"variable": "hydra.core.model.Name"},
                                                              "values": {
                                                                "function": {
                                                                  "domain": {"variable": "hydra.core.model.Term"},
                                                                  "codomain": {
                                                                    "either": {
                                                                      "left": {"variable": "hydra.core.errors.DecodingError"},
                                                                      "right": {"variable": "hydra.core.query.ComparisonConstraint"}}}}}}},
                                                          "constraints": []}}],
                                                    "body": {
                                                      "application": {
                                                        "function": {
                                                          "application": {
                                                            "function": {
                                                              "application": {
                                                                "function": {
                                                                  "typeApplication": {
                                                                    "body": {
                                                                      "typeApplication": {
                                                                        "body": {"variable": "hydra.core.lib.optionals.match"},
                                                                        "type": {
                                                                          "function": {
                                                                            "domain": {"variable": "hydra.core.model.Term"},
                                                                            "codomain": {
                                                                              "either": {
                                                                                "left": {"variable": "hydra.core.errors.DecodingError"},
                                                                                "right": {"variable": "hydra.core.query.ComparisonConstraint"}}}}}}},
                                                                    "type": {
                                                                      "either": {
                                                                        "left": {"variable": "hydra.core.errors.DecodingError"},
                                                                        "right": {"variable": "hydra.core.query.ComparisonConstraint"}}}}},
                                                                "argument": {
                                                                  "application": {
                                                                    "function": {
                                                                      "application": {
                                                                        "function": {
                                                                          "typeApplication": {
                                                                            "body": {"typeApplication": {"body": {"variable": "hydra.core.lib.maps.lookup"}, "type": {"variable": "hydra.core.model.Name"}}},
                                                                            "type": {
                                                                              "function": {
                                                                                "domain": {"variable": "hydra.core.model.Term"},
                                                                                "codomain": {
                                                                                  "either": {
                                                                                    "left": {"variable": "hydra.core.errors.DecodingError"},
                                                                                    "right": {"variable": "hydra.core.query.ComparisonConstraint"}}}}}}},
                                                                        "argument": {"variable": "fname"}}},
                                                                    "argument": {"variable": "variantMap"}}}}},
                                                            "argument": {
                                                              "typeApplication": {
                                                                "body": {
                                                                  "typeApplication": {
                                                                    "body": {
                                                                      "either": {
                                                                        "left": {
                                                                          "wrap": {
                                                                            "typeName": "hydra.core.errors.DecodingError",
                                                                            "body": {
                                                                              "application": {
                                                                                "function": {"variable": "hydra.core.lib.strings.concat"},
                                                                                "argument": {
                                                                                  "list": [
                                                                                    {"literal": {"string": "no such field "}},
                                                                                    {"application": {"function": {"unwrap": "hydra.core.model.Name"}, "argument": {"variable": "fname"}}},
                                                                                    {"literal": {"string": " in union"}}]}}}}}}},
                                                                    "type": {"variable": "hydra.core.errors.DecodingError"}}},
                                                                "type": {"variable": "hydra.core.query.ComparisonConstraint"}}}}},
                                                        "argument": {
                                                          "lambda": {
                                                            "parameter": "f",
                                                            "domain": {
                                                              "function": {
                                                                "domain": {"variable": "hydra.core.model.Term"},
                                                                "codomain": {
                                                                  "either": {
                                                                    "left": {"variable": "hydra.core.errors.DecodingError"},
                                                                    "right": {"variable": "hydra.core.query.ComparisonConstraint"}}}}},
                                                            "body": {"application": {"function": {"variable": "f"}, "argument": {"variable": "fterm"}}}}}}}}}}}}]}},
                                    "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.query.ComparisonConstraint"}}}]}}}}},
    {
      "term": {
        "name": "hydra.core.decode.query.edge",
        "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.query.Edge"}}}}},
        "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.query.Edge"}}}}},
                                "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.query.Edge"}}}}}}},
                            "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.query.Edge"}}}}}},
                                                "type": {"variable": "hydra.core.errors.DecodingError"}}},
                                            "type": {"variable": "hydra.core.query.Edge"}}},
                                        "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": {"variable": "hydra.core.model.Name"}}},
                                                                "type": {"variable": "hydra.core.query.Edge"}}},
                                                            "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": {"variable": "hydra.core.model.Name"}}},
                                                                            "argument": {"literal": {"string": "type"}}}},
                                                                        "argument": {"variable": "hydra.core.decode.model.name"}}},
                                                                    "argument": {"variable": "fieldMap"}}},
                                                                "argument": {"variable": "cx"}}}}},
                                                        "argument": {
                                                          "lambda": {
                                                            "parameter": "field_type",
                                                            "domain": {"variable": "hydra.core.model.Name"},
                                                            "body": {
                                                              "application": {
                                                                "function": {
                                                                  "application": {
                                                                    "function": {
                                                                      "typeApplication": {
                                                                        "body": {
                                                                          "typeApplication": {
                                                                            "body": {
                                                                              "typeApplication": {"body": {"variable": "hydra.core.lib.eithers.bind"}, "type": {"variable": "hydra.core.errors.DecodingError"}}},
                                                                            "type": {"optional": {"variable": "hydra.core.model.Name"}}}},
                                                                        "type": {"variable": "hydra.core.query.Edge"}}},
                                                                    "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": {"optional": {"variable": "hydra.core.model.Name"}}}},
                                                                                    "argument": {"literal": {"string": "out"}}}},
                                                                                "argument": {
                                                                                  "application": {
                                                                                    "function": {
                                                                                      "typeApplication": {"body": {"variable": "hydra.core.extract.model.decodeMaybe"}, "type": {"variable": "hydra.core.model.Name"}}},
                                                                                    "argument": {"variable": "hydra.core.decode.model.name"}}}}},
                                                                            "argument": {"variable": "fieldMap"}}},
                                                                        "argument": {"variable": "cx"}}}}},
                                                                "argument": {
                                                                  "lambda": {
                                                                    "parameter": "field_out",
                                                                    "domain": {"optional": {"variable": "hydra.core.model.Name"}},
                                                                    "body": {
                                                                      "application": {
                                                                        "function": {
                                                                          "application": {
                                                                            "function": {
                                                                              "typeApplication": {
                                                                                "body": {
                                                                                  "typeApplication": {
                                                                                    "body": {
                                                                                      "typeApplication": {"body": {"variable": "hydra.core.lib.eithers.bind"}, "type": {"variable": "hydra.core.errors.DecodingError"}}},
                                                                                    "type": {"optional": {"variable": "hydra.core.model.Name"}}}},
                                                                                "type": {"variable": "hydra.core.query.Edge"}}},
                                                                            "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": {"optional": {"variable": "hydra.core.model.Name"}}}},
                                                                                            "argument": {"literal": {"string": "in"}}}},
                                                                                        "argument": {
                                                                                          "application": {
                                                                                            "function": {
                                                                                              "typeApplication": {"body": {"variable": "hydra.core.extract.model.decodeMaybe"}, "type": {"variable": "hydra.core.model.Name"}}},
                                                                                            "argument": {"variable": "hydra.core.decode.model.name"}}}}},
                                                                                    "argument": {"variable": "fieldMap"}}},
                                                                                "argument": {"variable": "cx"}}}}},
                                                                        "argument": {
                                                                          "lambda": {
                                                                            "parameter": "field_in",
                                                                            "domain": {"optional": {"variable": "hydra.core.model.Name"}},
                                                                            "body": {
                                                                              "typeApplication": {
                                                                                "body": {
                                                                                  "typeApplication": {
                                                                                    "body": {
                                                                                      "either": {
                                                                                        "right": {
                                                                                          "record": {
                                                                                            "typeName": "hydra.core.query.Edge",
                                                                                            "fields": [
                                                                                              {"name": "type", "term": {"variable": "field_type"}},
                                                                                              {"name": "out", "term": {"variable": "field_out"}},
                                                                                              {"name": "in", "term": {"variable": "field_in"}}]}}}},
                                                                                    "type": {"variable": "hydra.core.errors.DecodingError"}}},
                                                                                "type": {"variable": "hydra.core.query.Edge"}}}}}}}}}}}}}}}}}}}}]}},
                                    "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.query.Edge"}}}]}}}}},
    {
      "term": {
        "name": "hydra.core.decode.query.graphPattern",
        "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.query.GraphPattern"}}}}},
        "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.query.GraphPattern"}}}}},
                                "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.query.GraphPattern"}}}}}}},
                            "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.query.GraphPattern"}}}}}},
                                                "type": {"variable": "hydra.core.errors.DecodingError"}}},
                                            "type": {"variable": "hydra.core.query.GraphPattern"}}},
                                        "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": {"variable": "hydra.core.model.Name"}}},
                                                                "type": {"variable": "hydra.core.query.GraphPattern"}}},
                                                            "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": {"variable": "hydra.core.model.Name"}}},
                                                                            "argument": {"literal": {"string": "graph"}}}},
                                                                        "argument": {"variable": "hydra.core.decode.model.name"}}},
                                                                    "argument": {"variable": "fieldMap"}}},
                                                                "argument": {"variable": "cx"}}}}},
                                                        "argument": {
                                                          "lambda": {
                                                            "parameter": "field_graph",
                                                            "domain": {"variable": "hydra.core.model.Name"},
                                                            "body": {
                                                              "application": {
                                                                "function": {
                                                                  "application": {
                                                                    "function": {
                                                                      "typeApplication": {
                                                                        "body": {
                                                                          "typeApplication": {
                                                                            "body": {
                                                                              "typeApplication": {"body": {"variable": "hydra.core.lib.eithers.bind"}, "type": {"variable": "hydra.core.errors.DecodingError"}}},
                                                                            "type": {"list": {"variable": "hydra.core.query.Pattern"}}}},
                                                                        "type": {"variable": "hydra.core.query.GraphPattern"}}},
                                                                    "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": {"list": {"variable": "hydra.core.query.Pattern"}}}},
                                                                                    "argument": {"literal": {"string": "patterns"}}}},
                                                                                "argument": {
                                                                                  "application": {
                                                                                    "function": {
                                                                                      "typeApplication": {"body": {"variable": "hydra.core.extract.model.decodeList"}, "type": {"variable": "hydra.core.query.Pattern"}}},
                                                                                    "argument": {"variable": "hydra.core.decode.query.pattern"}}}}},
                                                                            "argument": {"variable": "fieldMap"}}},
                                                                        "argument": {"variable": "cx"}}}}},
                                                                "argument": {
                                                                  "lambda": {
                                                                    "parameter": "field_patterns",
                                                                    "domain": {"list": {"variable": "hydra.core.query.Pattern"}},
                                                                    "body": {
                                                                      "typeApplication": {
                                                                        "body": {
                                                                          "typeApplication": {
                                                                            "body": {
                                                                              "either": {
                                                                                "right": {
                                                                                  "record": {
                                                                                    "typeName": "hydra.core.query.GraphPattern",
                                                                                    "fields": [{"name": "graph", "term": {"variable": "field_graph"}}, {"name": "patterns", "term": {"variable": "field_patterns"}}]}}}},
                                                                            "type": {"variable": "hydra.core.errors.DecodingError"}}},
                                                                        "type": {"variable": "hydra.core.query.GraphPattern"}}}}}}}}}}}}}}}}]}},
                                    "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.query.GraphPattern"}}}]}}}}},
    {
      "term": {
        "name": "hydra.core.decode.query.node",
        "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.query.Node"}}}}},
        "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.query.Node"}}}}},
                                "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.query.Node"}}}}}}},
                            "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 union"}}}}}},
                                                "type": {"variable": "hydra.core.errors.DecodingError"}}},
                                            "type": {"variable": "hydra.core.query.Node"}}},
                                        "cases": [
                                          {
                                            "name": "inject",
                                            "handler": {
                                              "lambda": {
                                                "parameter": "inj",
                                                "domain": {"variable": "hydra.core.model.Injection"},
                                                "body": {
                                                  "let": {
                                                    "bindings": [
                                                      {
                                                        "name": "field",
                                                        "term": {
                                                          "application": {
                                                            "function": {"project": {"typeName": "hydra.core.model.Injection", "fieldName": "field"}},
                                                            "argument": {"variable": "inj"}}},
                                                        "typeScheme": {"variables": [], "body": {"variable": "hydra.core.model.Field"}, "constraints": []}},
                                                      {
                                                        "name": "fname",
                                                        "term": {
                                                          "application": {
                                                            "function": {"project": {"typeName": "hydra.core.model.Field", "fieldName": "name"}},
                                                            "argument": {"variable": "field"}}},
                                                        "typeScheme": {"variables": [], "body": {"variable": "hydra.core.model.Name"}, "constraints": []}},
                                                      {
                                                        "name": "fterm",
                                                        "term": {
                                                          "application": {
                                                            "function": {"project": {"typeName": "hydra.core.model.Field", "fieldName": "term"}},
                                                            "argument": {"variable": "field"}}},
                                                        "typeScheme": {"variables": [], "body": {"variable": "hydra.core.model.Term"}, "constraints": []}},
                                                      {
                                                        "name": "variantMap",
                                                        "term": {
                                                          "application": {
                                                            "function": {
                                                              "typeApplication": {
                                                                "body": {
                                                                  "typeApplication": {"body": {"variable": "hydra.core.lib.maps.fromList"}, "type": {"variable": "hydra.core.model.Name"}}},
                                                                "type": {
                                                                  "function": {
                                                                    "domain": {"variable": "hydra.core.model.Term"},
                                                                    "codomain": {"either": {"left": {"variable": "hydra.core.errors.DecodingError"}, "right": {"variable": "hydra.core.query.Node"}}}}}}},
                                                            "argument": {
                                                              "list": [
                                                                {
                                                                  "typeApplication": {
                                                                    "body": {
                                                                      "typeApplication": {
                                                                        "body": {
                                                                          "pair": {
                                                                            "first": {"wrap": {"typeName": "hydra.core.model.Name", "body": {"literal": {"string": "term"}}}},
                                                                            "second": {
                                                                              "lambda": {
                                                                                "parameter": "input",
                                                                                "domain": {"variable": "hydra.core.model.Term"},
                                                                                "body": {
                                                                                  "application": {
                                                                                    "function": {
                                                                                      "application": {
                                                                                        "function": {
                                                                                          "typeApplication": {
                                                                                            "body": {
                                                                                              "typeApplication": {
                                                                                                "body": {"typeApplication": {"body": {"variable": "hydra.core.lib.eithers.map"}, "type": {"variable": "hydra.core.model.Term"}}},
                                                                                                "type": {"variable": "hydra.core.query.Node"}}},
                                                                                            "type": {"variable": "hydra.core.errors.DecodingError"}}},
                                                                                        "argument": {
                                                                                          "lambda": {
                                                                                            "parameter": "t",
                                                                                            "domain": {"variable": "hydra.core.model.Term"},
                                                                                            "body": {"inject": {"typeName": "hydra.core.query.Node", "field": {"name": "term", "term": {"variable": "t"}}}}}}}},
                                                                                    "argument": {
                                                                                      "application": {
                                                                                        "function": {"application": {"function": {"variable": "hydra.core.decode.model.term"}, "argument": {"variable": "cx"}}},
                                                                                        "argument": {"variable": "input"}}}}}}}}},
                                                                        "type": {"variable": "hydra.core.model.Name"}}},
                                                                    "type": {
                                                                      "function": {
                                                                        "domain": {"variable": "hydra.core.model.Term"},
                                                                        "codomain": {"either": {"left": {"variable": "hydra.core.errors.DecodingError"}, "right": {"variable": "hydra.core.query.Node"}}}}}}},
                                                                {
                                                                  "typeApplication": {
                                                                    "body": {
                                                                      "typeApplication": {
                                                                        "body": {
                                                                          "pair": {
                                                                            "first": {"wrap": {"typeName": "hydra.core.model.Name", "body": {"literal": {"string": "variable"}}}},
                                                                            "second": {
                                                                              "lambda": {
                                                                                "parameter": "input",
                                                                                "domain": {"variable": "hydra.core.model.Term"},
                                                                                "body": {
                                                                                  "application": {
                                                                                    "function": {
                                                                                      "application": {
                                                                                        "function": {
                                                                                          "typeApplication": {
                                                                                            "body": {
                                                                                              "typeApplication": {
                                                                                                "body": {
                                                                                                  "typeApplication": {"body": {"variable": "hydra.core.lib.eithers.map"}, "type": {"variable": "hydra.core.query.Variable"}}},
                                                                                                "type": {"variable": "hydra.core.query.Node"}}},
                                                                                            "type": {"variable": "hydra.core.errors.DecodingError"}}},
                                                                                        "argument": {
                                                                                          "lambda": {
                                                                                            "parameter": "t",
                                                                                            "domain": {"variable": "hydra.core.query.Variable"},
                                                                                            "body": {"inject": {"typeName": "hydra.core.query.Node", "field": {"name": "variable", "term": {"variable": "t"}}}}}}}},
                                                                                    "argument": {
                                                                                      "application": {
                                                                                        "function": {"application": {"function": {"variable": "hydra.core.decode.query.variable"}, "argument": {"variable": "cx"}}},
                                                                                        "argument": {"variable": "input"}}}}}}}}},
                                                                        "type": {"variable": "hydra.core.model.Name"}}},
                                                                    "type": {
                                                                      "function": {
                                                                        "domain": {"variable": "hydra.core.model.Term"},
                                                                        "codomain": {"either": {"left": {"variable": "hydra.core.errors.DecodingError"}, "right": {"variable": "hydra.core.query.Node"}}}}}}},
                                                                {
                                                                  "typeApplication": {
                                                                    "body": {
                                                                      "typeApplication": {
                                                                        "body": {
                                                                          "pair": {
                                                                            "first": {"wrap": {"typeName": "hydra.core.model.Name", "body": {"literal": {"string": "wildcard"}}}},
                                                                            "second": {
                                                                              "lambda": {
                                                                                "parameter": "input",
                                                                                "domain": {"variable": "hydra.core.model.Term"},
                                                                                "body": {
                                                                                  "application": {
                                                                                    "function": {
                                                                                      "application": {
                                                                                        "function": {
                                                                                          "typeApplication": {
                                                                                            "body": {
                                                                                              "typeApplication": {
                                                                                                "body": {"typeApplication": {"body": {"variable": "hydra.core.lib.eithers.map"}, "type": "unit"}},
                                                                                                "type": {"variable": "hydra.core.query.Node"}}},
                                                                                            "type": {"variable": "hydra.core.errors.DecodingError"}}},
                                                                                        "argument": {
                                                                                          "lambda": {
                                                                                            "parameter": "t",
                                                                                            "domain": "unit",
                                                                                            "body": {"inject": {"typeName": "hydra.core.query.Node", "field": {"name": "wildcard", "term": {"variable": "t"}}}}}}}},
                                                                                    "argument": {
                                                                                      "application": {
                                                                                        "function": {
                                                                                          "application": {
                                                                                            "function": {
                                                                                              "lambda": {
                                                                                                "parameter": "cx",
                                                                                                "domain": {"variable": "hydra.core.graph.Graph"},
                                                                                                "body": {
                                                                                                  "lambda": {
                                                                                                    "parameter": "t",
                                                                                                    "domain": {"variable": "hydra.core.model.Term"},
                                                                                                    "body": {
                                                                                                      "application": {
                                                                                                        "function": {"application": {"function": {"variable": "hydra.core.extract.model.decodeUnit"}, "argument": {"variable": "cx"}}},
                                                                                                        "argument": {"variable": "t"}}}}}}},
                                                                                            "argument": {"variable": "cx"}}},
                                                                                        "argument": {"variable": "input"}}}}}}}}},
                                                                        "type": {"variable": "hydra.core.model.Name"}}},
                                                                    "type": {
                                                                      "function": {
                                                                        "domain": {"variable": "hydra.core.model.Term"},
                                                                        "codomain": {"either": {"left": {"variable": "hydra.core.errors.DecodingError"}, "right": {"variable": "hydra.core.query.Node"}}}}}}}]}}},
                                                        "typeScheme": {
                                                          "variables": [],
                                                          "body": {
                                                            "map": {
                                                              "keys": {"variable": "hydra.core.model.Name"},
                                                              "values": {
                                                                "function": {
                                                                  "domain": {"variable": "hydra.core.model.Term"},
                                                                  "codomain": {"either": {"left": {"variable": "hydra.core.errors.DecodingError"}, "right": {"variable": "hydra.core.query.Node"}}}}}}},
                                                          "constraints": []}}],
                                                    "body": {
                                                      "application": {
                                                        "function": {
                                                          "application": {
                                                            "function": {
                                                              "application": {
                                                                "function": {
                                                                  "typeApplication": {
                                                                    "body": {
                                                                      "typeApplication": {
                                                                        "body": {"variable": "hydra.core.lib.optionals.match"},
                                                                        "type": {
                                                                          "function": {
                                                                            "domain": {"variable": "hydra.core.model.Term"},
                                                                            "codomain": {"either": {"left": {"variable": "hydra.core.errors.DecodingError"}, "right": {"variable": "hydra.core.query.Node"}}}}}}},
                                                                    "type": {"either": {"left": {"variable": "hydra.core.errors.DecodingError"}, "right": {"variable": "hydra.core.query.Node"}}}}},
                                                                "argument": {
                                                                  "application": {
                                                                    "function": {
                                                                      "application": {
                                                                        "function": {
                                                                          "typeApplication": {
                                                                            "body": {"typeApplication": {"body": {"variable": "hydra.core.lib.maps.lookup"}, "type": {"variable": "hydra.core.model.Name"}}},
                                                                            "type": {
                                                                              "function": {
                                                                                "domain": {"variable": "hydra.core.model.Term"},
                                                                                "codomain": {"either": {"left": {"variable": "hydra.core.errors.DecodingError"}, "right": {"variable": "hydra.core.query.Node"}}}}}}},
                                                                        "argument": {"variable": "fname"}}},
                                                                    "argument": {"variable": "variantMap"}}}}},
                                                            "argument": {
                                                              "typeApplication": {
                                                                "body": {
                                                                  "typeApplication": {
                                                                    "body": {
                                                                      "either": {
                                                                        "left": {
                                                                          "wrap": {
                                                                            "typeName": "hydra.core.errors.DecodingError",
                                                                            "body": {
                                                                              "application": {
                                                                                "function": {"variable": "hydra.core.lib.strings.concat"},
                                                                                "argument": {
                                                                                  "list": [
                                                                                    {"literal": {"string": "no such field "}},
                                                                                    {"application": {"function": {"unwrap": "hydra.core.model.Name"}, "argument": {"variable": "fname"}}},
                                                                                    {"literal": {"string": " in union"}}]}}}}}}},
                                                                    "type": {"variable": "hydra.core.errors.DecodingError"}}},
                                                                "type": {"variable": "hydra.core.query.Node"}}}}},
                                                        "argument": {
                                                          "lambda": {
                                                            "parameter": "f",
                                                            "domain": {
                                                              "function": {
                                                                "domain": {"variable": "hydra.core.model.Term"},
                                                                "codomain": {"either": {"left": {"variable": "hydra.core.errors.DecodingError"}, "right": {"variable": "hydra.core.query.Node"}}}}},
                                                            "body": {"application": {"function": {"variable": "f"}, "argument": {"variable": "fterm"}}}}}}}}}}}}]}},
                                    "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.query.Node"}}}]}}}}},
    {
      "term": {
        "name": "hydra.core.decode.query.path",
        "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.query.Path"}}}}},
        "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.query.Path"}}}}},
                                "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.query.Path"}}}}}}},
                            "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 union"}}}}}},
                                                "type": {"variable": "hydra.core.errors.DecodingError"}}},
                                            "type": {"variable": "hydra.core.query.Path"}}},
                                        "cases": [
                                          {
                                            "name": "inject",
                                            "handler": {
                                              "lambda": {
                                                "parameter": "inj",
                                                "domain": {"variable": "hydra.core.model.Injection"},
                                                "body": {
                                                  "let": {
                                                    "bindings": [
                                                      {
                                                        "name": "field",
                                                        "term": {
                                                          "application": {
                                                            "function": {"project": {"typeName": "hydra.core.model.Injection", "fieldName": "field"}},
                                                            "argument": {"variable": "inj"}}},
                                                        "typeScheme": {"variables": [], "body": {"variable": "hydra.core.model.Field"}, "constraints": []}},
                                                      {
                                                        "name": "fname",
                                                        "term": {
                                                          "application": {
                                                            "function": {"project": {"typeName": "hydra.core.model.Field", "fieldName": "name"}},
                                                            "argument": {"variable": "field"}}},
                                                        "typeScheme": {"variables": [], "body": {"variable": "hydra.core.model.Name"}, "constraints": []}},
                                                      {
                                                        "name": "fterm",
                                                        "term": {
                                                          "application": {
                                                            "function": {"project": {"typeName": "hydra.core.model.Field", "fieldName": "term"}},
                                                            "argument": {"variable": "field"}}},
                                                        "typeScheme": {"variables": [], "body": {"variable": "hydra.core.model.Term"}, "constraints": []}},
                                                      {
                                                        "name": "variantMap",
                                                        "term": {
                                                          "application": {
                                                            "function": {
                                                              "typeApplication": {
                                                                "body": {
                                                                  "typeApplication": {"body": {"variable": "hydra.core.lib.maps.fromList"}, "type": {"variable": "hydra.core.model.Name"}}},
                                                                "type": {
                                                                  "function": {
                                                                    "domain": {"variable": "hydra.core.model.Term"},
                                                                    "codomain": {"either": {"left": {"variable": "hydra.core.errors.DecodingError"}, "right": {"variable": "hydra.core.query.Path"}}}}}}},
                                                            "argument": {
                                                              "list": [
                                                                {
                                                                  "typeApplication": {
                                                                    "body": {
                                                                      "typeApplication": {
                                                                        "body": {
                                                                          "pair": {
                                                                            "first": {"wrap": {"typeName": "hydra.core.model.Name", "body": {"literal": {"string": "step"}}}},
                                                                            "second": {
                                                                              "lambda": {
                                                                                "parameter": "input",
                                                                                "domain": {"variable": "hydra.core.model.Term"},
                                                                                "body": {
                                                                                  "application": {
                                                                                    "function": {
                                                                                      "application": {
                                                                                        "function": {
                                                                                          "typeApplication": {
                                                                                            "body": {
                                                                                              "typeApplication": {
                                                                                                "body": {"typeApplication": {"body": {"variable": "hydra.core.lib.eithers.map"}, "type": {"variable": "hydra.core.query.Step"}}},
                                                                                                "type": {"variable": "hydra.core.query.Path"}}},
                                                                                            "type": {"variable": "hydra.core.errors.DecodingError"}}},
                                                                                        "argument": {
                                                                                          "lambda": {
                                                                                            "parameter": "t",
                                                                                            "domain": {"variable": "hydra.core.query.Step"},
                                                                                            "body": {"inject": {"typeName": "hydra.core.query.Path", "field": {"name": "step", "term": {"variable": "t"}}}}}}}},
                                                                                    "argument": {
                                                                                      "application": {
                                                                                        "function": {"application": {"function": {"variable": "hydra.core.decode.query.step"}, "argument": {"variable": "cx"}}},
                                                                                        "argument": {"variable": "input"}}}}}}}}},
                                                                        "type": {"variable": "hydra.core.model.Name"}}},
                                                                    "type": {
                                                                      "function": {
                                                                        "domain": {"variable": "hydra.core.model.Term"},
                                                                        "codomain": {"either": {"left": {"variable": "hydra.core.errors.DecodingError"}, "right": {"variable": "hydra.core.query.Path"}}}}}}},
                                                                {
                                                                  "typeApplication": {
                                                                    "body": {
                                                                      "typeApplication": {
                                                                        "body": {
                                                                          "pair": {
                                                                            "first": {"wrap": {"typeName": "hydra.core.model.Name", "body": {"literal": {"string": "regex"}}}},
                                                                            "second": {
                                                                              "lambda": {
                                                                                "parameter": "input",
                                                                                "domain": {"variable": "hydra.core.model.Term"},
                                                                                "body": {
                                                                                  "application": {
                                                                                    "function": {
                                                                                      "application": {
                                                                                        "function": {
                                                                                          "typeApplication": {
                                                                                            "body": {
                                                                                              "typeApplication": {
                                                                                                "body": {
                                                                                                  "typeApplication": {"body": {"variable": "hydra.core.lib.eithers.map"}, "type": {"variable": "hydra.core.query.RegexSequence"}}},
                                                                                                "type": {"variable": "hydra.core.query.Path"}}},
                                                                                            "type": {"variable": "hydra.core.errors.DecodingError"}}},
                                                                                        "argument": {
                                                                                          "lambda": {
                                                                                            "parameter": "t",
                                                                                            "domain": {"variable": "hydra.core.query.RegexSequence"},
                                                                                            "body": {"inject": {"typeName": "hydra.core.query.Path", "field": {"name": "regex", "term": {"variable": "t"}}}}}}}},
                                                                                    "argument": {
                                                                                      "application": {
                                                                                        "function": {"application": {"function": {"variable": "hydra.core.decode.query.regexSequence"}, "argument": {"variable": "cx"}}},
                                                                                        "argument": {"variable": "input"}}}}}}}}},
                                                                        "type": {"variable": "hydra.core.model.Name"}}},
                                                                    "type": {
                                                                      "function": {
                                                                        "domain": {"variable": "hydra.core.model.Term"},
                                                                        "codomain": {"either": {"left": {"variable": "hydra.core.errors.DecodingError"}, "right": {"variable": "hydra.core.query.Path"}}}}}}},
                                                                {
                                                                  "typeApplication": {
                                                                    "body": {
                                                                      "typeApplication": {
                                                                        "body": {
                                                                          "pair": {
                                                                            "first": {"wrap": {"typeName": "hydra.core.model.Name", "body": {"literal": {"string": "inverse"}}}},
                                                                            "second": {
                                                                              "lambda": {
                                                                                "parameter": "input",
                                                                                "domain": {"variable": "hydra.core.model.Term"},
                                                                                "body": {
                                                                                  "application": {
                                                                                    "function": {
                                                                                      "application": {
                                                                                        "function": {
                                                                                          "typeApplication": {
                                                                                            "body": {
                                                                                              "typeApplication": {
                                                                                                "body": {"typeApplication": {"body": {"variable": "hydra.core.lib.eithers.map"}, "type": {"variable": "hydra.core.query.Path"}}},
                                                                                                "type": {"variable": "hydra.core.query.Path"}}},
                                                                                            "type": {"variable": "hydra.core.errors.DecodingError"}}},
                                                                                        "argument": {
                                                                                          "lambda": {
                                                                                            "parameter": "t",
                                                                                            "domain": {"variable": "hydra.core.query.Path"},
                                                                                            "body": {"inject": {"typeName": "hydra.core.query.Path", "field": {"name": "inverse", "term": {"variable": "t"}}}}}}}},
                                                                                    "argument": {
                                                                                      "application": {
                                                                                        "function": {"application": {"function": {"variable": "hydra.core.decode.query.path"}, "argument": {"variable": "cx"}}},
                                                                                        "argument": {"variable": "input"}}}}}}}}},
                                                                        "type": {"variable": "hydra.core.model.Name"}}},
                                                                    "type": {
                                                                      "function": {
                                                                        "domain": {"variable": "hydra.core.model.Term"},
                                                                        "codomain": {"either": {"left": {"variable": "hydra.core.errors.DecodingError"}, "right": {"variable": "hydra.core.query.Path"}}}}}}}]}}},
                                                        "typeScheme": {
                                                          "variables": [],
                                                          "body": {
                                                            "map": {
                                                              "keys": {"variable": "hydra.core.model.Name"},
                                                              "values": {
                                                                "function": {
                                                                  "domain": {"variable": "hydra.core.model.Term"},
                                                                  "codomain": {"either": {"left": {"variable": "hydra.core.errors.DecodingError"}, "right": {"variable": "hydra.core.query.Path"}}}}}}},
                                                          "constraints": []}}],
                                                    "body": {
                                                      "application": {
                                                        "function": {
                                                          "application": {
                                                            "function": {
                                                              "application": {
                                                                "function": {
                                                                  "typeApplication": {
                                                                    "body": {
                                                                      "typeApplication": {
                                                                        "body": {"variable": "hydra.core.lib.optionals.match"},
                                                                        "type": {
                                                                          "function": {
                                                                            "domain": {"variable": "hydra.core.model.Term"},
                                                                            "codomain": {"either": {"left": {"variable": "hydra.core.errors.DecodingError"}, "right": {"variable": "hydra.core.query.Path"}}}}}}},
                                                                    "type": {"either": {"left": {"variable": "hydra.core.errors.DecodingError"}, "right": {"variable": "hydra.core.query.Path"}}}}},
                                                                "argument": {
                                                                  "application": {
                                                                    "function": {
                                                                      "application": {
                                                                        "function": {
                                                                          "typeApplication": {
                                                                            "body": {"typeApplication": {"body": {"variable": "hydra.core.lib.maps.lookup"}, "type": {"variable": "hydra.core.model.Name"}}},
                                                                            "type": {
                                                                              "function": {
                                                                                "domain": {"variable": "hydra.core.model.Term"},
                                                                                "codomain": {"either": {"left": {"variable": "hydra.core.errors.DecodingError"}, "right": {"variable": "hydra.core.query.Path"}}}}}}},
                                                                        "argument": {"variable": "fname"}}},
                                                                    "argument": {"variable": "variantMap"}}}}},
                                                            "argument": {
                                                              "typeApplication": {
                                                                "body": {
                                                                  "typeApplication": {
                                                                    "body": {
                                                                      "either": {
                                                                        "left": {
                                                                          "wrap": {
                                                                            "typeName": "hydra.core.errors.DecodingError",
                                                                            "body": {
                                                                              "application": {
                                                                                "function": {"variable": "hydra.core.lib.strings.concat"},
                                                                                "argument": {
                                                                                  "list": [
                                                                                    {"literal": {"string": "no such field "}},
                                                                                    {"application": {"function": {"unwrap": "hydra.core.model.Name"}, "argument": {"variable": "fname"}}},
                                                                                    {"literal": {"string": " in union"}}]}}}}}}},
                                                                    "type": {"variable": "hydra.core.errors.DecodingError"}}},
                                                                "type": {"variable": "hydra.core.query.Path"}}}}},
                                                        "argument": {
                                                          "lambda": {
                                                            "parameter": "f",
                                                            "domain": {
                                                              "function": {
                                                                "domain": {"variable": "hydra.core.model.Term"},
                                                                "codomain": {"either": {"left": {"variable": "hydra.core.errors.DecodingError"}, "right": {"variable": "hydra.core.query.Path"}}}}},
                                                            "body": {"application": {"function": {"variable": "f"}, "argument": {"variable": "fterm"}}}}}}}}}}}}]}},
                                    "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.query.Path"}}}]}}}}},
    {
      "term": {
        "name": "hydra.core.decode.query.pathEquation",
        "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.query.PathEquation"}}}}},
        "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.query.PathEquation"}}}}},
                                "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.query.PathEquation"}}}}}}},
                            "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.query.PathEquation"}}}}}},
                                                "type": {"variable": "hydra.core.errors.DecodingError"}}},
                                            "type": {"variable": "hydra.core.query.PathEquation"}}},
                                        "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": {"variable": "hydra.core.query.Path"}}},
                                                                "type": {"variable": "hydra.core.query.PathEquation"}}},
                                                            "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": {"variable": "hydra.core.query.Path"}}},
                                                                            "argument": {"literal": {"string": "left"}}}},
                                                                        "argument": {"variable": "hydra.core.decode.query.path"}}},
                                                                    "argument": {"variable": "fieldMap"}}},
                                                                "argument": {"variable": "cx"}}}}},
                                                        "argument": {
                                                          "lambda": {
                                                            "parameter": "field_left",
                                                            "domain": {"variable": "hydra.core.query.Path"},
                                                            "body": {
                                                              "application": {
                                                                "function": {
                                                                  "application": {
                                                                    "function": {
                                                                      "typeApplication": {
                                                                        "body": {
                                                                          "typeApplication": {
                                                                            "body": {
                                                                              "typeApplication": {"body": {"variable": "hydra.core.lib.eithers.bind"}, "type": {"variable": "hydra.core.errors.DecodingError"}}},
                                                                            "type": {"variable": "hydra.core.query.Path"}}},
                                                                        "type": {"variable": "hydra.core.query.PathEquation"}}},
                                                                    "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": {"variable": "hydra.core.query.Path"}}},
                                                                                    "argument": {"literal": {"string": "right"}}}},
                                                                                "argument": {"variable": "hydra.core.decode.query.path"}}},
                                                                            "argument": {"variable": "fieldMap"}}},
                                                                        "argument": {"variable": "cx"}}}}},
                                                                "argument": {
                                                                  "lambda": {
                                                                    "parameter": "field_right",
                                                                    "domain": {"variable": "hydra.core.query.Path"},
                                                                    "body": {
                                                                      "typeApplication": {
                                                                        "body": {
                                                                          "typeApplication": {
                                                                            "body": {
                                                                              "either": {
                                                                                "right": {
                                                                                  "record": {
                                                                                    "typeName": "hydra.core.query.PathEquation",
                                                                                    "fields": [{"name": "left", "term": {"variable": "field_left"}}, {"name": "right", "term": {"variable": "field_right"}}]}}}},
                                                                            "type": {"variable": "hydra.core.errors.DecodingError"}}},
                                                                        "type": {"variable": "hydra.core.query.PathEquation"}}}}}}}}}}}}}}}}]}},
                                    "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.query.PathEquation"}}}]}}}}},
    {
      "term": {
        "name": "hydra.core.decode.query.pattern",
        "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.query.Pattern"}}}}},
        "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.query.Pattern"}}}}},
                                "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.query.Pattern"}}}}}}},
                            "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 union"}}}}}},
                                                "type": {"variable": "hydra.core.errors.DecodingError"}}},
                                            "type": {"variable": "hydra.core.query.Pattern"}}},
                                        "cases": [
                                          {
                                            "name": "inject",
                                            "handler": {
                                              "lambda": {
                                                "parameter": "inj",
                                                "domain": {"variable": "hydra.core.model.Injection"},
                                                "body": {
                                                  "let": {
                                                    "bindings": [
                                                      {
                                                        "name": "field",
                                                        "term": {
                                                          "application": {
                                                            "function": {"project": {"typeName": "hydra.core.model.Injection", "fieldName": "field"}},
                                                            "argument": {"variable": "inj"}}},
                                                        "typeScheme": {"variables": [], "body": {"variable": "hydra.core.model.Field"}, "constraints": []}},
                                                      {
                                                        "name": "fname",
                                                        "term": {
                                                          "application": {
                                                            "function": {"project": {"typeName": "hydra.core.model.Field", "fieldName": "name"}},
                                                            "argument": {"variable": "field"}}},
                                                        "typeScheme": {"variables": [], "body": {"variable": "hydra.core.model.Name"}, "constraints": []}},
                                                      {
                                                        "name": "fterm",
                                                        "term": {
                                                          "application": {
                                                            "function": {"project": {"typeName": "hydra.core.model.Field", "fieldName": "term"}},
                                                            "argument": {"variable": "field"}}},
                                                        "typeScheme": {"variables": [], "body": {"variable": "hydra.core.model.Term"}, "constraints": []}},
                                                      {
                                                        "name": "variantMap",
                                                        "term": {
                                                          "application": {
                                                            "function": {
                                                              "typeApplication": {
                                                                "body": {
                                                                  "typeApplication": {"body": {"variable": "hydra.core.lib.maps.fromList"}, "type": {"variable": "hydra.core.model.Name"}}},
                                                                "type": {
                                                                  "function": {
                                                                    "domain": {"variable": "hydra.core.model.Term"},
                                                                    "codomain": {"either": {"left": {"variable": "hydra.core.errors.DecodingError"}, "right": {"variable": "hydra.core.query.Pattern"}}}}}}},
                                                            "argument": {
                                                              "list": [
                                                                {
                                                                  "typeApplication": {
                                                                    "body": {
                                                                      "typeApplication": {
                                                                        "body": {
                                                                          "pair": {
                                                                            "first": {"wrap": {"typeName": "hydra.core.model.Name", "body": {"literal": {"string": "triple"}}}},
                                                                            "second": {
                                                                              "lambda": {
                                                                                "parameter": "input",
                                                                                "domain": {"variable": "hydra.core.model.Term"},
                                                                                "body": {
                                                                                  "application": {
                                                                                    "function": {
                                                                                      "application": {
                                                                                        "function": {
                                                                                          "typeApplication": {
                                                                                            "body": {
                                                                                              "typeApplication": {
                                                                                                "body": {
                                                                                                  "typeApplication": {"body": {"variable": "hydra.core.lib.eithers.map"}, "type": {"variable": "hydra.core.query.TriplePattern"}}},
                                                                                                "type": {"variable": "hydra.core.query.Pattern"}}},
                                                                                            "type": {"variable": "hydra.core.errors.DecodingError"}}},
                                                                                        "argument": {
                                                                                          "lambda": {
                                                                                            "parameter": "t",
                                                                                            "domain": {"variable": "hydra.core.query.TriplePattern"},
                                                                                            "body": {"inject": {"typeName": "hydra.core.query.Pattern", "field": {"name": "triple", "term": {"variable": "t"}}}}}}}},
                                                                                    "argument": {
                                                                                      "application": {
                                                                                        "function": {"application": {"function": {"variable": "hydra.core.decode.query.triplePattern"}, "argument": {"variable": "cx"}}},
                                                                                        "argument": {"variable": "input"}}}}}}}}},
                                                                        "type": {"variable": "hydra.core.model.Name"}}},
                                                                    "type": {
                                                                      "function": {
                                                                        "domain": {"variable": "hydra.core.model.Term"},
                                                                        "codomain": {"either": {"left": {"variable": "hydra.core.errors.DecodingError"}, "right": {"variable": "hydra.core.query.Pattern"}}}}}}},
                                                                {
                                                                  "typeApplication": {
                                                                    "body": {
                                                                      "typeApplication": {
                                                                        "body": {
                                                                          "pair": {
                                                                            "first": {"wrap": {"typeName": "hydra.core.model.Name", "body": {"literal": {"string": "negation"}}}},
                                                                            "second": {
                                                                              "lambda": {
                                                                                "parameter": "input",
                                                                                "domain": {"variable": "hydra.core.model.Term"},
                                                                                "body": {
                                                                                  "application": {
                                                                                    "function": {
                                                                                      "application": {
                                                                                        "function": {
                                                                                          "typeApplication": {
                                                                                            "body": {
                                                                                              "typeApplication": {
                                                                                                "body": {
                                                                                                  "typeApplication": {"body": {"variable": "hydra.core.lib.eithers.map"}, "type": {"variable": "hydra.core.query.Pattern"}}},
                                                                                                "type": {"variable": "hydra.core.query.Pattern"}}},
                                                                                            "type": {"variable": "hydra.core.errors.DecodingError"}}},
                                                                                        "argument": {
                                                                                          "lambda": {
                                                                                            "parameter": "t",
                                                                                            "domain": {"variable": "hydra.core.query.Pattern"},
                                                                                            "body": {"inject": {"typeName": "hydra.core.query.Pattern", "field": {"name": "negation", "term": {"variable": "t"}}}}}}}},
                                                                                    "argument": {
                                                                                      "application": {
                                                                                        "function": {"application": {"function": {"variable": "hydra.core.decode.query.pattern"}, "argument": {"variable": "cx"}}},
                                                                                        "argument": {"variable": "input"}}}}}}}}},
                                                                        "type": {"variable": "hydra.core.model.Name"}}},
                                                                    "type": {
                                                                      "function": {
                                                                        "domain": {"variable": "hydra.core.model.Term"},
                                                                        "codomain": {"either": {"left": {"variable": "hydra.core.errors.DecodingError"}, "right": {"variable": "hydra.core.query.Pattern"}}}}}}},
                                                                {
                                                                  "typeApplication": {
                                                                    "body": {
                                                                      "typeApplication": {
                                                                        "body": {
                                                                          "pair": {
                                                                            "first": {"wrap": {"typeName": "hydra.core.model.Name", "body": {"literal": {"string": "conjunction"}}}},
                                                                            "second": {
                                                                              "lambda": {
                                                                                "parameter": "input",
                                                                                "domain": {"variable": "hydra.core.model.Term"},
                                                                                "body": {
                                                                                  "application": {
                                                                                    "function": {
                                                                                      "application": {
                                                                                        "function": {
                                                                                          "typeApplication": {
                                                                                            "body": {
                                                                                              "typeApplication": {
                                                                                                "body": {
                                                                                                  "typeApplication": {"body": {"variable": "hydra.core.lib.eithers.map"}, "type": {"list": {"variable": "hydra.core.query.Pattern"}}}},
                                                                                                "type": {"variable": "hydra.core.query.Pattern"}}},
                                                                                            "type": {"variable": "hydra.core.errors.DecodingError"}}},
                                                                                        "argument": {
                                                                                          "lambda": {
                                                                                            "parameter": "t",
                                                                                            "domain": {"list": {"variable": "hydra.core.query.Pattern"}},
                                                                                            "body": {"inject": {"typeName": "hydra.core.query.Pattern", "field": {"name": "conjunction", "term": {"variable": "t"}}}}}}}},
                                                                                    "argument": {
                                                                                      "application": {
                                                                                        "function": {
                                                                                          "application": {
                                                                                            "function": {
                                                                                              "application": {
                                                                                                "function": {
                                                                                                  "typeApplication": {"body": {"variable": "hydra.core.extract.model.decodeList"}, "type": {"variable": "hydra.core.query.Pattern"}}},
                                                                                                "argument": {"variable": "hydra.core.decode.query.pattern"}}},
                                                                                            "argument": {"variable": "cx"}}},
                                                                                        "argument": {"variable": "input"}}}}}}}}},
                                                                        "type": {"variable": "hydra.core.model.Name"}}},
                                                                    "type": {
                                                                      "function": {
                                                                        "domain": {"variable": "hydra.core.model.Term"},
                                                                        "codomain": {"either": {"left": {"variable": "hydra.core.errors.DecodingError"}, "right": {"variable": "hydra.core.query.Pattern"}}}}}}},
                                                                {
                                                                  "typeApplication": {
                                                                    "body": {
                                                                      "typeApplication": {
                                                                        "body": {
                                                                          "pair": {
                                                                            "first": {"wrap": {"typeName": "hydra.core.model.Name", "body": {"literal": {"string": "disjunction"}}}},
                                                                            "second": {
                                                                              "lambda": {
                                                                                "parameter": "input",
                                                                                "domain": {"variable": "hydra.core.model.Term"},
                                                                                "body": {
                                                                                  "application": {
                                                                                    "function": {
                                                                                      "application": {
                                                                                        "function": {
                                                                                          "typeApplication": {
                                                                                            "body": {
                                                                                              "typeApplication": {
                                                                                                "body": {
                                                                                                  "typeApplication": {"body": {"variable": "hydra.core.lib.eithers.map"}, "type": {"list": {"variable": "hydra.core.query.Pattern"}}}},
                                                                                                "type": {"variable": "hydra.core.query.Pattern"}}},
                                                                                            "type": {"variable": "hydra.core.errors.DecodingError"}}},
                                                                                        "argument": {
                                                                                          "lambda": {
                                                                                            "parameter": "t",
                                                                                            "domain": {"list": {"variable": "hydra.core.query.Pattern"}},
                                                                                            "body": {"inject": {"typeName": "hydra.core.query.Pattern", "field": {"name": "disjunction", "term": {"variable": "t"}}}}}}}},
                                                                                    "argument": {
                                                                                      "application": {
                                                                                        "function": {
                                                                                          "application": {
                                                                                            "function": {
                                                                                              "application": {
                                                                                                "function": {
                                                                                                  "typeApplication": {"body": {"variable": "hydra.core.extract.model.decodeList"}, "type": {"variable": "hydra.core.query.Pattern"}}},
                                                                                                "argument": {"variable": "hydra.core.decode.query.pattern"}}},
                                                                                            "argument": {"variable": "cx"}}},
                                                                                        "argument": {"variable": "input"}}}}}}}}},
                                                                        "type": {"variable": "hydra.core.model.Name"}}},
                                                                    "type": {
                                                                      "function": {
                                                                        "domain": {"variable": "hydra.core.model.Term"},
                                                                        "codomain": {"either": {"left": {"variable": "hydra.core.errors.DecodingError"}, "right": {"variable": "hydra.core.query.Pattern"}}}}}}},
                                                                {
                                                                  "typeApplication": {
                                                                    "body": {
                                                                      "typeApplication": {
                                                                        "body": {
                                                                          "pair": {
                                                                            "first": {"wrap": {"typeName": "hydra.core.model.Name", "body": {"literal": {"string": "graph"}}}},
                                                                            "second": {
                                                                              "lambda": {
                                                                                "parameter": "input",
                                                                                "domain": {"variable": "hydra.core.model.Term"},
                                                                                "body": {
                                                                                  "application": {
                                                                                    "function": {
                                                                                      "application": {
                                                                                        "function": {
                                                                                          "typeApplication": {
                                                                                            "body": {
                                                                                              "typeApplication": {
                                                                                                "body": {
                                                                                                  "typeApplication": {"body": {"variable": "hydra.core.lib.eithers.map"}, "type": {"variable": "hydra.core.query.GraphPattern"}}},
                                                                                                "type": {"variable": "hydra.core.query.Pattern"}}},
                                                                                            "type": {"variable": "hydra.core.errors.DecodingError"}}},
                                                                                        "argument": {
                                                                                          "lambda": {
                                                                                            "parameter": "t",
                                                                                            "domain": {"variable": "hydra.core.query.GraphPattern"},
                                                                                            "body": {"inject": {"typeName": "hydra.core.query.Pattern", "field": {"name": "graph", "term": {"variable": "t"}}}}}}}},
                                                                                    "argument": {
                                                                                      "application": {
                                                                                        "function": {"application": {"function": {"variable": "hydra.core.decode.query.graphPattern"}, "argument": {"variable": "cx"}}},
                                                                                        "argument": {"variable": "input"}}}}}}}}},
                                                                        "type": {"variable": "hydra.core.model.Name"}}},
                                                                    "type": {
                                                                      "function": {
                                                                        "domain": {"variable": "hydra.core.model.Term"},
                                                                        "codomain": {"either": {"left": {"variable": "hydra.core.errors.DecodingError"}, "right": {"variable": "hydra.core.query.Pattern"}}}}}}}]}}},
                                                        "typeScheme": {
                                                          "variables": [],
                                                          "body": {
                                                            "map": {
                                                              "keys": {"variable": "hydra.core.model.Name"},
                                                              "values": {
                                                                "function": {
                                                                  "domain": {"variable": "hydra.core.model.Term"},
                                                                  "codomain": {"either": {"left": {"variable": "hydra.core.errors.DecodingError"}, "right": {"variable": "hydra.core.query.Pattern"}}}}}}},
                                                          "constraints": []}}],
                                                    "body": {
                                                      "application": {
                                                        "function": {
                                                          "application": {
                                                            "function": {
                                                              "application": {
                                                                "function": {
                                                                  "typeApplication": {
                                                                    "body": {
                                                                      "typeApplication": {
                                                                        "body": {"variable": "hydra.core.lib.optionals.match"},
                                                                        "type": {
                                                                          "function": {
                                                                            "domain": {"variable": "hydra.core.model.Term"},
                                                                            "codomain": {"either": {"left": {"variable": "hydra.core.errors.DecodingError"}, "right": {"variable": "hydra.core.query.Pattern"}}}}}}},
                                                                    "type": {"either": {"left": {"variable": "hydra.core.errors.DecodingError"}, "right": {"variable": "hydra.core.query.Pattern"}}}}},
                                                                "argument": {
                                                                  "application": {
                                                                    "function": {
                                                                      "application": {
                                                                        "function": {
                                                                          "typeApplication": {
                                                                            "body": {"typeApplication": {"body": {"variable": "hydra.core.lib.maps.lookup"}, "type": {"variable": "hydra.core.model.Name"}}},
                                                                            "type": {
                                                                              "function": {
                                                                                "domain": {"variable": "hydra.core.model.Term"},
                                                                                "codomain": {"either": {"left": {"variable": "hydra.core.errors.DecodingError"}, "right": {"variable": "hydra.core.query.Pattern"}}}}}}},
                                                                        "argument": {"variable": "fname"}}},
                                                                    "argument": {"variable": "variantMap"}}}}},
                                                            "argument": {
                                                              "typeApplication": {
                                                                "body": {
                                                                  "typeApplication": {
                                                                    "body": {
                                                                      "either": {
                                                                        "left": {
                                                                          "wrap": {
                                                                            "typeName": "hydra.core.errors.DecodingError",
                                                                            "body": {
                                                                              "application": {
                                                                                "function": {"variable": "hydra.core.lib.strings.concat"},
                                                                                "argument": {
                                                                                  "list": [
                                                                                    {"literal": {"string": "no such field "}},
                                                                                    {"application": {"function": {"unwrap": "hydra.core.model.Name"}, "argument": {"variable": "fname"}}},
                                                                                    {"literal": {"string": " in union"}}]}}}}}}},
                                                                    "type": {"variable": "hydra.core.errors.DecodingError"}}},
                                                                "type": {"variable": "hydra.core.query.Pattern"}}}}},
                                                        "argument": {
                                                          "lambda": {
                                                            "parameter": "f",
                                                            "domain": {
                                                              "function": {
                                                                "domain": {"variable": "hydra.core.model.Term"},
                                                                "codomain": {"either": {"left": {"variable": "hydra.core.errors.DecodingError"}, "right": {"variable": "hydra.core.query.Pattern"}}}}},
                                                            "body": {"application": {"function": {"variable": "f"}, "argument": {"variable": "fterm"}}}}}}}}}}}}]}},
                                    "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.query.Pattern"}}}]}}}}},
    {
      "term": {
        "name": "hydra.core.decode.query.patternImplication",
        "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.query.PatternImplication"}}}}},
        "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.query.PatternImplication"}}}}},
                                "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.query.PatternImplication"}}}}}}},
                            "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.query.PatternImplication"}}}}}},
                                                "type": {"variable": "hydra.core.errors.DecodingError"}}},
                                            "type": {"variable": "hydra.core.query.PatternImplication"}}},
                                        "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": {"variable": "hydra.core.query.Pattern"}}},
                                                                "type": {"variable": "hydra.core.query.PatternImplication"}}},
                                                            "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": {"variable": "hydra.core.query.Pattern"}}},
                                                                            "argument": {"literal": {"string": "antecedent"}}}},
                                                                        "argument": {"variable": "hydra.core.decode.query.pattern"}}},
                                                                    "argument": {"variable": "fieldMap"}}},
                                                                "argument": {"variable": "cx"}}}}},
                                                        "argument": {
                                                          "lambda": {
                                                            "parameter": "field_antecedent",
                                                            "domain": {"variable": "hydra.core.query.Pattern"},
                                                            "body": {
                                                              "application": {
                                                                "function": {
                                                                  "application": {
                                                                    "function": {
                                                                      "typeApplication": {
                                                                        "body": {
                                                                          "typeApplication": {
                                                                            "body": {
                                                                              "typeApplication": {"body": {"variable": "hydra.core.lib.eithers.bind"}, "type": {"variable": "hydra.core.errors.DecodingError"}}},
                                                                            "type": {"variable": "hydra.core.query.Pattern"}}},
                                                                        "type": {"variable": "hydra.core.query.PatternImplication"}}},
                                                                    "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": {"variable": "hydra.core.query.Pattern"}}},
                                                                                    "argument": {"literal": {"string": "consequent"}}}},
                                                                                "argument": {"variable": "hydra.core.decode.query.pattern"}}},
                                                                            "argument": {"variable": "fieldMap"}}},
                                                                        "argument": {"variable": "cx"}}}}},
                                                                "argument": {
                                                                  "lambda": {
                                                                    "parameter": "field_consequent",
                                                                    "domain": {"variable": "hydra.core.query.Pattern"},
                                                                    "body": {
                                                                      "typeApplication": {
                                                                        "body": {
                                                                          "typeApplication": {
                                                                            "body": {
                                                                              "either": {
                                                                                "right": {
                                                                                  "record": {
                                                                                    "typeName": "hydra.core.query.PatternImplication",
                                                                                    "fields": [
                                                                                      {"name": "antecedent", "term": {"variable": "field_antecedent"}},
                                                                                      {"name": "consequent", "term": {"variable": "field_consequent"}}]}}}},
                                                                            "type": {"variable": "hydra.core.errors.DecodingError"}}},
                                                                        "type": {"variable": "hydra.core.query.PatternImplication"}}}}}}}}}}}}}}}}]}},
                                    "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.query.PatternImplication"}}}]}}}}},
    {
      "term": {
        "name": "hydra.core.decode.query.query",
        "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.query.Query"}}}}},
        "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.query.Query"}}}}},
                                "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.query.Query"}}}}}}},
                            "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.query.Query"}}}}}},
                                                "type": {"variable": "hydra.core.errors.DecodingError"}}},
                                            "type": {"variable": "hydra.core.query.Query"}}},
                                        "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": {"list": {"variable": "hydra.core.query.Variable"}}}},
                                                                "type": {"variable": "hydra.core.query.Query"}}},
                                                            "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": {"list": {"variable": "hydra.core.query.Variable"}}}},
                                                                            "argument": {"literal": {"string": "variables"}}}},
                                                                        "argument": {
                                                                          "application": {
                                                                            "function": {
                                                                              "typeApplication": {"body": {"variable": "hydra.core.extract.model.decodeList"}, "type": {"variable": "hydra.core.query.Variable"}}},
                                                                            "argument": {"variable": "hydra.core.decode.query.variable"}}}}},
                                                                    "argument": {"variable": "fieldMap"}}},
                                                                "argument": {"variable": "cx"}}}}},
                                                        "argument": {
                                                          "lambda": {
                                                            "parameter": "field_variables",
                                                            "domain": {"list": {"variable": "hydra.core.query.Variable"}},
                                                            "body": {
                                                              "application": {
                                                                "function": {
                                                                  "application": {
                                                                    "function": {
                                                                      "typeApplication": {
                                                                        "body": {
                                                                          "typeApplication": {
                                                                            "body": {
                                                                              "typeApplication": {"body": {"variable": "hydra.core.lib.eithers.bind"}, "type": {"variable": "hydra.core.errors.DecodingError"}}},
                                                                            "type": {"list": {"variable": "hydra.core.query.Pattern"}}}},
                                                                        "type": {"variable": "hydra.core.query.Query"}}},
                                                                    "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": {"list": {"variable": "hydra.core.query.Pattern"}}}},
                                                                                    "argument": {"literal": {"string": "patterns"}}}},
                                                                                "argument": {
                                                                                  "application": {
                                                                                    "function": {
                                                                                      "typeApplication": {"body": {"variable": "hydra.core.extract.model.decodeList"}, "type": {"variable": "hydra.core.query.Pattern"}}},
                                                                                    "argument": {"variable": "hydra.core.decode.query.pattern"}}}}},
                                                                            "argument": {"variable": "fieldMap"}}},
                                                                        "argument": {"variable": "cx"}}}}},
                                                                "argument": {
                                                                  "lambda": {
                                                                    "parameter": "field_patterns",
                                                                    "domain": {"list": {"variable": "hydra.core.query.Pattern"}},
                                                                    "body": {
                                                                      "typeApplication": {
                                                                        "body": {
                                                                          "typeApplication": {
                                                                            "body": {
                                                                              "either": {
                                                                                "right": {
                                                                                  "record": {
                                                                                    "typeName": "hydra.core.query.Query",
                                                                                    "fields": [
                                                                                      {"name": "variables", "term": {"variable": "field_variables"}},
                                                                                      {"name": "patterns", "term": {"variable": "field_patterns"}}]}}}},
                                                                            "type": {"variable": "hydra.core.errors.DecodingError"}}},
                                                                        "type": {"variable": "hydra.core.query.Query"}}}}}}}}}}}}}}}}]}},
                                    "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.query.Query"}}}]}}}}},
    {
      "term": {
        "name": "hydra.core.decode.query.range",
        "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.query.Range"}}}}},
        "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.query.Range"}}}}},
                                "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.query.Range"}}}}}}},
                            "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.query.Range"}}}}}},
                                                "type": {"variable": "hydra.core.errors.DecodingError"}}},
                                            "type": {"variable": "hydra.core.query.Range"}}},
                                        "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": "int32"}}}},
                                                                "type": {"variable": "hydra.core.query.Range"}}},
                                                            "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": "int32"}}}},
                                                                            "argument": {"literal": {"string": "min"}}}},
                                                                        "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": "int32"}}}}}},
                                                                                            "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": "int32"}}}}}}}},
                                                                                        "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": "int32"}}}},
                                                                                                    "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 int32 literal"}}}}}},
                                                                                                                            "type": {"variable": "hydra.core.errors.DecodingError"}}},
                                                                                                                        "type": {"literal": {"integer": "int32"}}}},
                                                                                                                    "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 int32 value"}}}}}},
                                                                                                                                    "type": {"variable": "hydra.core.errors.DecodingError"}}},
                                                                                                                                "type": {"literal": {"integer": "int32"}}}},
                                                                                                                            "cases": [
                                                                                                                              {
                                                                                                                                "name": "int32",
                                                                                                                                "handler": {
                                                                                                                                  "lambda": {
                                                                                                                                    "parameter": "i",
                                                                                                                                    "domain": {"literal": {"integer": "int32"}},
                                                                                                                                    "body": {
                                                                                                                                      "typeApplication": {
                                                                                                                                        "body": {
                                                                                                                                          "typeApplication": {"body": {"either": {"right": {"variable": "i"}}}, "type": {"variable": "hydra.core.errors.DecodingError"}}},
                                                                                                                                        "type": {"literal": {"integer": "int32"}}}}}}}]}}}]}},
                                                                                                                "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_min",
                                                            "domain": {"literal": {"integer": "int32"}},
                                                            "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": "int32"}}}},
                                                                        "type": {"variable": "hydra.core.query.Range"}}},
                                                                    "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": "int32"}}}},
                                                                                    "argument": {"literal": {"string": "max"}}}},
                                                                                "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": "int32"}}}}}},
                                                                                                    "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": "int32"}}}}}}}},
                                                                                                "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": "int32"}}}},
                                                                                                            "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 int32 literal"}}}}}},
                                                                                                                                    "type": {"variable": "hydra.core.errors.DecodingError"}}},
                                                                                                                                "type": {"literal": {"integer": "int32"}}}},
                                                                                                                            "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 int32 value"}}}}}},
                                                                                                                                            "type": {"variable": "hydra.core.errors.DecodingError"}}},
                                                                                                                                        "type": {"literal": {"integer": "int32"}}}},
                                                                                                                                    "cases": [
                                                                                                                                      {
                                                                                                                                        "name": "int32",
                                                                                                                                        "handler": {
                                                                                                                                          "lambda": {
                                                                                                                                            "parameter": "i",
                                                                                                                                            "domain": {"literal": {"integer": "int32"}},
                                                                                                                                            "body": {
                                                                                                                                              "typeApplication": {
                                                                                                                                                "body": {
                                                                                                                                                  "typeApplication": {"body": {"either": {"right": {"variable": "i"}}}, "type": {"variable": "hydra.core.errors.DecodingError"}}},
                                                                                                                                                "type": {"literal": {"integer": "int32"}}}}}}}]}}}]}},
                                                                                                                        "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_max",
                                                                    "domain": {"literal": {"integer": "int32"}},
                                                                    "body": {
                                                                      "typeApplication": {
                                                                        "body": {
                                                                          "typeApplication": {
                                                                            "body": {
                                                                              "either": {
                                                                                "right": {
                                                                                  "record": {
                                                                                    "typeName": "hydra.core.query.Range",
                                                                                    "fields": [{"name": "min", "term": {"variable": "field_min"}}, {"name": "max", "term": {"variable": "field_max"}}]}}}},
                                                                            "type": {"variable": "hydra.core.errors.DecodingError"}}},
                                                                        "type": {"variable": "hydra.core.query.Range"}}}}}}}}}}}}}}}}]}},
                                    "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.query.Range"}}}]}}}}},
    {
      "term": {
        "name": "hydra.core.decode.query.regexQuantifier",
        "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.query.RegexQuantifier"}}}}},
        "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.query.RegexQuantifier"}}}}},
                                "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.query.RegexQuantifier"}}}}}}},
                            "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 union"}}}}}},
                                                "type": {"variable": "hydra.core.errors.DecodingError"}}},
                                            "type": {"variable": "hydra.core.query.RegexQuantifier"}}},
                                        "cases": [
                                          {
                                            "name": "inject",
                                            "handler": {
                                              "lambda": {
                                                "parameter": "inj",
                                                "domain": {"variable": "hydra.core.model.Injection"},
                                                "body": {
                                                  "let": {
                                                    "bindings": [
                                                      {
                                                        "name": "field",
                                                        "term": {
                                                          "application": {
                                                            "function": {"project": {"typeName": "hydra.core.model.Injection", "fieldName": "field"}},
                                                            "argument": {"variable": "inj"}}},
                                                        "typeScheme": {"variables": [], "body": {"variable": "hydra.core.model.Field"}, "constraints": []}},
                                                      {
                                                        "name": "fname",
                                                        "term": {
                                                          "application": {
                                                            "function": {"project": {"typeName": "hydra.core.model.Field", "fieldName": "name"}},
                                                            "argument": {"variable": "field"}}},
                                                        "typeScheme": {"variables": [], "body": {"variable": "hydra.core.model.Name"}, "constraints": []}},
                                                      {
                                                        "name": "fterm",
                                                        "term": {
                                                          "application": {
                                                            "function": {"project": {"typeName": "hydra.core.model.Field", "fieldName": "term"}},
                                                            "argument": {"variable": "field"}}},
                                                        "typeScheme": {"variables": [], "body": {"variable": "hydra.core.model.Term"}, "constraints": []}},
                                                      {
                                                        "name": "variantMap",
                                                        "term": {
                                                          "application": {
                                                            "function": {
                                                              "typeApplication": {
                                                                "body": {
                                                                  "typeApplication": {"body": {"variable": "hydra.core.lib.maps.fromList"}, "type": {"variable": "hydra.core.model.Name"}}},
                                                                "type": {
                                                                  "function": {
                                                                    "domain": {"variable": "hydra.core.model.Term"},
                                                                    "codomain": {
                                                                      "either": {"left": {"variable": "hydra.core.errors.DecodingError"}, "right": {"variable": "hydra.core.query.RegexQuantifier"}}}}}}},
                                                            "argument": {
                                                              "list": [
                                                                {
                                                                  "typeApplication": {
                                                                    "body": {
                                                                      "typeApplication": {
                                                                        "body": {
                                                                          "pair": {
                                                                            "first": {"wrap": {"typeName": "hydra.core.model.Name", "body": {"literal": {"string": "one"}}}},
                                                                            "second": {
                                                                              "lambda": {
                                                                                "parameter": "input",
                                                                                "domain": {"variable": "hydra.core.model.Term"},
                                                                                "body": {
                                                                                  "application": {
                                                                                    "function": {
                                                                                      "application": {
                                                                                        "function": {
                                                                                          "typeApplication": {
                                                                                            "body": {
                                                                                              "typeApplication": {
                                                                                                "body": {"typeApplication": {"body": {"variable": "hydra.core.lib.eithers.map"}, "type": "unit"}},
                                                                                                "type": {"variable": "hydra.core.query.RegexQuantifier"}}},
                                                                                            "type": {"variable": "hydra.core.errors.DecodingError"}}},
                                                                                        "argument": {
                                                                                          "lambda": {
                                                                                            "parameter": "t",
                                                                                            "domain": "unit",
                                                                                            "body": {"inject": {"typeName": "hydra.core.query.RegexQuantifier", "field": {"name": "one", "term": {"variable": "t"}}}}}}}},
                                                                                    "argument": {
                                                                                      "application": {
                                                                                        "function": {
                                                                                          "application": {
                                                                                            "function": {
                                                                                              "lambda": {
                                                                                                "parameter": "cx",
                                                                                                "domain": {"variable": "hydra.core.graph.Graph"},
                                                                                                "body": {
                                                                                                  "lambda": {
                                                                                                    "parameter": "t",
                                                                                                    "domain": {"variable": "hydra.core.model.Term"},
                                                                                                    "body": {
                                                                                                      "application": {
                                                                                                        "function": {"application": {"function": {"variable": "hydra.core.extract.model.decodeUnit"}, "argument": {"variable": "cx"}}},
                                                                                                        "argument": {"variable": "t"}}}}}}},
                                                                                            "argument": {"variable": "cx"}}},
                                                                                        "argument": {"variable": "input"}}}}}}}}},
                                                                        "type": {"variable": "hydra.core.model.Name"}}},
                                                                    "type": {
                                                                      "function": {
                                                                        "domain": {"variable": "hydra.core.model.Term"},
                                                                        "codomain": {
                                                                          "either": {"left": {"variable": "hydra.core.errors.DecodingError"}, "right": {"variable": "hydra.core.query.RegexQuantifier"}}}}}}},
                                                                {
                                                                  "typeApplication": {
                                                                    "body": {
                                                                      "typeApplication": {
                                                                        "body": {
                                                                          "pair": {
                                                                            "first": {"wrap": {"typeName": "hydra.core.model.Name", "body": {"literal": {"string": "zeroOrOne"}}}},
                                                                            "second": {
                                                                              "lambda": {
                                                                                "parameter": "input",
                                                                                "domain": {"variable": "hydra.core.model.Term"},
                                                                                "body": {
                                                                                  "application": {
                                                                                    "function": {
                                                                                      "application": {
                                                                                        "function": {
                                                                                          "typeApplication": {
                                                                                            "body": {
                                                                                              "typeApplication": {
                                                                                                "body": {"typeApplication": {"body": {"variable": "hydra.core.lib.eithers.map"}, "type": "unit"}},
                                                                                                "type": {"variable": "hydra.core.query.RegexQuantifier"}}},
                                                                                            "type": {"variable": "hydra.core.errors.DecodingError"}}},
                                                                                        "argument": {
                                                                                          "lambda": {
                                                                                            "parameter": "t",
                                                                                            "domain": "unit",
                                                                                            "body": {"inject": {"typeName": "hydra.core.query.RegexQuantifier", "field": {"name": "zeroOrOne", "term": {"variable": "t"}}}}}}}},
                                                                                    "argument": {
                                                                                      "application": {
                                                                                        "function": {
                                                                                          "application": {
                                                                                            "function": {
                                                                                              "lambda": {
                                                                                                "parameter": "cx",
                                                                                                "domain": {"variable": "hydra.core.graph.Graph"},
                                                                                                "body": {
                                                                                                  "lambda": {
                                                                                                    "parameter": "t",
                                                                                                    "domain": {"variable": "hydra.core.model.Term"},
                                                                                                    "body": {
                                                                                                      "application": {
                                                                                                        "function": {"application": {"function": {"variable": "hydra.core.extract.model.decodeUnit"}, "argument": {"variable": "cx"}}},
                                                                                                        "argument": {"variable": "t"}}}}}}},
                                                                                            "argument": {"variable": "cx"}}},
                                                                                        "argument": {"variable": "input"}}}}}}}}},
                                                                        "type": {"variable": "hydra.core.model.Name"}}},
                                                                    "type": {
                                                                      "function": {
                                                                        "domain": {"variable": "hydra.core.model.Term"},
                                                                        "codomain": {
                                                                          "either": {"left": {"variable": "hydra.core.errors.DecodingError"}, "right": {"variable": "hydra.core.query.RegexQuantifier"}}}}}}},
                                                                {
                                                                  "typeApplication": {
                                                                    "body": {
                                                                      "typeApplication": {
                                                                        "body": {
                                                                          "pair": {
                                                                            "first": {"wrap": {"typeName": "hydra.core.model.Name", "body": {"literal": {"string": "zeroOrMore"}}}},
                                                                            "second": {
                                                                              "lambda": {
                                                                                "parameter": "input",
                                                                                "domain": {"variable": "hydra.core.model.Term"},
                                                                                "body": {
                                                                                  "application": {
                                                                                    "function": {
                                                                                      "application": {
                                                                                        "function": {
                                                                                          "typeApplication": {
                                                                                            "body": {
                                                                                              "typeApplication": {
                                                                                                "body": {"typeApplication": {"body": {"variable": "hydra.core.lib.eithers.map"}, "type": "unit"}},
                                                                                                "type": {"variable": "hydra.core.query.RegexQuantifier"}}},
                                                                                            "type": {"variable": "hydra.core.errors.DecodingError"}}},
                                                                                        "argument": {
                                                                                          "lambda": {
                                                                                            "parameter": "t",
                                                                                            "domain": "unit",
                                                                                            "body": {"inject": {"typeName": "hydra.core.query.RegexQuantifier", "field": {"name": "zeroOrMore", "term": {"variable": "t"}}}}}}}},
                                                                                    "argument": {
                                                                                      "application": {
                                                                                        "function": {
                                                                                          "application": {
                                                                                            "function": {
                                                                                              "lambda": {
                                                                                                "parameter": "cx",
                                                                                                "domain": {"variable": "hydra.core.graph.Graph"},
                                                                                                "body": {
                                                                                                  "lambda": {
                                                                                                    "parameter": "t",
                                                                                                    "domain": {"variable": "hydra.core.model.Term"},
                                                                                                    "body": {
                                                                                                      "application": {
                                                                                                        "function": {"application": {"function": {"variable": "hydra.core.extract.model.decodeUnit"}, "argument": {"variable": "cx"}}},
                                                                                                        "argument": {"variable": "t"}}}}}}},
                                                                                            "argument": {"variable": "cx"}}},
                                                                                        "argument": {"variable": "input"}}}}}}}}},
                                                                        "type": {"variable": "hydra.core.model.Name"}}},
                                                                    "type": {
                                                                      "function": {
                                                                        "domain": {"variable": "hydra.core.model.Term"},
                                                                        "codomain": {
                                                                          "either": {"left": {"variable": "hydra.core.errors.DecodingError"}, "right": {"variable": "hydra.core.query.RegexQuantifier"}}}}}}},
                                                                {
                                                                  "typeApplication": {
                                                                    "body": {
                                                                      "typeApplication": {
                                                                        "body": {
                                                                          "pair": {
                                                                            "first": {"wrap": {"typeName": "hydra.core.model.Name", "body": {"literal": {"string": "oneOrMore"}}}},
                                                                            "second": {
                                                                              "lambda": {
                                                                                "parameter": "input",
                                                                                "domain": {"variable": "hydra.core.model.Term"},
                                                                                "body": {
                                                                                  "application": {
                                                                                    "function": {
                                                                                      "application": {
                                                                                        "function": {
                                                                                          "typeApplication": {
                                                                                            "body": {
                                                                                              "typeApplication": {
                                                                                                "body": {"typeApplication": {"body": {"variable": "hydra.core.lib.eithers.map"}, "type": "unit"}},
                                                                                                "type": {"variable": "hydra.core.query.RegexQuantifier"}}},
                                                                                            "type": {"variable": "hydra.core.errors.DecodingError"}}},
                                                                                        "argument": {
                                                                                          "lambda": {
                                                                                            "parameter": "t",
                                                                                            "domain": "unit",
                                                                                            "body": {"inject": {"typeName": "hydra.core.query.RegexQuantifier", "field": {"name": "oneOrMore", "term": {"variable": "t"}}}}}}}},
                                                                                    "argument": {
                                                                                      "application": {
                                                                                        "function": {
                                                                                          "application": {
                                                                                            "function": {
                                                                                              "lambda": {
                                                                                                "parameter": "cx",
                                                                                                "domain": {"variable": "hydra.core.graph.Graph"},
                                                                                                "body": {
                                                                                                  "lambda": {
                                                                                                    "parameter": "t",
                                                                                                    "domain": {"variable": "hydra.core.model.Term"},
                                                                                                    "body": {
                                                                                                      "application": {
                                                                                                        "function": {"application": {"function": {"variable": "hydra.core.extract.model.decodeUnit"}, "argument": {"variable": "cx"}}},
                                                                                                        "argument": {"variable": "t"}}}}}}},
                                                                                            "argument": {"variable": "cx"}}},
                                                                                        "argument": {"variable": "input"}}}}}}}}},
                                                                        "type": {"variable": "hydra.core.model.Name"}}},
                                                                    "type": {
                                                                      "function": {
                                                                        "domain": {"variable": "hydra.core.model.Term"},
                                                                        "codomain": {
                                                                          "either": {"left": {"variable": "hydra.core.errors.DecodingError"}, "right": {"variable": "hydra.core.query.RegexQuantifier"}}}}}}},
                                                                {
                                                                  "typeApplication": {
                                                                    "body": {
                                                                      "typeApplication": {
                                                                        "body": {
                                                                          "pair": {
                                                                            "first": {"wrap": {"typeName": "hydra.core.model.Name", "body": {"literal": {"string": "exactly"}}}},
                                                                            "second": {
                                                                              "lambda": {
                                                                                "parameter": "input",
                                                                                "domain": {"variable": "hydra.core.model.Term"},
                                                                                "body": {
                                                                                  "application": {
                                                                                    "function": {
                                                                                      "application": {
                                                                                        "function": {
                                                                                          "typeApplication": {
                                                                                            "body": {
                                                                                              "typeApplication": {
                                                                                                "body": {"typeApplication": {"body": {"variable": "hydra.core.lib.eithers.map"}, "type": {"literal": {"integer": "int32"}}}},
                                                                                                "type": {"variable": "hydra.core.query.RegexQuantifier"}}},
                                                                                            "type": {"variable": "hydra.core.errors.DecodingError"}}},
                                                                                        "argument": {
                                                                                          "lambda": {
                                                                                            "parameter": "t",
                                                                                            "domain": {"literal": {"integer": "int32"}},
                                                                                            "body": {"inject": {"typeName": "hydra.core.query.RegexQuantifier", "field": {"name": "exactly", "term": {"variable": "t"}}}}}}}},
                                                                                    "argument": {
                                                                                      "application": {
                                                                                        "function": {
                                                                                          "application": {
                                                                                            "function": {
                                                                                              "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": "int32"}}}}}},
                                                                                                                "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": "int32"}}}}}}}},
                                                                                                            "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": "int32"}}}},
                                                                                                                        "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 int32 literal"}}}}}},
                                                                                                                                                "type": {"variable": "hydra.core.errors.DecodingError"}}},
                                                                                                                                            "type": {"literal": {"integer": "int32"}}}},
                                                                                                                                        "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 int32 value"}}}}}},
                                                                                                                                                        "type": {"variable": "hydra.core.errors.DecodingError"}}},
                                                                                                                                                    "type": {"literal": {"integer": "int32"}}}},
                                                                                                                                                "cases": [
                                                                                                                                                  {
                                                                                                                                                    "name": "int32",
                                                                                                                                                    "handler": {
                                                                                                                                                      "lambda": {
                                                                                                                                                        "parameter": "i",
                                                                                                                                                        "domain": {"literal": {"integer": "int32"}},
                                                                                                                                                        "body": {
                                                                                                                                                          "typeApplication": {
                                                                                                                                                            "body": {
                                                                                                                                                              "typeApplication": {"body": {"either": {"right": {"variable": "i"}}}, "type": {"variable": "hydra.core.errors.DecodingError"}}},
                                                                                                                                                            "type": {"literal": {"integer": "int32"}}}}}}}]}}}]}},
                                                                                                                                    "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": "cx"}}},
                                                                                        "argument": {"variable": "input"}}}}}}}}},
                                                                        "type": {"variable": "hydra.core.model.Name"}}},
                                                                    "type": {
                                                                      "function": {
                                                                        "domain": {"variable": "hydra.core.model.Term"},
                                                                        "codomain": {
                                                                          "either": {"left": {"variable": "hydra.core.errors.DecodingError"}, "right": {"variable": "hydra.core.query.RegexQuantifier"}}}}}}},
                                                                {
                                                                  "typeApplication": {
                                                                    "body": {
                                                                      "typeApplication": {
                                                                        "body": {
                                                                          "pair": {
                                                                            "first": {"wrap": {"typeName": "hydra.core.model.Name", "body": {"literal": {"string": "atLeast"}}}},
                                                                            "second": {
                                                                              "lambda": {
                                                                                "parameter": "input",
                                                                                "domain": {"variable": "hydra.core.model.Term"},
                                                                                "body": {
                                                                                  "application": {
                                                                                    "function": {
                                                                                      "application": {
                                                                                        "function": {
                                                                                          "typeApplication": {
                                                                                            "body": {
                                                                                              "typeApplication": {
                                                                                                "body": {"typeApplication": {"body": {"variable": "hydra.core.lib.eithers.map"}, "type": {"literal": {"integer": "int32"}}}},
                                                                                                "type": {"variable": "hydra.core.query.RegexQuantifier"}}},
                                                                                            "type": {"variable": "hydra.core.errors.DecodingError"}}},
                                                                                        "argument": {
                                                                                          "lambda": {
                                                                                            "parameter": "t",
                                                                                            "domain": {"literal": {"integer": "int32"}},
                                                                                            "body": {"inject": {"typeName": "hydra.core.query.RegexQuantifier", "field": {"name": "atLeast", "term": {"variable": "t"}}}}}}}},
                                                                                    "argument": {
                                                                                      "application": {
                                                                                        "function": {
                                                                                          "application": {
                                                                                            "function": {
                                                                                              "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": "int32"}}}}}},
                                                                                                                "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": "int32"}}}}}}}},
                                                                                                            "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": "int32"}}}},
                                                                                                                        "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 int32 literal"}}}}}},
                                                                                                                                                "type": {"variable": "hydra.core.errors.DecodingError"}}},
                                                                                                                                            "type": {"literal": {"integer": "int32"}}}},
                                                                                                                                        "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 int32 value"}}}}}},
                                                                                                                                                        "type": {"variable": "hydra.core.errors.DecodingError"}}},
                                                                                                                                                    "type": {"literal": {"integer": "int32"}}}},
                                                                                                                                                "cases": [
                                                                                                                                                  {
                                                                                                                                                    "name": "int32",
                                                                                                                                                    "handler": {
                                                                                                                                                      "lambda": {
                                                                                                                                                        "parameter": "i",
                                                                                                                                                        "domain": {"literal": {"integer": "int32"}},
                                                                                                                                                        "body": {
                                                                                                                                                          "typeApplication": {
                                                                                                                                                            "body": {
                                                                                                                                                              "typeApplication": {"body": {"either": {"right": {"variable": "i"}}}, "type": {"variable": "hydra.core.errors.DecodingError"}}},
                                                                                                                                                            "type": {"literal": {"integer": "int32"}}}}}}}]}}}]}},
                                                                                                                                    "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": "cx"}}},
                                                                                        "argument": {"variable": "input"}}}}}}}}},
                                                                        "type": {"variable": "hydra.core.model.Name"}}},
                                                                    "type": {
                                                                      "function": {
                                                                        "domain": {"variable": "hydra.core.model.Term"},
                                                                        "codomain": {
                                                                          "either": {"left": {"variable": "hydra.core.errors.DecodingError"}, "right": {"variable": "hydra.core.query.RegexQuantifier"}}}}}}},
                                                                {
                                                                  "typeApplication": {
                                                                    "body": {
                                                                      "typeApplication": {
                                                                        "body": {
                                                                          "pair": {
                                                                            "first": {"wrap": {"typeName": "hydra.core.model.Name", "body": {"literal": {"string": "range"}}}},
                                                                            "second": {
                                                                              "lambda": {
                                                                                "parameter": "input",
                                                                                "domain": {"variable": "hydra.core.model.Term"},
                                                                                "body": {
                                                                                  "application": {
                                                                                    "function": {
                                                                                      "application": {
                                                                                        "function": {
                                                                                          "typeApplication": {
                                                                                            "body": {
                                                                                              "typeApplication": {
                                                                                                "body": {
                                                                                                  "typeApplication": {"body": {"variable": "hydra.core.lib.eithers.map"}, "type": {"variable": "hydra.core.query.Range"}}},
                                                                                                "type": {"variable": "hydra.core.query.RegexQuantifier"}}},
                                                                                            "type": {"variable": "hydra.core.errors.DecodingError"}}},
                                                                                        "argument": {
                                                                                          "lambda": {
                                                                                            "parameter": "t",
                                                                                            "domain": {"variable": "hydra.core.query.Range"},
                                                                                            "body": {"inject": {"typeName": "hydra.core.query.RegexQuantifier", "field": {"name": "range", "term": {"variable": "t"}}}}}}}},
                                                                                    "argument": {
                                                                                      "application": {
                                                                                        "function": {"application": {"function": {"variable": "hydra.core.decode.query.range"}, "argument": {"variable": "cx"}}},
                                                                                        "argument": {"variable": "input"}}}}}}}}},
                                                                        "type": {"variable": "hydra.core.model.Name"}}},
                                                                    "type": {
                                                                      "function": {
                                                                        "domain": {"variable": "hydra.core.model.Term"},
                                                                        "codomain": {
                                                                          "either": {"left": {"variable": "hydra.core.errors.DecodingError"}, "right": {"variable": "hydra.core.query.RegexQuantifier"}}}}}}}]}}},
                                                        "typeScheme": {
                                                          "variables": [],
                                                          "body": {
                                                            "map": {
                                                              "keys": {"variable": "hydra.core.model.Name"},
                                                              "values": {
                                                                "function": {
                                                                  "domain": {"variable": "hydra.core.model.Term"},
                                                                  "codomain": {
                                                                    "either": {"left": {"variable": "hydra.core.errors.DecodingError"}, "right": {"variable": "hydra.core.query.RegexQuantifier"}}}}}}},
                                                          "constraints": []}}],
                                                    "body": {
                                                      "application": {
                                                        "function": {
                                                          "application": {
                                                            "function": {
                                                              "application": {
                                                                "function": {
                                                                  "typeApplication": {
                                                                    "body": {
                                                                      "typeApplication": {
                                                                        "body": {"variable": "hydra.core.lib.optionals.match"},
                                                                        "type": {
                                                                          "function": {
                                                                            "domain": {"variable": "hydra.core.model.Term"},
                                                                            "codomain": {
                                                                              "either": {"left": {"variable": "hydra.core.errors.DecodingError"}, "right": {"variable": "hydra.core.query.RegexQuantifier"}}}}}}},
                                                                    "type": {
                                                                      "either": {"left": {"variable": "hydra.core.errors.DecodingError"}, "right": {"variable": "hydra.core.query.RegexQuantifier"}}}}},
                                                                "argument": {
                                                                  "application": {
                                                                    "function": {
                                                                      "application": {
                                                                        "function": {
                                                                          "typeApplication": {
                                                                            "body": {"typeApplication": {"body": {"variable": "hydra.core.lib.maps.lookup"}, "type": {"variable": "hydra.core.model.Name"}}},
                                                                            "type": {
                                                                              "function": {
                                                                                "domain": {"variable": "hydra.core.model.Term"},
                                                                                "codomain": {
                                                                                  "either": {"left": {"variable": "hydra.core.errors.DecodingError"}, "right": {"variable": "hydra.core.query.RegexQuantifier"}}}}}}},
                                                                        "argument": {"variable": "fname"}}},
                                                                    "argument": {"variable": "variantMap"}}}}},
                                                            "argument": {
                                                              "typeApplication": {
                                                                "body": {
                                                                  "typeApplication": {
                                                                    "body": {
                                                                      "either": {
                                                                        "left": {
                                                                          "wrap": {
                                                                            "typeName": "hydra.core.errors.DecodingError",
                                                                            "body": {
                                                                              "application": {
                                                                                "function": {"variable": "hydra.core.lib.strings.concat"},
                                                                                "argument": {
                                                                                  "list": [
                                                                                    {"literal": {"string": "no such field "}},
                                                                                    {"application": {"function": {"unwrap": "hydra.core.model.Name"}, "argument": {"variable": "fname"}}},
                                                                                    {"literal": {"string": " in union"}}]}}}}}}},
                                                                    "type": {"variable": "hydra.core.errors.DecodingError"}}},
                                                                "type": {"variable": "hydra.core.query.RegexQuantifier"}}}}},
                                                        "argument": {
                                                          "lambda": {
                                                            "parameter": "f",
                                                            "domain": {
                                                              "function": {
                                                                "domain": {"variable": "hydra.core.model.Term"},
                                                                "codomain": {
                                                                  "either": {"left": {"variable": "hydra.core.errors.DecodingError"}, "right": {"variable": "hydra.core.query.RegexQuantifier"}}}}},
                                                            "body": {"application": {"function": {"variable": "f"}, "argument": {"variable": "fterm"}}}}}}}}}}}}]}},
                                    "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.query.RegexQuantifier"}}}]}}}}},
    {
      "term": {
        "name": "hydra.core.decode.query.regexSequence",
        "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.query.RegexSequence"}}}}},
        "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.query.RegexSequence"}}}}},
                                "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.query.RegexSequence"}}}}}}},
                            "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.query.RegexSequence"}}}}}},
                                                "type": {"variable": "hydra.core.errors.DecodingError"}}},
                                            "type": {"variable": "hydra.core.query.RegexSequence"}}},
                                        "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": {"variable": "hydra.core.query.Path"}}},
                                                                "type": {"variable": "hydra.core.query.RegexSequence"}}},
                                                            "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": {"variable": "hydra.core.query.Path"}}},
                                                                            "argument": {"literal": {"string": "path"}}}},
                                                                        "argument": {"variable": "hydra.core.decode.query.path"}}},
                                                                    "argument": {"variable": "fieldMap"}}},
                                                                "argument": {"variable": "cx"}}}}},
                                                        "argument": {
                                                          "lambda": {
                                                            "parameter": "field_path",
                                                            "domain": {"variable": "hydra.core.query.Path"},
                                                            "body": {
                                                              "application": {
                                                                "function": {
                                                                  "application": {
                                                                    "function": {
                                                                      "typeApplication": {
                                                                        "body": {
                                                                          "typeApplication": {
                                                                            "body": {
                                                                              "typeApplication": {"body": {"variable": "hydra.core.lib.eithers.bind"}, "type": {"variable": "hydra.core.errors.DecodingError"}}},
                                                                            "type": {"variable": "hydra.core.query.RegexQuantifier"}}},
                                                                        "type": {"variable": "hydra.core.query.RegexSequence"}}},
                                                                    "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": {"variable": "hydra.core.query.RegexQuantifier"}}},
                                                                                    "argument": {"literal": {"string": "quantifier"}}}},
                                                                                "argument": {"variable": "hydra.core.decode.query.regexQuantifier"}}},
                                                                            "argument": {"variable": "fieldMap"}}},
                                                                        "argument": {"variable": "cx"}}}}},
                                                                "argument": {
                                                                  "lambda": {
                                                                    "parameter": "field_quantifier",
                                                                    "domain": {"variable": "hydra.core.query.RegexQuantifier"},
                                                                    "body": {
                                                                      "typeApplication": {
                                                                        "body": {
                                                                          "typeApplication": {
                                                                            "body": {
                                                                              "either": {
                                                                                "right": {
                                                                                  "record": {
                                                                                    "typeName": "hydra.core.query.RegexSequence",
                                                                                    "fields": [{"name": "path", "term": {"variable": "field_path"}}, {"name": "quantifier", "term": {"variable": "field_quantifier"}}]}}}},
                                                                            "type": {"variable": "hydra.core.errors.DecodingError"}}},
                                                                        "type": {"variable": "hydra.core.query.RegexSequence"}}}}}}}}}}}}}}}}]}},
                                    "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.query.RegexSequence"}}}]}}}}},
    {
      "term": {
        "name": "hydra.core.decode.query.step",
        "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.query.Step"}}}}},
        "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.query.Step"}}}}},
                                "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.query.Step"}}}}}}},
                            "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 union"}}}}}},
                                                "type": {"variable": "hydra.core.errors.DecodingError"}}},
                                            "type": {"variable": "hydra.core.query.Step"}}},
                                        "cases": [
                                          {
                                            "name": "inject",
                                            "handler": {
                                              "lambda": {
                                                "parameter": "inj",
                                                "domain": {"variable": "hydra.core.model.Injection"},
                                                "body": {
                                                  "let": {
                                                    "bindings": [
                                                      {
                                                        "name": "field",
                                                        "term": {
                                                          "application": {
                                                            "function": {"project": {"typeName": "hydra.core.model.Injection", "fieldName": "field"}},
                                                            "argument": {"variable": "inj"}}},
                                                        "typeScheme": {"variables": [], "body": {"variable": "hydra.core.model.Field"}, "constraints": []}},
                                                      {
                                                        "name": "fname",
                                                        "term": {
                                                          "application": {
                                                            "function": {"project": {"typeName": "hydra.core.model.Field", "fieldName": "name"}},
                                                            "argument": {"variable": "field"}}},
                                                        "typeScheme": {"variables": [], "body": {"variable": "hydra.core.model.Name"}, "constraints": []}},
                                                      {
                                                        "name": "fterm",
                                                        "term": {
                                                          "application": {
                                                            "function": {"project": {"typeName": "hydra.core.model.Field", "fieldName": "term"}},
                                                            "argument": {"variable": "field"}}},
                                                        "typeScheme": {"variables": [], "body": {"variable": "hydra.core.model.Term"}, "constraints": []}},
                                                      {
                                                        "name": "variantMap",
                                                        "term": {
                                                          "application": {
                                                            "function": {
                                                              "typeApplication": {
                                                                "body": {
                                                                  "typeApplication": {"body": {"variable": "hydra.core.lib.maps.fromList"}, "type": {"variable": "hydra.core.model.Name"}}},
                                                                "type": {
                                                                  "function": {
                                                                    "domain": {"variable": "hydra.core.model.Term"},
                                                                    "codomain": {"either": {"left": {"variable": "hydra.core.errors.DecodingError"}, "right": {"variable": "hydra.core.query.Step"}}}}}}},
                                                            "argument": {
                                                              "list": [
                                                                {
                                                                  "typeApplication": {
                                                                    "body": {
                                                                      "typeApplication": {
                                                                        "body": {
                                                                          "pair": {
                                                                            "first": {"wrap": {"typeName": "hydra.core.model.Name", "body": {"literal": {"string": "edge"}}}},
                                                                            "second": {
                                                                              "lambda": {
                                                                                "parameter": "input",
                                                                                "domain": {"variable": "hydra.core.model.Term"},
                                                                                "body": {
                                                                                  "application": {
                                                                                    "function": {
                                                                                      "application": {
                                                                                        "function": {
                                                                                          "typeApplication": {
                                                                                            "body": {
                                                                                              "typeApplication": {
                                                                                                "body": {"typeApplication": {"body": {"variable": "hydra.core.lib.eithers.map"}, "type": {"variable": "hydra.core.query.Edge"}}},
                                                                                                "type": {"variable": "hydra.core.query.Step"}}},
                                                                                            "type": {"variable": "hydra.core.errors.DecodingError"}}},
                                                                                        "argument": {
                                                                                          "lambda": {
                                                                                            "parameter": "t",
                                                                                            "domain": {"variable": "hydra.core.query.Edge"},
                                                                                            "body": {"inject": {"typeName": "hydra.core.query.Step", "field": {"name": "edge", "term": {"variable": "t"}}}}}}}},
                                                                                    "argument": {
                                                                                      "application": {
                                                                                        "function": {"application": {"function": {"variable": "hydra.core.decode.query.edge"}, "argument": {"variable": "cx"}}},
                                                                                        "argument": {"variable": "input"}}}}}}}}},
                                                                        "type": {"variable": "hydra.core.model.Name"}}},
                                                                    "type": {
                                                                      "function": {
                                                                        "domain": {"variable": "hydra.core.model.Term"},
                                                                        "codomain": {"either": {"left": {"variable": "hydra.core.errors.DecodingError"}, "right": {"variable": "hydra.core.query.Step"}}}}}}},
                                                                {
                                                                  "typeApplication": {
                                                                    "body": {
                                                                      "typeApplication": {
                                                                        "body": {
                                                                          "pair": {
                                                                            "first": {"wrap": {"typeName": "hydra.core.model.Name", "body": {"literal": {"string": "project"}}}},
                                                                            "second": {
                                                                              "lambda": {
                                                                                "parameter": "input",
                                                                                "domain": {"variable": "hydra.core.model.Term"},
                                                                                "body": {
                                                                                  "application": {
                                                                                    "function": {
                                                                                      "application": {
                                                                                        "function": {
                                                                                          "typeApplication": {
                                                                                            "body": {
                                                                                              "typeApplication": {
                                                                                                "body": {
                                                                                                  "typeApplication": {"body": {"variable": "hydra.core.lib.eithers.map"}, "type": {"variable": "hydra.core.model.Projection"}}},
                                                                                                "type": {"variable": "hydra.core.query.Step"}}},
                                                                                            "type": {"variable": "hydra.core.errors.DecodingError"}}},
                                                                                        "argument": {
                                                                                          "lambda": {
                                                                                            "parameter": "t",
                                                                                            "domain": {"variable": "hydra.core.model.Projection"},
                                                                                            "body": {"inject": {"typeName": "hydra.core.query.Step", "field": {"name": "project", "term": {"variable": "t"}}}}}}}},
                                                                                    "argument": {
                                                                                      "application": {
                                                                                        "function": {"application": {"function": {"variable": "hydra.core.decode.model.projection"}, "argument": {"variable": "cx"}}},
                                                                                        "argument": {"variable": "input"}}}}}}}}},
                                                                        "type": {"variable": "hydra.core.model.Name"}}},
                                                                    "type": {
                                                                      "function": {
                                                                        "domain": {"variable": "hydra.core.model.Term"},
                                                                        "codomain": {"either": {"left": {"variable": "hydra.core.errors.DecodingError"}, "right": {"variable": "hydra.core.query.Step"}}}}}}},
                                                                {
                                                                  "typeApplication": {
                                                                    "body": {
                                                                      "typeApplication": {
                                                                        "body": {
                                                                          "pair": {
                                                                            "first": {"wrap": {"typeName": "hydra.core.model.Name", "body": {"literal": {"string": "compare"}}}},
                                                                            "second": {
                                                                              "lambda": {
                                                                                "parameter": "input",
                                                                                "domain": {"variable": "hydra.core.model.Term"},
                                                                                "body": {
                                                                                  "application": {
                                                                                    "function": {
                                                                                      "application": {
                                                                                        "function": {
                                                                                          "typeApplication": {
                                                                                            "body": {
                                                                                              "typeApplication": {
                                                                                                "body": {
                                                                                                  "typeApplication": {"body": {"variable": "hydra.core.lib.eithers.map"}, "type": {"variable": "hydra.core.query.ComparisonConstraint"}}},
                                                                                                "type": {"variable": "hydra.core.query.Step"}}},
                                                                                            "type": {"variable": "hydra.core.errors.DecodingError"}}},
                                                                                        "argument": {
                                                                                          "lambda": {
                                                                                            "parameter": "t",
                                                                                            "domain": {"variable": "hydra.core.query.ComparisonConstraint"},
                                                                                            "body": {"inject": {"typeName": "hydra.core.query.Step", "field": {"name": "compare", "term": {"variable": "t"}}}}}}}},
                                                                                    "argument": {
                                                                                      "application": {
                                                                                        "function": {
                                                                                          "application": {"function": {"variable": "hydra.core.decode.query.comparisonConstraint"}, "argument": {"variable": "cx"}}},
                                                                                        "argument": {"variable": "input"}}}}}}}}},
                                                                        "type": {"variable": "hydra.core.model.Name"}}},
                                                                    "type": {
                                                                      "function": {
                                                                        "domain": {"variable": "hydra.core.model.Term"},
                                                                        "codomain": {"either": {"left": {"variable": "hydra.core.errors.DecodingError"}, "right": {"variable": "hydra.core.query.Step"}}}}}}}]}}},
                                                        "typeScheme": {
                                                          "variables": [],
                                                          "body": {
                                                            "map": {
                                                              "keys": {"variable": "hydra.core.model.Name"},
                                                              "values": {
                                                                "function": {
                                                                  "domain": {"variable": "hydra.core.model.Term"},
                                                                  "codomain": {"either": {"left": {"variable": "hydra.core.errors.DecodingError"}, "right": {"variable": "hydra.core.query.Step"}}}}}}},
                                                          "constraints": []}}],
                                                    "body": {
                                                      "application": {
                                                        "function": {
                                                          "application": {
                                                            "function": {
                                                              "application": {
                                                                "function": {
                                                                  "typeApplication": {
                                                                    "body": {
                                                                      "typeApplication": {
                                                                        "body": {"variable": "hydra.core.lib.optionals.match"},
                                                                        "type": {
                                                                          "function": {
                                                                            "domain": {"variable": "hydra.core.model.Term"},
                                                                            "codomain": {"either": {"left": {"variable": "hydra.core.errors.DecodingError"}, "right": {"variable": "hydra.core.query.Step"}}}}}}},
                                                                    "type": {"either": {"left": {"variable": "hydra.core.errors.DecodingError"}, "right": {"variable": "hydra.core.query.Step"}}}}},
                                                                "argument": {
                                                                  "application": {
                                                                    "function": {
                                                                      "application": {
                                                                        "function": {
                                                                          "typeApplication": {
                                                                            "body": {"typeApplication": {"body": {"variable": "hydra.core.lib.maps.lookup"}, "type": {"variable": "hydra.core.model.Name"}}},
                                                                            "type": {
                                                                              "function": {
                                                                                "domain": {"variable": "hydra.core.model.Term"},
                                                                                "codomain": {"either": {"left": {"variable": "hydra.core.errors.DecodingError"}, "right": {"variable": "hydra.core.query.Step"}}}}}}},
                                                                        "argument": {"variable": "fname"}}},
                                                                    "argument": {"variable": "variantMap"}}}}},
                                                            "argument": {
                                                              "typeApplication": {
                                                                "body": {
                                                                  "typeApplication": {
                                                                    "body": {
                                                                      "either": {
                                                                        "left": {
                                                                          "wrap": {
                                                                            "typeName": "hydra.core.errors.DecodingError",
                                                                            "body": {
                                                                              "application": {
                                                                                "function": {"variable": "hydra.core.lib.strings.concat"},
                                                                                "argument": {
                                                                                  "list": [
                                                                                    {"literal": {"string": "no such field "}},
                                                                                    {"application": {"function": {"unwrap": "hydra.core.model.Name"}, "argument": {"variable": "fname"}}},
                                                                                    {"literal": {"string": " in union"}}]}}}}}}},
                                                                    "type": {"variable": "hydra.core.errors.DecodingError"}}},
                                                                "type": {"variable": "hydra.core.query.Step"}}}}},
                                                        "argument": {
                                                          "lambda": {
                                                            "parameter": "f",
                                                            "domain": {
                                                              "function": {
                                                                "domain": {"variable": "hydra.core.model.Term"},
                                                                "codomain": {"either": {"left": {"variable": "hydra.core.errors.DecodingError"}, "right": {"variable": "hydra.core.query.Step"}}}}},
                                                            "body": {"application": {"function": {"variable": "f"}, "argument": {"variable": "fterm"}}}}}}}}}}}}]}},
                                    "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.query.Step"}}}]}}}}},
    {
      "term": {
        "name": "hydra.core.decode.query.triplePattern",
        "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.query.TriplePattern"}}}}},
        "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.query.TriplePattern"}}}}},
                                "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.query.TriplePattern"}}}}}}},
                            "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.query.TriplePattern"}}}}}},
                                                "type": {"variable": "hydra.core.errors.DecodingError"}}},
                                            "type": {"variable": "hydra.core.query.TriplePattern"}}},
                                        "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": {"variable": "hydra.core.query.Node"}}},
                                                                "type": {"variable": "hydra.core.query.TriplePattern"}}},
                                                            "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": {"variable": "hydra.core.query.Node"}}},
                                                                            "argument": {"literal": {"string": "subject"}}}},
                                                                        "argument": {"variable": "hydra.core.decode.query.node"}}},
                                                                    "argument": {"variable": "fieldMap"}}},
                                                                "argument": {"variable": "cx"}}}}},
                                                        "argument": {
                                                          "lambda": {
                                                            "parameter": "field_subject",
                                                            "domain": {"variable": "hydra.core.query.Node"},
                                                            "body": {
                                                              "application": {
                                                                "function": {
                                                                  "application": {
                                                                    "function": {
                                                                      "typeApplication": {
                                                                        "body": {
                                                                          "typeApplication": {
                                                                            "body": {
                                                                              "typeApplication": {"body": {"variable": "hydra.core.lib.eithers.bind"}, "type": {"variable": "hydra.core.errors.DecodingError"}}},
                                                                            "type": {"variable": "hydra.core.query.Path"}}},
                                                                        "type": {"variable": "hydra.core.query.TriplePattern"}}},
                                                                    "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": {"variable": "hydra.core.query.Path"}}},
                                                                                    "argument": {"literal": {"string": "predicate"}}}},
                                                                                "argument": {"variable": "hydra.core.decode.query.path"}}},
                                                                            "argument": {"variable": "fieldMap"}}},
                                                                        "argument": {"variable": "cx"}}}}},
                                                                "argument": {
                                                                  "lambda": {
                                                                    "parameter": "field_predicate",
                                                                    "domain": {"variable": "hydra.core.query.Path"},
                                                                    "body": {
                                                                      "application": {
                                                                        "function": {
                                                                          "application": {
                                                                            "function": {
                                                                              "typeApplication": {
                                                                                "body": {
                                                                                  "typeApplication": {
                                                                                    "body": {
                                                                                      "typeApplication": {"body": {"variable": "hydra.core.lib.eithers.bind"}, "type": {"variable": "hydra.core.errors.DecodingError"}}},
                                                                                    "type": {"variable": "hydra.core.query.Node"}}},
                                                                                "type": {"variable": "hydra.core.query.TriplePattern"}}},
                                                                            "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": {"variable": "hydra.core.query.Node"}}},
                                                                                            "argument": {"literal": {"string": "object"}}}},
                                                                                        "argument": {"variable": "hydra.core.decode.query.node"}}},
                                                                                    "argument": {"variable": "fieldMap"}}},
                                                                                "argument": {"variable": "cx"}}}}},
                                                                        "argument": {
                                                                          "lambda": {
                                                                            "parameter": "field_object",
                                                                            "domain": {"variable": "hydra.core.query.Node"},
                                                                            "body": {
                                                                              "typeApplication": {
                                                                                "body": {
                                                                                  "typeApplication": {
                                                                                    "body": {
                                                                                      "either": {
                                                                                        "right": {
                                                                                          "record": {
                                                                                            "typeName": "hydra.core.query.TriplePattern",
                                                                                            "fields": [
                                                                                              {"name": "subject", "term": {"variable": "field_subject"}},
                                                                                              {"name": "predicate", "term": {"variable": "field_predicate"}},
                                                                                              {"name": "object", "term": {"variable": "field_object"}}]}}}},
                                                                                    "type": {"variable": "hydra.core.errors.DecodingError"}}},
                                                                                "type": {"variable": "hydra.core.query.TriplePattern"}}}}}}}}}}}}}}}}}}}}]}},
                                    "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.query.TriplePattern"}}}]}}}}},
    {
      "term": {
        "name": "hydra.core.decode.query.variable",
        "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.query.Variable"}}}}},
        "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.query.Variable"}}}}},
                                "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.query.Variable"}}}}}}},
                            "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 wrapped type"}}}}}},
                                                "type": {"variable": "hydra.core.errors.DecodingError"}}},
                                            "type": {"variable": "hydra.core.query.Variable"}}},
                                        "cases": [
                                          {
                                            "name": "wrap",
                                            "handler": {
                                              "lambda": {
                                                "parameter": "wrappedTerm",
                                                "domain": {"variable": "hydra.core.model.WrappedTerm"},
                                                "body": {
                                                  "application": {
                                                    "function": {
                                                      "application": {
                                                        "function": {
                                                          "typeApplication": {
                                                            "body": {
                                                              "typeApplication": {
                                                                "body": {"typeApplication": {"body": {"variable": "hydra.core.lib.eithers.map"}, "type": {"literal": "string"}}},
                                                                "type": {"variable": "hydra.core.query.Variable"}}},
                                                            "type": {"variable": "hydra.core.errors.DecodingError"}}},
                                                        "argument": {
                                                          "lambda": {
                                                            "parameter": "b",
                                                            "domain": {"literal": "string"},
                                                            "body": {"wrap": {"typeName": "hydra.core.query.Variable", "body": {"variable": "b"}}}}}}},
                                                    "argument": {
                                                      "application": {
                                                        "function": {
                                                          "application": {
                                                            "function": {
                                                              "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": "string"}}}}},
                                                                                "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": "string"}}}}}}},
                                                                            "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": "string"}}},
                                                                                        "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 string literal"}}}}}},
                                                                                                                "type": {"variable": "hydra.core.errors.DecodingError"}}},
                                                                                                            "type": {"literal": "string"}}},
                                                                                                        "cases": [
                                                                                                          {
                                                                                                            "name": "string",
                                                                                                            "handler": {
                                                                                                              "lambda": {
                                                                                                                "parameter": "s",
                                                                                                                "domain": {"literal": "string"},
                                                                                                                "body": {
                                                                                                                  "typeApplication": {
                                                                                                                    "body": {
                                                                                                                      "typeApplication": {"body": {"either": {"right": {"variable": "s"}}}, "type": {"variable": "hydra.core.errors.DecodingError"}}},
                                                                                                                    "type": {"literal": "string"}}}}}}]}},
                                                                                                    "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": "cx"}}},
                                                        "argument": {
                                                          "application": {
                                                            "function": {"project": {"typeName": "hydra.core.model.WrappedTerm", "fieldName": "body"}},
                                                            "argument": {"variable": "wrappedTerm"}}}}}}}}}}]}},
                                    "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.query.Variable"}}}]}}}}}]}