packages feed

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

{
  "name": "hydra.core.decode.packaging",
  "metadata": {"description": "Term decoders for hydra.core.packaging", "comments": [], "seeAlso": [], "provisions": []},
  "dependencies": [
    {"module": "hydra.core.extract.model"},
    {"module": "hydra.core.lexical"},
    {"module": "hydra.core.rewriting"},
    {"module": "hydra.core.packaging"},
    {"module": "hydra.core.util"},
    {"module": "hydra.core.decode.model"},
    {"module": "hydra.core.decode.typing"}],
  "definitions": [
    {
      "term": {
        "name": "hydra.core.decode.packaging.definition",
        "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.packaging.Definition"}}}}},
        "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.packaging.Definition"}}}}},
                                "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.packaging.Definition"}}}}}}},
                            "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.packaging.Definition"}}},
                                        "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.packaging.Definition"}}}}}}},
                                                            "argument": {
                                                              "list": [
                                                                {
                                                                  "typeApplication": {
                                                                    "body": {
                                                                      "typeApplication": {
                                                                        "body": {
                                                                          "pair": {
                                                                            "first": {"wrap": {"typeName": "hydra.core.model.Name", "body": {"literal": {"string": "primitive"}}}},
                                                                            "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.packaging.PrimitiveDefinition"}}},
                                                                                                "type": {"variable": "hydra.core.packaging.Definition"}}},
                                                                                            "type": {"variable": "hydra.core.errors.DecodingError"}}},
                                                                                        "argument": {
                                                                                          "lambda": {
                                                                                            "parameter": "t",
                                                                                            "domain": {"variable": "hydra.core.packaging.PrimitiveDefinition"},
                                                                                            "body": {"inject": {"typeName": "hydra.core.packaging.Definition", "field": {"name": "primitive", "term": {"variable": "t"}}}}}}}},
                                                                                    "argument": {
                                                                                      "application": {
                                                                                        "function": {
                                                                                          "application": {"function": {"variable": "hydra.core.decode.packaging.primitiveDefinition"}, "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.packaging.Definition"}}}}}}},
                                                                {
                                                                  "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.packaging.TermDefinition"}}},
                                                                                                "type": {"variable": "hydra.core.packaging.Definition"}}},
                                                                                            "type": {"variable": "hydra.core.errors.DecodingError"}}},
                                                                                        "argument": {
                                                                                          "lambda": {
                                                                                            "parameter": "t",
                                                                                            "domain": {"variable": "hydra.core.packaging.TermDefinition"},
                                                                                            "body": {"inject": {"typeName": "hydra.core.packaging.Definition", "field": {"name": "term", "term": {"variable": "t"}}}}}}}},
                                                                                    "argument": {
                                                                                      "application": {
                                                                                        "function": {
                                                                                          "application": {"function": {"variable": "hydra.core.decode.packaging.termDefinition"}, "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.packaging.Definition"}}}}}}},
                                                                {
                                                                  "typeApplication": {
                                                                    "body": {
                                                                      "typeApplication": {
                                                                        "body": {
                                                                          "pair": {
                                                                            "first": {"wrap": {"typeName": "hydra.core.model.Name", "body": {"literal": {"string": "type"}}}},
                                                                            "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.packaging.TypeDefinition"}}},
                                                                                                "type": {"variable": "hydra.core.packaging.Definition"}}},
                                                                                            "type": {"variable": "hydra.core.errors.DecodingError"}}},
                                                                                        "argument": {
                                                                                          "lambda": {
                                                                                            "parameter": "t",
                                                                                            "domain": {"variable": "hydra.core.packaging.TypeDefinition"},
                                                                                            "body": {"inject": {"typeName": "hydra.core.packaging.Definition", "field": {"name": "type", "term": {"variable": "t"}}}}}}}},
                                                                                    "argument": {
                                                                                      "application": {
                                                                                        "function": {
                                                                                          "application": {"function": {"variable": "hydra.core.decode.packaging.typeDefinition"}, "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.packaging.Definition"}}}}}}}]}}},
                                                        "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.packaging.Definition"}}}}}}},
                                                          "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.packaging.Definition"}}}}}}},
                                                                    "type": {
                                                                      "either": {"left": {"variable": "hydra.core.errors.DecodingError"}, "right": {"variable": "hydra.core.packaging.Definition"}}}}},
                                                                "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.packaging.Definition"}}}}}}},
                                                                        "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.packaging.Definition"}}}}},
                                                        "argument": {
                                                          "lambda": {
                                                            "parameter": "f",
                                                            "domain": {
                                                              "function": {
                                                                "domain": {"variable": "hydra.core.model.Term"},
                                                                "codomain": {
                                                                  "either": {"left": {"variable": "hydra.core.errors.DecodingError"}, "right": {"variable": "hydra.core.packaging.Definition"}}}}},
                                                            "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.packaging.Definition"}}}]}}}}},
    {
      "term": {
        "name": "hydra.core.decode.packaging.definitionReference",
        "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.packaging.DefinitionReference"}}}}},
        "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.packaging.DefinitionReference"}}}}},
                                "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.packaging.DefinitionReference"}}}}}}},
                            "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.packaging.DefinitionReference"}}},
                                        "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.packaging.DefinitionReference"}}}}}}},
                                                            "argument": {
                                                              "list": [
                                                                {
                                                                  "typeApplication": {
                                                                    "body": {
                                                                      "typeApplication": {
                                                                        "body": {
                                                                          "pair": {
                                                                            "first": {"wrap": {"typeName": "hydra.core.model.Name", "body": {"literal": {"string": "primitive"}}}},
                                                                            "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.Name"}}},
                                                                                                "type": {"variable": "hydra.core.packaging.DefinitionReference"}}},
                                                                                            "type": {"variable": "hydra.core.errors.DecodingError"}}},
                                                                                        "argument": {
                                                                                          "lambda": {
                                                                                            "parameter": "t",
                                                                                            "domain": {"variable": "hydra.core.model.Name"},
                                                                                            "body": {
                                                                                              "inject": {"typeName": "hydra.core.packaging.DefinitionReference", "field": {"name": "primitive", "term": {"variable": "t"}}}}}}}},
                                                                                    "argument": {
                                                                                      "application": {
                                                                                        "function": {"application": {"function": {"variable": "hydra.core.decode.model.name"}, "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.packaging.DefinitionReference"}}}}}}},
                                                                {
                                                                  "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.Name"}}},
                                                                                                "type": {"variable": "hydra.core.packaging.DefinitionReference"}}},
                                                                                            "type": {"variable": "hydra.core.errors.DecodingError"}}},
                                                                                        "argument": {
                                                                                          "lambda": {
                                                                                            "parameter": "t",
                                                                                            "domain": {"variable": "hydra.core.model.Name"},
                                                                                            "body": {
                                                                                              "inject": {"typeName": "hydra.core.packaging.DefinitionReference", "field": {"name": "term", "term": {"variable": "t"}}}}}}}},
                                                                                    "argument": {
                                                                                      "application": {
                                                                                        "function": {"application": {"function": {"variable": "hydra.core.decode.model.name"}, "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.packaging.DefinitionReference"}}}}}}},
                                                                {
                                                                  "typeApplication": {
                                                                    "body": {
                                                                      "typeApplication": {
                                                                        "body": {
                                                                          "pair": {
                                                                            "first": {"wrap": {"typeName": "hydra.core.model.Name", "body": {"literal": {"string": "type"}}}},
                                                                            "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.Name"}}},
                                                                                                "type": {"variable": "hydra.core.packaging.DefinitionReference"}}},
                                                                                            "type": {"variable": "hydra.core.errors.DecodingError"}}},
                                                                                        "argument": {
                                                                                          "lambda": {
                                                                                            "parameter": "t",
                                                                                            "domain": {"variable": "hydra.core.model.Name"},
                                                                                            "body": {
                                                                                              "inject": {"typeName": "hydra.core.packaging.DefinitionReference", "field": {"name": "type", "term": {"variable": "t"}}}}}}}},
                                                                                    "argument": {
                                                                                      "application": {
                                                                                        "function": {"application": {"function": {"variable": "hydra.core.decode.model.name"}, "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.packaging.DefinitionReference"}}}}}}}]}}},
                                                        "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.packaging.DefinitionReference"}}}}}}},
                                                          "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.packaging.DefinitionReference"}}}}}}},
                                                                    "type": {
                                                                      "either": {
                                                                        "left": {"variable": "hydra.core.errors.DecodingError"},
                                                                        "right": {"variable": "hydra.core.packaging.DefinitionReference"}}}}},
                                                                "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.packaging.DefinitionReference"}}}}}}},
                                                                        "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.packaging.DefinitionReference"}}}}},
                                                        "argument": {
                                                          "lambda": {
                                                            "parameter": "f",
                                                            "domain": {
                                                              "function": {
                                                                "domain": {"variable": "hydra.core.model.Term"},
                                                                "codomain": {
                                                                  "either": {
                                                                    "left": {"variable": "hydra.core.errors.DecodingError"},
                                                                    "right": {"variable": "hydra.core.packaging.DefinitionReference"}}}}},
                                                            "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.packaging.DefinitionReference"}}}]}}}}},
    {
      "term": {
        "name": "hydra.core.decode.packaging.dependencyScope",
        "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.packaging.DependencyScope"}}}}},
        "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.packaging.DependencyScope"}}}}},
                                "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.packaging.DependencyScope"}}}}}}},
                            "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.packaging.DependencyScope"}}},
                                        "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.packaging.DependencyScope"}}}}}}},
                                                            "argument": {
                                                              "list": [
                                                                {
                                                                  "typeApplication": {
                                                                    "body": {
                                                                      "typeApplication": {
                                                                        "body": {
                                                                          "pair": {
                                                                            "first": {"wrap": {"typeName": "hydra.core.model.Name", "body": {"literal": {"string": "api"}}}},
                                                                            "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.packaging.DependencyScope"}}},
                                                                                            "type": {"variable": "hydra.core.errors.DecodingError"}}},
                                                                                        "argument": {
                                                                                          "lambda": {
                                                                                            "parameter": "t",
                                                                                            "domain": "unit",
                                                                                            "body": {"inject": {"typeName": "hydra.core.packaging.DependencyScope", "field": {"name": "api", "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.packaging.DependencyScope"}}}}}}},
                                                                {
                                                                  "typeApplication": {
                                                                    "body": {
                                                                      "typeApplication": {
                                                                        "body": {
                                                                          "pair": {
                                                                            "first": {"wrap": {"typeName": "hydra.core.model.Name", "body": {"literal": {"string": "runtime"}}}},
                                                                            "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.packaging.DependencyScope"}}},
                                                                                            "type": {"variable": "hydra.core.errors.DecodingError"}}},
                                                                                        "argument": {
                                                                                          "lambda": {
                                                                                            "parameter": "t",
                                                                                            "domain": "unit",
                                                                                            "body": {
                                                                                              "inject": {"typeName": "hydra.core.packaging.DependencyScope", "field": {"name": "runtime", "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.packaging.DependencyScope"}}}}}}},
                                                                {
                                                                  "typeApplication": {
                                                                    "body": {
                                                                      "typeApplication": {
                                                                        "body": {
                                                                          "pair": {
                                                                            "first": {"wrap": {"typeName": "hydra.core.model.Name", "body": {"literal": {"string": "test"}}}},
                                                                            "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.packaging.DependencyScope"}}},
                                                                                            "type": {"variable": "hydra.core.errors.DecodingError"}}},
                                                                                        "argument": {
                                                                                          "lambda": {
                                                                                            "parameter": "t",
                                                                                            "domain": "unit",
                                                                                            "body": {"inject": {"typeName": "hydra.core.packaging.DependencyScope", "field": {"name": "test", "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.packaging.DependencyScope"}}}}}}},
                                                                {
                                                                  "typeApplication": {
                                                                    "body": {
                                                                      "typeApplication": {
                                                                        "body": {
                                                                          "pair": {
                                                                            "first": {"wrap": {"typeName": "hydra.core.model.Name", "body": {"literal": {"string": "tool"}}}},
                                                                            "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.packaging.DependencyScope"}}},
                                                                                            "type": {"variable": "hydra.core.errors.DecodingError"}}},
                                                                                        "argument": {
                                                                                          "lambda": {
                                                                                            "parameter": "t",
                                                                                            "domain": "unit",
                                                                                            "body": {"inject": {"typeName": "hydra.core.packaging.DependencyScope", "field": {"name": "tool", "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.packaging.DependencyScope"}}}}}}}]}}},
                                                        "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.packaging.DependencyScope"}}}}}}},
                                                          "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.packaging.DependencyScope"}}}}}}},
                                                                    "type": {
                                                                      "either": {"left": {"variable": "hydra.core.errors.DecodingError"}, "right": {"variable": "hydra.core.packaging.DependencyScope"}}}}},
                                                                "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.packaging.DependencyScope"}}}}}}},
                                                                        "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.packaging.DependencyScope"}}}}},
                                                        "argument": {
                                                          "lambda": {
                                                            "parameter": "f",
                                                            "domain": {
                                                              "function": {
                                                                "domain": {"variable": "hydra.core.model.Term"},
                                                                "codomain": {
                                                                  "either": {"left": {"variable": "hydra.core.errors.DecodingError"}, "right": {"variable": "hydra.core.packaging.DependencyScope"}}}}},
                                                            "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.packaging.DependencyScope"}}}]}}}}},
    {
      "term": {
        "name": "hydra.core.decode.packaging.entityMetadata",
        "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.packaging.EntityMetadata"}}}}},
        "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.packaging.EntityMetadata"}}}}},
                                "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.packaging.EntityMetadata"}}}}}}},
                            "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.packaging.EntityMetadata"}}}}}},
                                                "type": {"variable": "hydra.core.errors.DecodingError"}}},
                                            "type": {"variable": "hydra.core.packaging.EntityMetadata"}}},
                                        "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": {"optional": {"literal": "string"}}}},
                                                                "type": {"variable": "hydra.core.packaging.EntityMetadata"}}},
                                                            "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": {"literal": "string"}}}},
                                                                            "argument": {"literal": {"string": "description"}}}},
                                                                        "argument": {
                                                                          "application": {
                                                                            "function": {"typeApplication": {"body": {"variable": "hydra.core.extract.model.decodeMaybe"}, "type": {"literal": "string"}}},
                                                                            "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": "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": "fieldMap"}}},
                                                                "argument": {"variable": "cx"}}}}},
                                                        "argument": {
                                                          "lambda": {
                                                            "parameter": "field_description",
                                                            "domain": {"optional": {"literal": "string"}},
                                                            "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": {"literal": "string"}}}},
                                                                        "type": {"variable": "hydra.core.packaging.EntityMetadata"}}},
                                                                    "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": {"literal": "string"}}}},
                                                                                    "argument": {"literal": {"string": "comments"}}}},
                                                                                "argument": {
                                                                                  "application": {
                                                                                    "function": {"typeApplication": {"body": {"variable": "hydra.core.extract.model.decodeList"}, "type": {"literal": "string"}}},
                                                                                    "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": "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": "fieldMap"}}},
                                                                        "argument": {"variable": "cx"}}}}},
                                                                "argument": {
                                                                  "lambda": {
                                                                    "parameter": "field_comments",
                                                                    "domain": {"list": {"literal": "string"}},
                                                                    "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.packaging.EntityReference"}}}},
                                                                                "type": {"variable": "hydra.core.packaging.EntityMetadata"}}},
                                                                            "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.packaging.EntityReference"}}}},
                                                                                            "argument": {"literal": {"string": "seeAlso"}}}},
                                                                                        "argument": {
                                                                                          "application": {
                                                                                            "function": {
                                                                                              "typeApplication": {
                                                                                                "body": {"variable": "hydra.core.extract.model.decodeList"},
                                                                                                "type": {"variable": "hydra.core.packaging.EntityReference"}}},
                                                                                            "argument": {"variable": "hydra.core.decode.packaging.entityReference"}}}}},
                                                                                    "argument": {"variable": "fieldMap"}}},
                                                                                "argument": {"variable": "cx"}}}}},
                                                                        "argument": {
                                                                          "lambda": {
                                                                            "parameter": "field_seeAlso",
                                                                            "domain": {"list": {"variable": "hydra.core.packaging.EntityReference"}},
                                                                            "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.packaging.LifecycleInfo"}}}},
                                                                                        "type": {"variable": "hydra.core.packaging.EntityMetadata"}}},
                                                                                    "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.packaging.LifecycleInfo"}}}},
                                                                                                    "argument": {"literal": {"string": "lifecycle"}}}},
                                                                                                "argument": {
                                                                                                  "application": {
                                                                                                    "function": {
                                                                                                      "typeApplication": {
                                                                                                        "body": {"variable": "hydra.core.extract.model.decodeMaybe"},
                                                                                                        "type": {"variable": "hydra.core.packaging.LifecycleInfo"}}},
                                                                                                    "argument": {"variable": "hydra.core.decode.packaging.lifecycleInfo"}}}}},
                                                                                            "argument": {"variable": "fieldMap"}}},
                                                                                        "argument": {"variable": "cx"}}}}},
                                                                                "argument": {
                                                                                  "lambda": {
                                                                                    "parameter": "field_lifecycle",
                                                                                    "domain": {"optional": {"variable": "hydra.core.packaging.LifecycleInfo"}},
                                                                                    "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.packaging.Provision"}}}},
                                                                                                "type": {"variable": "hydra.core.packaging.EntityMetadata"}}},
                                                                                            "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.packaging.Provision"}}}},
                                                                                                            "argument": {"literal": {"string": "provisions"}}}},
                                                                                                        "argument": {
                                                                                                          "application": {
                                                                                                            "function": {
                                                                                                              "typeApplication": {"body": {"variable": "hydra.core.extract.model.decodeList"}, "type": {"variable": "hydra.core.packaging.Provision"}}},
                                                                                                            "argument": {"variable": "hydra.core.decode.packaging.provision"}}}}},
                                                                                                    "argument": {"variable": "fieldMap"}}},
                                                                                                "argument": {"variable": "cx"}}}}},
                                                                                        "argument": {
                                                                                          "lambda": {
                                                                                            "parameter": "field_provisions",
                                                                                            "domain": {"list": {"variable": "hydra.core.packaging.Provision"}},
                                                                                            "body": {
                                                                                              "typeApplication": {
                                                                                                "body": {
                                                                                                  "typeApplication": {
                                                                                                    "body": {
                                                                                                      "either": {
                                                                                                        "right": {
                                                                                                          "record": {
                                                                                                            "typeName": "hydra.core.packaging.EntityMetadata",
                                                                                                            "fields": [
                                                                                                              {"name": "description", "term": {"variable": "field_description"}},
                                                                                                              {"name": "comments", "term": {"variable": "field_comments"}},
                                                                                                              {"name": "seeAlso", "term": {"variable": "field_seeAlso"}},
                                                                                                              {"name": "lifecycle", "term": {"variable": "field_lifecycle"}},
                                                                                                              {"name": "provisions", "term": {"variable": "field_provisions"}}]}}}},
                                                                                                    "type": {"variable": "hydra.core.errors.DecodingError"}}},
                                                                                                "type": {"variable": "hydra.core.packaging.EntityMetadata"}}}}}}}}}}}}}}}}}}}}}}}}}}}}]}},
                                    "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.packaging.EntityMetadata"}}}]}}}}},
    {
      "term": {
        "name": "hydra.core.decode.packaging.entityReference",
        "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.packaging.EntityReference"}}}}},
        "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.packaging.EntityReference"}}}}},
                                "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.packaging.EntityReference"}}}}}}},
                            "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.packaging.EntityReference"}}},
                                        "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.packaging.EntityReference"}}}}}}},
                                                            "argument": {
                                                              "list": [
                                                                {
                                                                  "typeApplication": {
                                                                    "body": {
                                                                      "typeApplication": {
                                                                        "body": {
                                                                          "pair": {
                                                                            "first": {"wrap": {"typeName": "hydra.core.model.Name", "body": {"literal": {"string": "definition"}}}},
                                                                            "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.packaging.DefinitionReference"}}},
                                                                                                "type": {"variable": "hydra.core.packaging.EntityReference"}}},
                                                                                            "type": {"variable": "hydra.core.errors.DecodingError"}}},
                                                                                        "argument": {
                                                                                          "lambda": {
                                                                                            "parameter": "t",
                                                                                            "domain": {"variable": "hydra.core.packaging.DefinitionReference"},
                                                                                            "body": {
                                                                                              "inject": {"typeName": "hydra.core.packaging.EntityReference", "field": {"name": "definition", "term": {"variable": "t"}}}}}}}},
                                                                                    "argument": {
                                                                                      "application": {
                                                                                        "function": {
                                                                                          "application": {"function": {"variable": "hydra.core.decode.packaging.definitionReference"}, "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.packaging.EntityReference"}}}}}}},
                                                                {
                                                                  "typeApplication": {
                                                                    "body": {
                                                                      "typeApplication": {
                                                                        "body": {
                                                                          "pair": {
                                                                            "first": {"wrap": {"typeName": "hydra.core.model.Name", "body": {"literal": {"string": "module"}}}},
                                                                            "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.packaging.ModuleName"}}},
                                                                                                "type": {"variable": "hydra.core.packaging.EntityReference"}}},
                                                                                            "type": {"variable": "hydra.core.errors.DecodingError"}}},
                                                                                        "argument": {
                                                                                          "lambda": {
                                                                                            "parameter": "t",
                                                                                            "domain": {"variable": "hydra.core.packaging.ModuleName"},
                                                                                            "body": {"inject": {"typeName": "hydra.core.packaging.EntityReference", "field": {"name": "module", "term": {"variable": "t"}}}}}}}},
                                                                                    "argument": {
                                                                                      "application": {
                                                                                        "function": {"application": {"function": {"variable": "hydra.core.decode.packaging.moduleName"}, "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.packaging.EntityReference"}}}}}}},
                                                                {
                                                                  "typeApplication": {
                                                                    "body": {
                                                                      "typeApplication": {
                                                                        "body": {
                                                                          "pair": {
                                                                            "first": {"wrap": {"typeName": "hydra.core.model.Name", "body": {"literal": {"string": "package"}}}},
                                                                            "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.packaging.PackageName"}}},
                                                                                                "type": {"variable": "hydra.core.packaging.EntityReference"}}},
                                                                                            "type": {"variable": "hydra.core.errors.DecodingError"}}},
                                                                                        "argument": {
                                                                                          "lambda": {
                                                                                            "parameter": "t",
                                                                                            "domain": {"variable": "hydra.core.packaging.PackageName"},
                                                                                            "body": {
                                                                                              "inject": {"typeName": "hydra.core.packaging.EntityReference", "field": {"name": "package", "term": {"variable": "t"}}}}}}}},
                                                                                    "argument": {
                                                                                      "application": {
                                                                                        "function": {"application": {"function": {"variable": "hydra.core.decode.packaging.packageName"}, "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.packaging.EntityReference"}}}}}}},
                                                                {
                                                                  "typeApplication": {
                                                                    "body": {
                                                                      "typeApplication": {
                                                                        "body": {
                                                                          "pair": {
                                                                            "first": {"wrap": {"typeName": "hydra.core.model.Name", "body": {"literal": {"string": "termExpr"}}}},
                                                                            "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": "string"}}},
                                                                                                "type": {"variable": "hydra.core.packaging.EntityReference"}}},
                                                                                            "type": {"variable": "hydra.core.errors.DecodingError"}}},
                                                                                        "argument": {
                                                                                          "lambda": {
                                                                                            "parameter": "t",
                                                                                            "domain": {"literal": "string"},
                                                                                            "body": {
                                                                                              "inject": {"typeName": "hydra.core.packaging.EntityReference", "field": {"name": "termExpr", "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": "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": {"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.packaging.EntityReference"}}}}}}},
                                                                {
                                                                  "typeApplication": {
                                                                    "body": {
                                                                      "typeApplication": {
                                                                        "body": {
                                                                          "pair": {
                                                                            "first": {"wrap": {"typeName": "hydra.core.model.Name", "body": {"literal": {"string": "typeExpr"}}}},
                                                                            "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": "string"}}},
                                                                                                "type": {"variable": "hydra.core.packaging.EntityReference"}}},
                                                                                            "type": {"variable": "hydra.core.errors.DecodingError"}}},
                                                                                        "argument": {
                                                                                          "lambda": {
                                                                                            "parameter": "t",
                                                                                            "domain": {"literal": "string"},
                                                                                            "body": {
                                                                                              "inject": {"typeName": "hydra.core.packaging.EntityReference", "field": {"name": "typeExpr", "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": "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": {"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.packaging.EntityReference"}}}}}}}]}}},
                                                        "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.packaging.EntityReference"}}}}}}},
                                                          "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.packaging.EntityReference"}}}}}}},
                                                                    "type": {
                                                                      "either": {"left": {"variable": "hydra.core.errors.DecodingError"}, "right": {"variable": "hydra.core.packaging.EntityReference"}}}}},
                                                                "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.packaging.EntityReference"}}}}}}},
                                                                        "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.packaging.EntityReference"}}}}},
                                                        "argument": {
                                                          "lambda": {
                                                            "parameter": "f",
                                                            "domain": {
                                                              "function": {
                                                                "domain": {"variable": "hydra.core.model.Term"},
                                                                "codomain": {
                                                                  "either": {"left": {"variable": "hydra.core.errors.DecodingError"}, "right": {"variable": "hydra.core.packaging.EntityReference"}}}}},
                                                            "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.packaging.EntityReference"}}}]}}}}},
    {
      "term": {
        "name": "hydra.core.decode.packaging.lifecycleInfo",
        "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.packaging.LifecycleInfo"}}}}},
        "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.packaging.LifecycleInfo"}}}}},
                                "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.packaging.LifecycleInfo"}}}}}}},
                            "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.packaging.LifecycleInfo"}}}}}},
                                                "type": {"variable": "hydra.core.errors.DecodingError"}}},
                                            "type": {"variable": "hydra.core.packaging.LifecycleInfo"}}},
                                        "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": {"optional": {"variable": "hydra.core.packaging.Version"}}}},
                                                                "type": {"variable": "hydra.core.packaging.LifecycleInfo"}}},
                                                            "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.packaging.Version"}}}},
                                                                            "argument": {"literal": {"string": "availableSince"}}}},
                                                                        "argument": {
                                                                          "application": {
                                                                            "function": {
                                                                              "typeApplication": {"body": {"variable": "hydra.core.extract.model.decodeMaybe"}, "type": {"variable": "hydra.core.packaging.Version"}}},
                                                                            "argument": {"variable": "hydra.core.decode.packaging.version"}}}}},
                                                                    "argument": {"variable": "fieldMap"}}},
                                                                "argument": {"variable": "cx"}}}}},
                                                        "argument": {
                                                          "lambda": {
                                                            "parameter": "field_availableSince",
                                                            "domain": {"optional": {"variable": "hydra.core.packaging.Version"}},
                                                            "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.packaging.Version"}}}},
                                                                        "type": {"variable": "hydra.core.packaging.LifecycleInfo"}}},
                                                                    "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.packaging.Version"}}}},
                                                                                    "argument": {"literal": {"string": "deprecatedSince"}}}},
                                                                                "argument": {
                                                                                  "application": {
                                                                                    "function": {
                                                                                      "typeApplication": {"body": {"variable": "hydra.core.extract.model.decodeMaybe"}, "type": {"variable": "hydra.core.packaging.Version"}}},
                                                                                    "argument": {"variable": "hydra.core.decode.packaging.version"}}}}},
                                                                            "argument": {"variable": "fieldMap"}}},
                                                                        "argument": {"variable": "cx"}}}}},
                                                                "argument": {
                                                                  "lambda": {
                                                                    "parameter": "field_deprecatedSince",
                                                                    "domain": {"optional": {"variable": "hydra.core.packaging.Version"}},
                                                                    "body": {
                                                                      "typeApplication": {
                                                                        "body": {
                                                                          "typeApplication": {
                                                                            "body": {
                                                                              "either": {
                                                                                "right": {
                                                                                  "record": {
                                                                                    "typeName": "hydra.core.packaging.LifecycleInfo",
                                                                                    "fields": [
                                                                                      {"name": "availableSince", "term": {"variable": "field_availableSince"}},
                                                                                      {"name": "deprecatedSince", "term": {"variable": "field_deprecatedSince"}}]}}}},
                                                                            "type": {"variable": "hydra.core.errors.DecodingError"}}},
                                                                        "type": {"variable": "hydra.core.packaging.LifecycleInfo"}}}}}}}}}}}}}}}}]}},
                                    "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.packaging.LifecycleInfo"}}}]}}}}},
    {
      "term": {
        "name": "hydra.core.decode.packaging.module",
        "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.packaging.Module"}}}}},
        "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.packaging.Module"}}}}},
                                "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.packaging.Module"}}}}}}},
                            "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.packaging.Module"}}}}}},
                                                "type": {"variable": "hydra.core.errors.DecodingError"}}},
                                            "type": {"variable": "hydra.core.packaging.Module"}}},
                                        "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.packaging.ModuleName"}}},
                                                                "type": {"variable": "hydra.core.packaging.Module"}}},
                                                            "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.packaging.ModuleName"}}},
                                                                            "argument": {"literal": {"string": "name"}}}},
                                                                        "argument": {"variable": "hydra.core.decode.packaging.moduleName"}}},
                                                                    "argument": {"variable": "fieldMap"}}},
                                                                "argument": {"variable": "cx"}}}}},
                                                        "argument": {
                                                          "lambda": {
                                                            "parameter": "field_name",
                                                            "domain": {"variable": "hydra.core.packaging.ModuleName"},
                                                            "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.packaging.EntityMetadata"}}}},
                                                                        "type": {"variable": "hydra.core.packaging.Module"}}},
                                                                    "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.packaging.EntityMetadata"}}}},
                                                                                    "argument": {"literal": {"string": "metadata"}}}},
                                                                                "argument": {
                                                                                  "application": {
                                                                                    "function": {
                                                                                      "typeApplication": {
                                                                                        "body": {"variable": "hydra.core.extract.model.decodeMaybe"},
                                                                                        "type": {"variable": "hydra.core.packaging.EntityMetadata"}}},
                                                                                    "argument": {"variable": "hydra.core.decode.packaging.entityMetadata"}}}}},
                                                                            "argument": {"variable": "fieldMap"}}},
                                                                        "argument": {"variable": "cx"}}}}},
                                                                "argument": {
                                                                  "lambda": {
                                                                    "parameter": "field_metadata",
                                                                    "domain": {"optional": {"variable": "hydra.core.packaging.EntityMetadata"}},
                                                                    "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.packaging.ModuleDependency"}}}},
                                                                                "type": {"variable": "hydra.core.packaging.Module"}}},
                                                                            "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.packaging.ModuleDependency"}}}},
                                                                                            "argument": {"literal": {"string": "dependencies"}}}},
                                                                                        "argument": {
                                                                                          "application": {
                                                                                            "function": {
                                                                                              "typeApplication": {
                                                                                                "body": {"variable": "hydra.core.extract.model.decodeList"},
                                                                                                "type": {"variable": "hydra.core.packaging.ModuleDependency"}}},
                                                                                            "argument": {"variable": "hydra.core.decode.packaging.moduleDependency"}}}}},
                                                                                    "argument": {"variable": "fieldMap"}}},
                                                                                "argument": {"variable": "cx"}}}}},
                                                                        "argument": {
                                                                          "lambda": {
                                                                            "parameter": "field_dependencies",
                                                                            "domain": {"list": {"variable": "hydra.core.packaging.ModuleDependency"}},
                                                                            "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.packaging.Definition"}}}},
                                                                                        "type": {"variable": "hydra.core.packaging.Module"}}},
                                                                                    "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.packaging.Definition"}}}},
                                                                                                    "argument": {"literal": {"string": "definitions"}}}},
                                                                                                "argument": {
                                                                                                  "application": {
                                                                                                    "function": {
                                                                                                      "typeApplication": {"body": {"variable": "hydra.core.extract.model.decodeList"}, "type": {"variable": "hydra.core.packaging.Definition"}}},
                                                                                                    "argument": {"variable": "hydra.core.decode.packaging.definition"}}}}},
                                                                                            "argument": {"variable": "fieldMap"}}},
                                                                                        "argument": {"variable": "cx"}}}}},
                                                                                "argument": {
                                                                                  "lambda": {
                                                                                    "parameter": "field_definitions",
                                                                                    "domain": {"list": {"variable": "hydra.core.packaging.Definition"}},
                                                                                    "body": {
                                                                                      "typeApplication": {
                                                                                        "body": {
                                                                                          "typeApplication": {
                                                                                            "body": {
                                                                                              "either": {
                                                                                                "right": {
                                                                                                  "record": {
                                                                                                    "typeName": "hydra.core.packaging.Module",
                                                                                                    "fields": [
                                                                                                      {"name": "name", "term": {"variable": "field_name"}},
                                                                                                      {"name": "metadata", "term": {"variable": "field_metadata"}},
                                                                                                      {"name": "dependencies", "term": {"variable": "field_dependencies"}},
                                                                                                      {"name": "definitions", "term": {"variable": "field_definitions"}}]}}}},
                                                                                            "type": {"variable": "hydra.core.errors.DecodingError"}}},
                                                                                        "type": {"variable": "hydra.core.packaging.Module"}}}}}}}}}}}}}}}}}}}}}}}}]}},
                                    "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.packaging.Module"}}}]}}}}},
    {
      "term": {
        "name": "hydra.core.decode.packaging.moduleDependency",
        "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.packaging.ModuleDependency"}}}}},
        "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.packaging.ModuleDependency"}}}}},
                                "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.packaging.ModuleDependency"}}}}}}},
                            "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.packaging.ModuleDependency"}}}}}},
                                                "type": {"variable": "hydra.core.errors.DecodingError"}}},
                                            "type": {"variable": "hydra.core.packaging.ModuleDependency"}}},
                                        "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.packaging.ModuleName"}}},
                                                                "type": {"variable": "hydra.core.packaging.ModuleDependency"}}},
                                                            "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.packaging.ModuleName"}}},
                                                                            "argument": {"literal": {"string": "module"}}}},
                                                                        "argument": {"variable": "hydra.core.decode.packaging.moduleName"}}},
                                                                    "argument": {"variable": "fieldMap"}}},
                                                                "argument": {"variable": "cx"}}}}},
                                                        "argument": {
                                                          "lambda": {
                                                            "parameter": "field_module",
                                                            "domain": {"variable": "hydra.core.packaging.ModuleName"},
                                                            "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.packaging.PackageName"}}}},
                                                                        "type": {"variable": "hydra.core.packaging.ModuleDependency"}}},
                                                                    "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.packaging.PackageName"}}}},
                                                                                    "argument": {"literal": {"string": "package"}}}},
                                                                                "argument": {
                                                                                  "application": {
                                                                                    "function": {
                                                                                      "typeApplication": {"body": {"variable": "hydra.core.extract.model.decodeMaybe"}, "type": {"variable": "hydra.core.packaging.PackageName"}}},
                                                                                    "argument": {"variable": "hydra.core.decode.packaging.packageName"}}}}},
                                                                            "argument": {"variable": "fieldMap"}}},
                                                                        "argument": {"variable": "cx"}}}}},
                                                                "argument": {
                                                                  "lambda": {
                                                                    "parameter": "field_package",
                                                                    "domain": {"optional": {"variable": "hydra.core.packaging.PackageName"}},
                                                                    "body": {
                                                                      "typeApplication": {
                                                                        "body": {
                                                                          "typeApplication": {
                                                                            "body": {
                                                                              "either": {
                                                                                "right": {
                                                                                  "record": {
                                                                                    "typeName": "hydra.core.packaging.ModuleDependency",
                                                                                    "fields": [{"name": "module", "term": {"variable": "field_module"}}, {"name": "package", "term": {"variable": "field_package"}}]}}}},
                                                                            "type": {"variable": "hydra.core.errors.DecodingError"}}},
                                                                        "type": {"variable": "hydra.core.packaging.ModuleDependency"}}}}}}}}}}}}}}}}]}},
                                    "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.packaging.ModuleDependency"}}}]}}}}},
    {
      "term": {
        "name": "hydra.core.decode.packaging.moduleName",
        "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.packaging.ModuleName"}}}}},
        "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.packaging.ModuleName"}}}}},
                                "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.packaging.ModuleName"}}}}}}},
                            "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.packaging.ModuleName"}}},
                                        "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.packaging.ModuleName"}}},
                                                            "type": {"variable": "hydra.core.errors.DecodingError"}}},
                                                        "argument": {
                                                          "lambda": {
                                                            "parameter": "b",
                                                            "domain": {"literal": "string"},
                                                            "body": {"wrap": {"typeName": "hydra.core.packaging.ModuleName", "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.packaging.ModuleName"}}}]}}}}},
    {
      "term": {
        "name": "hydra.core.decode.packaging.package",
        "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.packaging.Package"}}}}},
        "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.packaging.Package"}}}}},
                                "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.packaging.Package"}}}}}}},
                            "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.packaging.Package"}}}}}},
                                                "type": {"variable": "hydra.core.errors.DecodingError"}}},
                                            "type": {"variable": "hydra.core.packaging.Package"}}},
                                        "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.packaging.PackageName"}}},
                                                                "type": {"variable": "hydra.core.packaging.Package"}}},
                                                            "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.packaging.PackageName"}}},
                                                                            "argument": {"literal": {"string": "name"}}}},
                                                                        "argument": {"variable": "hydra.core.decode.packaging.packageName"}}},
                                                                    "argument": {"variable": "fieldMap"}}},
                                                                "argument": {"variable": "cx"}}}}},
                                                        "argument": {
                                                          "lambda": {
                                                            "parameter": "field_name",
                                                            "domain": {"variable": "hydra.core.packaging.PackageName"},
                                                            "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.packaging.EntityMetadata"}}}},
                                                                        "type": {"variable": "hydra.core.packaging.Package"}}},
                                                                    "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.packaging.EntityMetadata"}}}},
                                                                                    "argument": {"literal": {"string": "metadata"}}}},
                                                                                "argument": {
                                                                                  "application": {
                                                                                    "function": {
                                                                                      "typeApplication": {
                                                                                        "body": {"variable": "hydra.core.extract.model.decodeMaybe"},
                                                                                        "type": {"variable": "hydra.core.packaging.EntityMetadata"}}},
                                                                                    "argument": {"variable": "hydra.core.decode.packaging.entityMetadata"}}}}},
                                                                            "argument": {"variable": "fieldMap"}}},
                                                                        "argument": {"variable": "cx"}}}}},
                                                                "argument": {
                                                                  "lambda": {
                                                                    "parameter": "field_metadata",
                                                                    "domain": {"optional": {"variable": "hydra.core.packaging.EntityMetadata"}},
                                                                    "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.packaging.PackageDependency"}}}},
                                                                                "type": {"variable": "hydra.core.packaging.Package"}}},
                                                                            "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.packaging.PackageDependency"}}}},
                                                                                            "argument": {"literal": {"string": "dependencies"}}}},
                                                                                        "argument": {
                                                                                          "application": {
                                                                                            "function": {
                                                                                              "typeApplication": {
                                                                                                "body": {"variable": "hydra.core.extract.model.decodeList"},
                                                                                                "type": {"variable": "hydra.core.packaging.PackageDependency"}}},
                                                                                            "argument": {"variable": "hydra.core.decode.packaging.packageDependency"}}}}},
                                                                                    "argument": {"variable": "fieldMap"}}},
                                                                                "argument": {"variable": "cx"}}}}},
                                                                        "argument": {
                                                                          "lambda": {
                                                                            "parameter": "field_dependencies",
                                                                            "domain": {"list": {"variable": "hydra.core.packaging.PackageDependency"}},
                                                                            "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.packaging.Module"}}}},
                                                                                        "type": {"variable": "hydra.core.packaging.Package"}}},
                                                                                    "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.packaging.Module"}}}},
                                                                                                    "argument": {"literal": {"string": "modules"}}}},
                                                                                                "argument": {
                                                                                                  "application": {
                                                                                                    "function": {
                                                                                                      "typeApplication": {"body": {"variable": "hydra.core.extract.model.decodeList"}, "type": {"variable": "hydra.core.packaging.Module"}}},
                                                                                                    "argument": {"variable": "hydra.core.decode.packaging.module"}}}}},
                                                                                            "argument": {"variable": "fieldMap"}}},
                                                                                        "argument": {"variable": "cx"}}}}},
                                                                                "argument": {
                                                                                  "lambda": {
                                                                                    "parameter": "field_modules",
                                                                                    "domain": {"list": {"variable": "hydra.core.packaging.Module"}},
                                                                                    "body": {
                                                                                      "typeApplication": {
                                                                                        "body": {
                                                                                          "typeApplication": {
                                                                                            "body": {
                                                                                              "either": {
                                                                                                "right": {
                                                                                                  "record": {
                                                                                                    "typeName": "hydra.core.packaging.Package",
                                                                                                    "fields": [
                                                                                                      {"name": "name", "term": {"variable": "field_name"}},
                                                                                                      {"name": "metadata", "term": {"variable": "field_metadata"}},
                                                                                                      {"name": "dependencies", "term": {"variable": "field_dependencies"}},
                                                                                                      {"name": "modules", "term": {"variable": "field_modules"}}]}}}},
                                                                                            "type": {"variable": "hydra.core.errors.DecodingError"}}},
                                                                                        "type": {"variable": "hydra.core.packaging.Package"}}}}}}}}}}}}}}}}}}}}}}}}]}},
                                    "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.packaging.Package"}}}]}}}}},
    {
      "term": {
        "name": "hydra.core.decode.packaging.packageDependency",
        "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.packaging.PackageDependency"}}}}},
        "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.packaging.PackageDependency"}}}}},
                                "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.packaging.PackageDependency"}}}}}}},
                            "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.packaging.PackageDependency"}}}}}},
                                                "type": {"variable": "hydra.core.errors.DecodingError"}}},
                                            "type": {"variable": "hydra.core.packaging.PackageDependency"}}},
                                        "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.packaging.PackageName"}}},
                                                                "type": {"variable": "hydra.core.packaging.PackageDependency"}}},
                                                            "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.packaging.PackageName"}}},
                                                                            "argument": {"literal": {"string": "name"}}}},
                                                                        "argument": {"variable": "hydra.core.decode.packaging.packageName"}}},
                                                                    "argument": {"variable": "fieldMap"}}},
                                                                "argument": {"variable": "cx"}}}}},
                                                        "argument": {
                                                          "lambda": {
                                                            "parameter": "field_name",
                                                            "domain": {"variable": "hydra.core.packaging.PackageName"},
                                                            "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.packaging.VersionSpecifier"}}},
                                                                        "type": {"variable": "hydra.core.packaging.PackageDependency"}}},
                                                                    "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.packaging.VersionSpecifier"}}},
                                                                                    "argument": {"literal": {"string": "version"}}}},
                                                                                "argument": {"variable": "hydra.core.decode.packaging.versionSpecifier"}}},
                                                                            "argument": {"variable": "fieldMap"}}},
                                                                        "argument": {"variable": "cx"}}}}},
                                                                "argument": {
                                                                  "lambda": {
                                                                    "parameter": "field_version",
                                                                    "domain": {"variable": "hydra.core.packaging.VersionSpecifier"},
                                                                    "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.packaging.DependencyScope"}}}},
                                                                                "type": {"variable": "hydra.core.packaging.PackageDependency"}}},
                                                                            "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.packaging.DependencyScope"}}}},
                                                                                            "argument": {"literal": {"string": "scope"}}}},
                                                                                        "argument": {
                                                                                          "application": {
                                                                                            "function": {
                                                                                              "typeApplication": {
                                                                                                "body": {"variable": "hydra.core.extract.model.decodeMaybe"},
                                                                                                "type": {"variable": "hydra.core.packaging.DependencyScope"}}},
                                                                                            "argument": {"variable": "hydra.core.decode.packaging.dependencyScope"}}}}},
                                                                                    "argument": {"variable": "fieldMap"}}},
                                                                                "argument": {"variable": "cx"}}}}},
                                                                        "argument": {
                                                                          "lambda": {
                                                                            "parameter": "field_scope",
                                                                            "domain": {"optional": {"variable": "hydra.core.packaging.DependencyScope"}},
                                                                            "body": {
                                                                              "typeApplication": {
                                                                                "body": {
                                                                                  "typeApplication": {
                                                                                    "body": {
                                                                                      "either": {
                                                                                        "right": {
                                                                                          "record": {
                                                                                            "typeName": "hydra.core.packaging.PackageDependency",
                                                                                            "fields": [
                                                                                              {"name": "name", "term": {"variable": "field_name"}},
                                                                                              {"name": "version", "term": {"variable": "field_version"}},
                                                                                              {"name": "scope", "term": {"variable": "field_scope"}}]}}}},
                                                                                    "type": {"variable": "hydra.core.errors.DecodingError"}}},
                                                                                "type": {"variable": "hydra.core.packaging.PackageDependency"}}}}}}}}}}}}}}}}}}}}]}},
                                    "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.packaging.PackageDependency"}}}]}}}}},
    {
      "term": {
        "name": "hydra.core.decode.packaging.packageName",
        "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.packaging.PackageName"}}}}},
        "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.packaging.PackageName"}}}}},
                                "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.packaging.PackageName"}}}}}}},
                            "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.packaging.PackageName"}}},
                                        "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.packaging.PackageName"}}},
                                                            "type": {"variable": "hydra.core.errors.DecodingError"}}},
                                                        "argument": {
                                                          "lambda": {
                                                            "parameter": "b",
                                                            "domain": {"literal": "string"},
                                                            "body": {"wrap": {"typeName": "hydra.core.packaging.PackageName", "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.packaging.PackageName"}}}]}}}}},
    {
      "term": {
        "name": "hydra.core.decode.packaging.primitiveDefinition",
        "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.packaging.PrimitiveDefinition"}}}}},
        "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.packaging.PrimitiveDefinition"}}}}},
                                "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.packaging.PrimitiveDefinition"}}}}}}},
                            "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.packaging.PrimitiveDefinition"}}}}}},
                                                "type": {"variable": "hydra.core.errors.DecodingError"}}},
                                            "type": {"variable": "hydra.core.packaging.PrimitiveDefinition"}}},
                                        "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.packaging.PrimitiveDefinition"}}},
                                                            "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": "name"}}}},
                                                                        "argument": {"variable": "hydra.core.decode.model.name"}}},
                                                                    "argument": {"variable": "fieldMap"}}},
                                                                "argument": {"variable": "cx"}}}}},
                                                        "argument": {
                                                          "lambda": {
                                                            "parameter": "field_name",
                                                            "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.packaging.EntityMetadata"}}}},
                                                                        "type": {"variable": "hydra.core.packaging.PrimitiveDefinition"}}},
                                                                    "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.packaging.EntityMetadata"}}}},
                                                                                    "argument": {"literal": {"string": "metadata"}}}},
                                                                                "argument": {
                                                                                  "application": {
                                                                                    "function": {
                                                                                      "typeApplication": {
                                                                                        "body": {"variable": "hydra.core.extract.model.decodeMaybe"},
                                                                                        "type": {"variable": "hydra.core.packaging.EntityMetadata"}}},
                                                                                    "argument": {"variable": "hydra.core.decode.packaging.entityMetadata"}}}}},
                                                                            "argument": {"variable": "fieldMap"}}},
                                                                        "argument": {"variable": "cx"}}}}},
                                                                "argument": {
                                                                  "lambda": {
                                                                    "parameter": "field_metadata",
                                                                    "domain": {"optional": {"variable": "hydra.core.packaging.EntityMetadata"}},
                                                                    "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.typing.TermSignature"}}},
                                                                                "type": {"variable": "hydra.core.packaging.PrimitiveDefinition"}}},
                                                                            "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.typing.TermSignature"}}},
                                                                                            "argument": {"literal": {"string": "signature"}}}},
                                                                                        "argument": {"variable": "hydra.core.decode.typing.termSignature"}}},
                                                                                    "argument": {"variable": "fieldMap"}}},
                                                                                "argument": {"variable": "cx"}}}}},
                                                                        "argument": {
                                                                          "lambda": {
                                                                            "parameter": "field_signature",
                                                                            "domain": {"variable": "hydra.core.typing.TermSignature"},
                                                                            "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": "boolean"}}},
                                                                                        "type": {"variable": "hydra.core.packaging.PrimitiveDefinition"}}},
                                                                                    "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": "boolean"}}},
                                                                                                    "argument": {"literal": {"string": "isPure"}}}},
                                                                                                "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": "boolean"}}}}},
                                                                                                                    "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": "boolean"}}}}}}},
                                                                                                                "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": "boolean"}}},
                                                                                                                            "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 boolean literal"}}}}}},
                                                                                                                                                    "type": {"variable": "hydra.core.errors.DecodingError"}}},
                                                                                                                                                "type": {"literal": "boolean"}}},
                                                                                                                                            "cases": [
                                                                                                                                              {
                                                                                                                                                "name": "boolean",
                                                                                                                                                "handler": {
                                                                                                                                                  "lambda": {
                                                                                                                                                    "parameter": "b",
                                                                                                                                                    "domain": {"literal": "boolean"},
                                                                                                                                                    "body": {
                                                                                                                                                      "typeApplication": {
                                                                                                                                                        "body": {
                                                                                                                                                          "typeApplication": {"body": {"either": {"right": {"variable": "b"}}}, "type": {"variable": "hydra.core.errors.DecodingError"}}},
                                                                                                                                                        "type": {"literal": "boolean"}}}}}}]}},
                                                                                                                                        "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_isPure",
                                                                                    "domain": {"literal": "boolean"},
                                                                                    "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": "boolean"}}},
                                                                                                "type": {"variable": "hydra.core.packaging.PrimitiveDefinition"}}},
                                                                                            "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": "boolean"}}},
                                                                                                            "argument": {"literal": {"string": "isTotal"}}}},
                                                                                                        "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": "boolean"}}}}},
                                                                                                                            "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": "boolean"}}}}}}},
                                                                                                                        "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": "boolean"}}},
                                                                                                                                    "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 boolean literal"}}}}}},
                                                                                                                                                            "type": {"variable": "hydra.core.errors.DecodingError"}}},
                                                                                                                                                        "type": {"literal": "boolean"}}},
                                                                                                                                                    "cases": [
                                                                                                                                                      {
                                                                                                                                                        "name": "boolean",
                                                                                                                                                        "handler": {
                                                                                                                                                          "lambda": {
                                                                                                                                                            "parameter": "b",
                                                                                                                                                            "domain": {"literal": "boolean"},
                                                                                                                                                            "body": {
                                                                                                                                                              "typeApplication": {
                                                                                                                                                                "body": {
                                                                                                                                                                  "typeApplication": {"body": {"either": {"right": {"variable": "b"}}}, "type": {"variable": "hydra.core.errors.DecodingError"}}},
                                                                                                                                                                "type": {"literal": "boolean"}}}}}}]}},
                                                                                                                                                "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_isTotal",
                                                                                            "domain": {"literal": "boolean"},
                                                                                            "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.Term"}}}},
                                                                                                        "type": {"variable": "hydra.core.packaging.PrimitiveDefinition"}}},
                                                                                                    "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.Term"}}}},
                                                                                                                    "argument": {"literal": {"string": "defaultImplementation"}}}},
                                                                                                                "argument": {
                                                                                                                  "application": {
                                                                                                                    "function": {
                                                                                                                      "typeApplication": {"body": {"variable": "hydra.core.extract.model.decodeMaybe"}, "type": {"variable": "hydra.core.model.Term"}}},
                                                                                                                    "argument": {"variable": "hydra.core.decode.model.term"}}}}},
                                                                                                            "argument": {"variable": "fieldMap"}}},
                                                                                                        "argument": {"variable": "cx"}}}}},
                                                                                                "argument": {
                                                                                                  "lambda": {
                                                                                                    "parameter": "field_defaultImplementation",
                                                                                                    "domain": {"optional": {"variable": "hydra.core.model.Term"}},
                                                                                                    "body": {
                                                                                                      "typeApplication": {
                                                                                                        "body": {
                                                                                                          "typeApplication": {
                                                                                                            "body": {
                                                                                                              "either": {
                                                                                                                "right": {
                                                                                                                  "record": {
                                                                                                                    "typeName": "hydra.core.packaging.PrimitiveDefinition",
                                                                                                                    "fields": [
                                                                                                                      {"name": "name", "term": {"variable": "field_name"}},
                                                                                                                      {"name": "metadata", "term": {"variable": "field_metadata"}},
                                                                                                                      {"name": "signature", "term": {"variable": "field_signature"}},
                                                                                                                      {"name": "isPure", "term": {"variable": "field_isPure"}},
                                                                                                                      {"name": "isTotal", "term": {"variable": "field_isTotal"}},
                                                                                                                      {"name": "defaultImplementation", "term": {"variable": "field_defaultImplementation"}}]}}}},
                                                                                                            "type": {"variable": "hydra.core.errors.DecodingError"}}},
                                                                                                        "type": {"variable": "hydra.core.packaging.PrimitiveDefinition"}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}]}},
                                    "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.packaging.PrimitiveDefinition"}}}]}}}}},
    {
      "term": {
        "name": "hydra.core.decode.packaging.provision",
        "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.packaging.Provision"}}}}},
        "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.packaging.Provision"}}}}},
                                "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.packaging.Provision"}}}}}}},
                            "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.packaging.Provision"}}}}}},
                                                "type": {"variable": "hydra.core.errors.DecodingError"}}},
                                            "type": {"variable": "hydra.core.packaging.Provision"}}},
                                        "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.packaging.Provision"}}},
                                                            "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": "name"}}}},
                                                                        "argument": {"variable": "hydra.core.decode.model.name"}}},
                                                                    "argument": {"variable": "fieldMap"}}},
                                                                "argument": {"variable": "cx"}}}}},
                                                        "argument": {
                                                          "lambda": {
                                                            "parameter": "field_name",
                                                            "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": {"variable": "hydra.core.packaging.ProvisionKind"}}},
                                                                        "type": {"variable": "hydra.core.packaging.Provision"}}},
                                                                    "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.packaging.ProvisionKind"}}},
                                                                                    "argument": {"literal": {"string": "kind"}}}},
                                                                                "argument": {"variable": "hydra.core.decode.packaging.provisionKind"}}},
                                                                            "argument": {"variable": "fieldMap"}}},
                                                                        "argument": {"variable": "cx"}}}}},
                                                                "argument": {
                                                                  "lambda": {
                                                                    "parameter": "field_kind",
                                                                    "domain": {"variable": "hydra.core.packaging.ProvisionKind"},
                                                                    "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": "string"}}},
                                                                                "type": {"variable": "hydra.core.packaging.Provision"}}},
                                                                            "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": "string"}}},
                                                                                            "argument": {"literal": {"string": "statement"}}}},
                                                                                        "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": "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": "fieldMap"}}},
                                                                                "argument": {"variable": "cx"}}}}},
                                                                        "argument": {
                                                                          "lambda": {
                                                                            "parameter": "field_statement",
                                                                            "domain": {"literal": "string"},
                                                                            "body": {
                                                                              "typeApplication": {
                                                                                "body": {
                                                                                  "typeApplication": {
                                                                                    "body": {
                                                                                      "either": {
                                                                                        "right": {
                                                                                          "record": {
                                                                                            "typeName": "hydra.core.packaging.Provision",
                                                                                            "fields": [
                                                                                              {"name": "name", "term": {"variable": "field_name"}},
                                                                                              {"name": "kind", "term": {"variable": "field_kind"}},
                                                                                              {"name": "statement", "term": {"variable": "field_statement"}}]}}}},
                                                                                    "type": {"variable": "hydra.core.errors.DecodingError"}}},
                                                                                "type": {"variable": "hydra.core.packaging.Provision"}}}}}}}}}}}}}}}}}}}}]}},
                                    "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.packaging.Provision"}}}]}}}}},
    {
      "term": {
        "name": "hydra.core.decode.packaging.provisionKind",
        "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.packaging.ProvisionKind"}}}}},
        "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.packaging.ProvisionKind"}}}}},
                                "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.packaging.ProvisionKind"}}}}}}},
                            "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.packaging.ProvisionKind"}}},
                                        "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.packaging.ProvisionKind"}}}}}}},
                                                            "argument": {
                                                              "list": [
                                                                {
                                                                  "typeApplication": {
                                                                    "body": {
                                                                      "typeApplication": {
                                                                        "body": {
                                                                          "pair": {
                                                                            "first": {"wrap": {"typeName": "hydra.core.model.Name", "body": {"literal": {"string": "requirement"}}}},
                                                                            "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.packaging.ProvisionKind"}}},
                                                                                            "type": {"variable": "hydra.core.errors.DecodingError"}}},
                                                                                        "argument": {
                                                                                          "lambda": {
                                                                                            "parameter": "t",
                                                                                            "domain": "unit",
                                                                                            "body": {
                                                                                              "inject": {"typeName": "hydra.core.packaging.ProvisionKind", "field": {"name": "requirement", "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.packaging.ProvisionKind"}}}}}}},
                                                                {
                                                                  "typeApplication": {
                                                                    "body": {
                                                                      "typeApplication": {
                                                                        "body": {
                                                                          "pair": {
                                                                            "first": {"wrap": {"typeName": "hydra.core.model.Name", "body": {"literal": {"string": "recommendation"}}}},
                                                                            "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.packaging.ProvisionKind"}}},
                                                                                            "type": {"variable": "hydra.core.errors.DecodingError"}}},
                                                                                        "argument": {
                                                                                          "lambda": {
                                                                                            "parameter": "t",
                                                                                            "domain": "unit",
                                                                                            "body": {
                                                                                              "inject": {"typeName": "hydra.core.packaging.ProvisionKind", "field": {"name": "recommendation", "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.packaging.ProvisionKind"}}}}}}}]}}},
                                                        "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.packaging.ProvisionKind"}}}}}}},
                                                          "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.packaging.ProvisionKind"}}}}}}},
                                                                    "type": {
                                                                      "either": {"left": {"variable": "hydra.core.errors.DecodingError"}, "right": {"variable": "hydra.core.packaging.ProvisionKind"}}}}},
                                                                "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.packaging.ProvisionKind"}}}}}}},
                                                                        "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.packaging.ProvisionKind"}}}}},
                                                        "argument": {
                                                          "lambda": {
                                                            "parameter": "f",
                                                            "domain": {
                                                              "function": {
                                                                "domain": {"variable": "hydra.core.model.Term"},
                                                                "codomain": {
                                                                  "either": {"left": {"variable": "hydra.core.errors.DecodingError"}, "right": {"variable": "hydra.core.packaging.ProvisionKind"}}}}},
                                                            "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.packaging.ProvisionKind"}}}]}}}}},
    {
      "term": {
        "name": "hydra.core.decode.packaging.termDefinition",
        "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.packaging.TermDefinition"}}}}},
        "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.packaging.TermDefinition"}}}}},
                                "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.packaging.TermDefinition"}}}}}}},
                            "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.packaging.TermDefinition"}}}}}},
                                                "type": {"variable": "hydra.core.errors.DecodingError"}}},
                                            "type": {"variable": "hydra.core.packaging.TermDefinition"}}},
                                        "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.packaging.TermDefinition"}}},
                                                            "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": "name"}}}},
                                                                        "argument": {"variable": "hydra.core.decode.model.name"}}},
                                                                    "argument": {"variable": "fieldMap"}}},
                                                                "argument": {"variable": "cx"}}}}},
                                                        "argument": {
                                                          "lambda": {
                                                            "parameter": "field_name",
                                                            "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.packaging.EntityMetadata"}}}},
                                                                        "type": {"variable": "hydra.core.packaging.TermDefinition"}}},
                                                                    "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.packaging.EntityMetadata"}}}},
                                                                                    "argument": {"literal": {"string": "metadata"}}}},
                                                                                "argument": {
                                                                                  "application": {
                                                                                    "function": {
                                                                                      "typeApplication": {
                                                                                        "body": {"variable": "hydra.core.extract.model.decodeMaybe"},
                                                                                        "type": {"variable": "hydra.core.packaging.EntityMetadata"}}},
                                                                                    "argument": {"variable": "hydra.core.decode.packaging.entityMetadata"}}}}},
                                                                            "argument": {"variable": "fieldMap"}}},
                                                                        "argument": {"variable": "cx"}}}}},
                                                                "argument": {
                                                                  "lambda": {
                                                                    "parameter": "field_metadata",
                                                                    "domain": {"optional": {"variable": "hydra.core.packaging.EntityMetadata"}},
                                                                    "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.typing.TermSignature"}}}},
                                                                                "type": {"variable": "hydra.core.packaging.TermDefinition"}}},
                                                                            "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.typing.TermSignature"}}}},
                                                                                            "argument": {"literal": {"string": "signature"}}}},
                                                                                        "argument": {
                                                                                          "application": {
                                                                                            "function": {
                                                                                              "typeApplication": {"body": {"variable": "hydra.core.extract.model.decodeMaybe"}, "type": {"variable": "hydra.core.typing.TermSignature"}}},
                                                                                            "argument": {"variable": "hydra.core.decode.typing.termSignature"}}}}},
                                                                                    "argument": {"variable": "fieldMap"}}},
                                                                                "argument": {"variable": "cx"}}}}},
                                                                        "argument": {
                                                                          "lambda": {
                                                                            "parameter": "field_signature",
                                                                            "domain": {"optional": {"variable": "hydra.core.typing.TermSignature"}},
                                                                            "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.Term"}}},
                                                                                        "type": {"variable": "hydra.core.packaging.TermDefinition"}}},
                                                                                    "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.Term"}}},
                                                                                                    "argument": {"literal": {"string": "body"}}}},
                                                                                                "argument": {"variable": "hydra.core.decode.model.term"}}},
                                                                                            "argument": {"variable": "fieldMap"}}},
                                                                                        "argument": {"variable": "cx"}}}}},
                                                                                "argument": {
                                                                                  "lambda": {
                                                                                    "parameter": "field_body",
                                                                                    "domain": {"variable": "hydra.core.model.Term"},
                                                                                    "body": {
                                                                                      "typeApplication": {
                                                                                        "body": {
                                                                                          "typeApplication": {
                                                                                            "body": {
                                                                                              "either": {
                                                                                                "right": {
                                                                                                  "record": {
                                                                                                    "typeName": "hydra.core.packaging.TermDefinition",
                                                                                                    "fields": [
                                                                                                      {"name": "name", "term": {"variable": "field_name"}},
                                                                                                      {"name": "metadata", "term": {"variable": "field_metadata"}},
                                                                                                      {"name": "signature", "term": {"variable": "field_signature"}},
                                                                                                      {"name": "body", "term": {"variable": "field_body"}}]}}}},
                                                                                            "type": {"variable": "hydra.core.errors.DecodingError"}}},
                                                                                        "type": {"variable": "hydra.core.packaging.TermDefinition"}}}}}}}}}}}}}}}}}}}}}}}}]}},
                                    "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.packaging.TermDefinition"}}}]}}}}},
    {
      "term": {
        "name": "hydra.core.decode.packaging.typeDefinition",
        "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.packaging.TypeDefinition"}}}}},
        "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.packaging.TypeDefinition"}}}}},
                                "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.packaging.TypeDefinition"}}}}}}},
                            "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.packaging.TypeDefinition"}}}}}},
                                                "type": {"variable": "hydra.core.errors.DecodingError"}}},
                                            "type": {"variable": "hydra.core.packaging.TypeDefinition"}}},
                                        "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.packaging.TypeDefinition"}}},
                                                            "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": "name"}}}},
                                                                        "argument": {"variable": "hydra.core.decode.model.name"}}},
                                                                    "argument": {"variable": "fieldMap"}}},
                                                                "argument": {"variable": "cx"}}}}},
                                                        "argument": {
                                                          "lambda": {
                                                            "parameter": "field_name",
                                                            "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.packaging.EntityMetadata"}}}},
                                                                        "type": {"variable": "hydra.core.packaging.TypeDefinition"}}},
                                                                    "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.packaging.EntityMetadata"}}}},
                                                                                    "argument": {"literal": {"string": "metadata"}}}},
                                                                                "argument": {
                                                                                  "application": {
                                                                                    "function": {
                                                                                      "typeApplication": {
                                                                                        "body": {"variable": "hydra.core.extract.model.decodeMaybe"},
                                                                                        "type": {"variable": "hydra.core.packaging.EntityMetadata"}}},
                                                                                    "argument": {"variable": "hydra.core.decode.packaging.entityMetadata"}}}}},
                                                                            "argument": {"variable": "fieldMap"}}},
                                                                        "argument": {"variable": "cx"}}}}},
                                                                "argument": {
                                                                  "lambda": {
                                                                    "parameter": "field_metadata",
                                                                    "domain": {"optional": {"variable": "hydra.core.packaging.EntityMetadata"}},
                                                                    "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.TypeScheme"}}},
                                                                                "type": {"variable": "hydra.core.packaging.TypeDefinition"}}},
                                                                            "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.TypeScheme"}}},
                                                                                            "argument": {"literal": {"string": "body"}}}},
                                                                                        "argument": {"variable": "hydra.core.decode.model.typeScheme"}}},
                                                                                    "argument": {"variable": "fieldMap"}}},
                                                                                "argument": {"variable": "cx"}}}}},
                                                                        "argument": {
                                                                          "lambda": {
                                                                            "parameter": "field_body",
                                                                            "domain": {"variable": "hydra.core.model.TypeScheme"},
                                                                            "body": {
                                                                              "typeApplication": {
                                                                                "body": {
                                                                                  "typeApplication": {
                                                                                    "body": {
                                                                                      "either": {
                                                                                        "right": {
                                                                                          "record": {
                                                                                            "typeName": "hydra.core.packaging.TypeDefinition",
                                                                                            "fields": [
                                                                                              {"name": "name", "term": {"variable": "field_name"}},
                                                                                              {"name": "metadata", "term": {"variable": "field_metadata"}},
                                                                                              {"name": "body", "term": {"variable": "field_body"}}]}}}},
                                                                                    "type": {"variable": "hydra.core.errors.DecodingError"}}},
                                                                                "type": {"variable": "hydra.core.packaging.TypeDefinition"}}}}}}}}}}}}}}}}}}}}]}},
                                    "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.packaging.TypeDefinition"}}}]}}}}},
    {
      "term": {
        "name": "hydra.core.decode.packaging.version",
        "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.packaging.Version"}}}}},
        "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.packaging.Version"}}}}},
                                "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.packaging.Version"}}}}}}},
                            "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.packaging.Version"}}},
                                        "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.packaging.Version"}}},
                                                            "type": {"variable": "hydra.core.errors.DecodingError"}}},
                                                        "argument": {
                                                          "lambda": {
                                                            "parameter": "b",
                                                            "domain": {"literal": "string"},
                                                            "body": {"wrap": {"typeName": "hydra.core.packaging.Version", "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.packaging.Version"}}}]}}}}},
    {
      "term": {
        "name": "hydra.core.decode.packaging.versionRange",
        "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.packaging.VersionRange"}}}}},
        "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.packaging.VersionRange"}}}}},
                                "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.packaging.VersionRange"}}}}}}},
                            "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.packaging.VersionRange"}}}}}},
                                                "type": {"variable": "hydra.core.errors.DecodingError"}}},
                                            "type": {"variable": "hydra.core.packaging.VersionRange"}}},
                                        "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": {"optional": {"variable": "hydra.core.packaging.Version"}}}},
                                                                "type": {"variable": "hydra.core.packaging.VersionRange"}}},
                                                            "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.packaging.Version"}}}},
                                                                            "argument": {"literal": {"string": "lowerInclusive"}}}},
                                                                        "argument": {
                                                                          "application": {
                                                                            "function": {
                                                                              "typeApplication": {"body": {"variable": "hydra.core.extract.model.decodeMaybe"}, "type": {"variable": "hydra.core.packaging.Version"}}},
                                                                            "argument": {"variable": "hydra.core.decode.packaging.version"}}}}},
                                                                    "argument": {"variable": "fieldMap"}}},
                                                                "argument": {"variable": "cx"}}}}},
                                                        "argument": {
                                                          "lambda": {
                                                            "parameter": "field_lowerInclusive",
                                                            "domain": {"optional": {"variable": "hydra.core.packaging.Version"}},
                                                            "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.packaging.Version"}}}},
                                                                        "type": {"variable": "hydra.core.packaging.VersionRange"}}},
                                                                    "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.packaging.Version"}}}},
                                                                                    "argument": {"literal": {"string": "upperExclusive"}}}},
                                                                                "argument": {
                                                                                  "application": {
                                                                                    "function": {
                                                                                      "typeApplication": {"body": {"variable": "hydra.core.extract.model.decodeMaybe"}, "type": {"variable": "hydra.core.packaging.Version"}}},
                                                                                    "argument": {"variable": "hydra.core.decode.packaging.version"}}}}},
                                                                            "argument": {"variable": "fieldMap"}}},
                                                                        "argument": {"variable": "cx"}}}}},
                                                                "argument": {
                                                                  "lambda": {
                                                                    "parameter": "field_upperExclusive",
                                                                    "domain": {"optional": {"variable": "hydra.core.packaging.Version"}},
                                                                    "body": {
                                                                      "typeApplication": {
                                                                        "body": {
                                                                          "typeApplication": {
                                                                            "body": {
                                                                              "either": {
                                                                                "right": {
                                                                                  "record": {
                                                                                    "typeName": "hydra.core.packaging.VersionRange",
                                                                                    "fields": [
                                                                                      {"name": "lowerInclusive", "term": {"variable": "field_lowerInclusive"}},
                                                                                      {"name": "upperExclusive", "term": {"variable": "field_upperExclusive"}}]}}}},
                                                                            "type": {"variable": "hydra.core.errors.DecodingError"}}},
                                                                        "type": {"variable": "hydra.core.packaging.VersionRange"}}}}}}}}}}}}}}}}]}},
                                    "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.packaging.VersionRange"}}}]}}}}},
    {
      "term": {
        "name": "hydra.core.decode.packaging.versionSpecifier",
        "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.packaging.VersionSpecifier"}}}}},
        "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.packaging.VersionSpecifier"}}}}},
                                "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.packaging.VersionSpecifier"}}}}}}},
                            "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.packaging.VersionSpecifier"}}},
                                        "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.packaging.VersionSpecifier"}}}}}}},
                                                            "argument": {
                                                              "list": [
                                                                {
                                                                  "typeApplication": {
                                                                    "body": {
                                                                      "typeApplication": {
                                                                        "body": {
                                                                          "pair": {
                                                                            "first": {"wrap": {"typeName": "hydra.core.model.Name", "body": {"literal": {"string": "any"}}}},
                                                                            "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.packaging.VersionSpecifier"}}},
                                                                                            "type": {"variable": "hydra.core.errors.DecodingError"}}},
                                                                                        "argument": {
                                                                                          "lambda": {
                                                                                            "parameter": "t",
                                                                                            "domain": "unit",
                                                                                            "body": {"inject": {"typeName": "hydra.core.packaging.VersionSpecifier", "field": {"name": "any", "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.packaging.VersionSpecifier"}}}}}}},
                                                                {
                                                                  "typeApplication": {
                                                                    "body": {
                                                                      "typeApplication": {
                                                                        "body": {
                                                                          "pair": {
                                                                            "first": {"wrap": {"typeName": "hydra.core.model.Name", "body": {"literal": {"string": "exact"}}}},
                                                                            "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.packaging.Version"}}},
                                                                                                "type": {"variable": "hydra.core.packaging.VersionSpecifier"}}},
                                                                                            "type": {"variable": "hydra.core.errors.DecodingError"}}},
                                                                                        "argument": {
                                                                                          "lambda": {
                                                                                            "parameter": "t",
                                                                                            "domain": {"variable": "hydra.core.packaging.Version"},
                                                                                            "body": {"inject": {"typeName": "hydra.core.packaging.VersionSpecifier", "field": {"name": "exact", "term": {"variable": "t"}}}}}}}},
                                                                                    "argument": {
                                                                                      "application": {
                                                                                        "function": {"application": {"function": {"variable": "hydra.core.decode.packaging.version"}, "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.packaging.VersionSpecifier"}}}}}}},
                                                                {
                                                                  "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": {"variable": "hydra.core.packaging.Version"}}},
                                                                                                "type": {"variable": "hydra.core.packaging.VersionSpecifier"}}},
                                                                                            "type": {"variable": "hydra.core.errors.DecodingError"}}},
                                                                                        "argument": {
                                                                                          "lambda": {
                                                                                            "parameter": "t",
                                                                                            "domain": {"variable": "hydra.core.packaging.Version"},
                                                                                            "body": {
                                                                                              "inject": {"typeName": "hydra.core.packaging.VersionSpecifier", "field": {"name": "atLeast", "term": {"variable": "t"}}}}}}}},
                                                                                    "argument": {
                                                                                      "application": {
                                                                                        "function": {"application": {"function": {"variable": "hydra.core.decode.packaging.version"}, "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.packaging.VersionSpecifier"}}}}}}},
                                                                {
                                                                  "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.packaging.VersionRange"}}},
                                                                                                "type": {"variable": "hydra.core.packaging.VersionSpecifier"}}},
                                                                                            "type": {"variable": "hydra.core.errors.DecodingError"}}},
                                                                                        "argument": {
                                                                                          "lambda": {
                                                                                            "parameter": "t",
                                                                                            "domain": {"variable": "hydra.core.packaging.VersionRange"},
                                                                                            "body": {"inject": {"typeName": "hydra.core.packaging.VersionSpecifier", "field": {"name": "range", "term": {"variable": "t"}}}}}}}},
                                                                                    "argument": {
                                                                                      "application": {
                                                                                        "function": {"application": {"function": {"variable": "hydra.core.decode.packaging.versionRange"}, "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.packaging.VersionSpecifier"}}}}}}}]}}},
                                                        "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.packaging.VersionSpecifier"}}}}}}},
                                                          "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.packaging.VersionSpecifier"}}}}}}},
                                                                    "type": {
                                                                      "either": {
                                                                        "left": {"variable": "hydra.core.errors.DecodingError"},
                                                                        "right": {"variable": "hydra.core.packaging.VersionSpecifier"}}}}},
                                                                "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.packaging.VersionSpecifier"}}}}}}},
                                                                        "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.packaging.VersionSpecifier"}}}}},
                                                        "argument": {
                                                          "lambda": {
                                                            "parameter": "f",
                                                            "domain": {
                                                              "function": {
                                                                "domain": {"variable": "hydra.core.model.Term"},
                                                                "codomain": {
                                                                  "either": {
                                                                    "left": {"variable": "hydra.core.errors.DecodingError"},
                                                                    "right": {"variable": "hydra.core.packaging.VersionSpecifier"}}}}},
                                                            "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.packaging.VersionSpecifier"}}}]}}}}}]}