packages feed

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

{
  "name": "hydra.core.parse.packaging",
  "metadata": {"description": "Parsers for hydra.core.packaging types", "comments": [], "seeAlso": [], "provisions": []},
  "dependencies": [
    {"module": "hydra.core.annotations"},
    {"module": "hydra.core.lib.chars"},
    {"module": "hydra.core.lib.eithers"},
    {"module": "hydra.core.lib.equality"},
    {"module": "hydra.core.lib.lists"},
    {"module": "hydra.core.lib.literals"},
    {"module": "hydra.core.lib.logic"},
    {"module": "hydra.core.lib.maps"},
    {"module": "hydra.core.lib.math"},
    {"module": "hydra.core.lib.optionals"},
    {"module": "hydra.core.lib.pairs"},
    {"module": "hydra.core.lib.sets"},
    {"module": "hydra.core.lib.strings"},
    {"module": "hydra.core.model"},
    {"module": "hydra.core.names"},
    {"module": "hydra.core.packaging"},
    {"module": "hydra.core.parse.core"},
    {"module": "hydra.core.parse.docs"},
    {"module": "hydra.core.parsers"},
    {"module": "hydra.core.parsing"},
    {"module": "hydra.core.positions"},
    {"module": "hydra.core.rewriting"},
    {"module": "hydra.core.strip"},
    {"module": "hydra.core.typing"},
    {"module": "hydra.core.util"}],
  "definitions": [
    {
      "term": {
        "name": "hydra.core.parse.packaging.attachPrimitiveSignatureDocs",
        "signature": {
          "typeParameters": [],
          "parameters": [
            {
              "name": "arg0",
              "type": {
                "pair": {
                  "first": {"map": {"keys": {"variable": "hydra.core.model.Name"}, "values": {"literal": "string"}}},
                  "second": {"optional": {"literal": "string"}}}},
              "isLazy": false},
            {"name": "arg1", "type": {"variable": "hydra.core.typing.TermSignature"}, "isLazy": false}],
          "result": {"type": {"variable": "hydra.core.typing.TermSignature"}}},
        "body": {
          "annotated": {
            "body": {
              "lambda": {
                "parameter": "docs",
                "domain": {
                  "pair": {
                    "first": {"map": {"keys": {"variable": "hydra.core.model.Name"}, "values": {"literal": "string"}}},
                    "second": {"optional": {"literal": "string"}}}},
                "body": {
                  "lambda": {
                    "parameter": "sig",
                    "domain": {"variable": "hydra.core.typing.TermSignature"},
                    "body": {
                      "let": {
                        "bindings": [
                          {
                            "name": "paramDescs",
                            "term": {
                              "application": {
                                "function": {
                                  "typeApplication": {
                                    "body": {
                                      "typeApplication": {
                                        "body": {"variable": "hydra.core.lib.pairs.first"},
                                        "type": {"map": {"keys": {"variable": "hydra.core.model.Name"}, "values": {"literal": "string"}}}}},
                                    "type": {"optional": {"literal": "string"}}}},
                                "argument": {"variable": "docs"}}},
                            "typeScheme": {
                              "variables": [],
                              "body": {"map": {"keys": {"variable": "hydra.core.model.Name"}, "values": {"literal": "string"}}},
                              "constraints": []}}],
                        "body": {
                          "let": {
                            "bindings": [
                              {
                                "name": "returnDesc",
                                "term": {
                                  "application": {
                                    "function": {
                                      "typeApplication": {
                                        "body": {
                                          "typeApplication": {
                                            "body": {"variable": "hydra.core.lib.pairs.second"},
                                            "type": {"map": {"keys": {"variable": "hydra.core.model.Name"}, "values": {"literal": "string"}}}}},
                                        "type": {"optional": {"literal": "string"}}}},
                                    "argument": {"variable": "docs"}}},
                                "typeScheme": {"variables": [], "body": {"optional": {"literal": "string"}}, "constraints": []}}],
                            "body": {
                              "let": {
                                "bindings": [
                                  {
                                    "name": "attachParam",
                                    "term": {
                                      "lambda": {
                                        "parameter": "p",
                                        "domain": {"variable": "hydra.core.typing.Parameter"},
                                        "body": {
                                          "record": {
                                            "typeName": "hydra.core.typing.Parameter",
                                            "fields": [
                                              {
                                                "name": "name",
                                                "term": {
                                                  "application": {
                                                    "function": {"project": {"typeName": "hydra.core.typing.Parameter", "fieldName": "name"}},
                                                    "argument": {"variable": "p"}}}},
                                              {
                                                "name": "description",
                                                "term": {
                                                  "application": {
                                                    "function": {
                                                      "application": {
                                                        "function": {
                                                          "typeApplication": {
                                                            "body": {"typeApplication": {"body": {"variable": "hydra.core.lib.maps.lookup"}, "type": {"variable": "hydra.core.model.Name"}}},
                                                            "type": {"literal": "string"}}},
                                                        "argument": {
                                                          "application": {
                                                            "function": {"project": {"typeName": "hydra.core.typing.Parameter", "fieldName": "name"}},
                                                            "argument": {"variable": "p"}}}}},
                                                    "argument": {"variable": "paramDescs"}}}},
                                              {
                                                "name": "type",
                                                "term": {
                                                  "application": {
                                                    "function": {"project": {"typeName": "hydra.core.typing.Parameter", "fieldName": "type"}},
                                                    "argument": {"variable": "p"}}}},
                                              {
                                                "name": "isLazy",
                                                "term": {
                                                  "application": {
                                                    "function": {"project": {"typeName": "hydra.core.typing.Parameter", "fieldName": "isLazy"}},
                                                    "argument": {"variable": "p"}}}}]}}}},
                                    "typeScheme": {
                                      "variables": [],
                                      "body": {
                                        "function": {"domain": {"variable": "hydra.core.typing.Parameter"}, "codomain": {"variable": "hydra.core.typing.Parameter"}}},
                                      "constraints": []}}],
                                "body": {
                                  "let": {
                                    "bindings": [
                                      {
                                        "name": "newParams",
                                        "term": {
                                          "application": {
                                            "function": {
                                              "application": {
                                                "function": {
                                                  "typeApplication": {
                                                    "body": {
                                                      "typeApplication": {"body": {"variable": "hydra.core.lib.lists.map"}, "type": {"variable": "hydra.core.typing.Parameter"}}},
                                                    "type": {"variable": "hydra.core.typing.Parameter"}}},
                                                "argument": {"variable": "attachParam"}}},
                                            "argument": {
                                              "application": {
                                                "function": {"project": {"typeName": "hydra.core.typing.TermSignature", "fieldName": "parameters"}},
                                                "argument": {"variable": "sig"}}}}},
                                        "typeScheme": {"variables": [], "body": {"list": {"variable": "hydra.core.typing.Parameter"}}, "constraints": []}}],
                                    "body": {
                                      "let": {
                                        "bindings": [
                                          {
                                            "name": "oldResult",
                                            "term": {
                                              "application": {
                                                "function": {"project": {"typeName": "hydra.core.typing.TermSignature", "fieldName": "result"}},
                                                "argument": {"variable": "sig"}}},
                                            "typeScheme": {"variables": [], "body": {"variable": "hydra.core.typing.Result"}, "constraints": []}}],
                                        "body": {
                                          "let": {
                                            "bindings": [
                                              {
                                                "name": "newResult",
                                                "term": {
                                                  "record": {
                                                    "typeName": "hydra.core.typing.Result",
                                                    "fields": [
                                                      {"name": "description", "term": {"variable": "returnDesc"}},
                                                      {
                                                        "name": "type",
                                                        "term": {
                                                          "application": {
                                                            "function": {"project": {"typeName": "hydra.core.typing.Result", "fieldName": "type"}},
                                                            "argument": {"variable": "oldResult"}}}}]}},
                                                "typeScheme": {"variables": [], "body": {"variable": "hydra.core.typing.Result"}, "constraints": []}}],
                                            "body": {
                                              "record": {
                                                "typeName": "hydra.core.typing.TermSignature",
                                                "fields": [
                                                  {
                                                    "name": "typeParameters",
                                                    "term": {
                                                      "application": {
                                                        "function": {"project": {"typeName": "hydra.core.typing.TermSignature", "fieldName": "typeParameters"}},
                                                        "argument": {"variable": "sig"}}}},
                                                  {"name": "parameters", "term": {"variable": "newParams"}},
                                                  {"name": "result", "term": {"variable": "newResult"}}]}}}}}}}}}}}}}}}}}},
            "annotation": {
              "map": [
                {
                  "key": {"variable": "description"},
                  "value": {
                    "literal": {"string": "Attach '@param'/'@return' descriptions onto an already-parsed TermSignature's parameters/result (#837)"}}}]}}}}},
    {
      "term": {
        "name": "hydra.core.parse.packaging.correctCrossModuleInjectionsInDefinition",
        "signature": {
          "typeParameters": [],
          "parameters": [
            {"name": "arg0", "type": {"set": {"variable": "hydra.core.model.Name"}}, "isLazy": false},
            {"name": "arg1", "type": {"variable": "hydra.core.packaging.Definition"}, "isLazy": false}],
          "result": {"type": {"variable": "hydra.core.packaging.Definition"}}},
        "body": {
          "annotated": {
            "body": {
              "lambda": {
                "parameter": "unionNames",
                "domain": {"set": {"variable": "hydra.core.model.Name"}},
                "body": {
                  "lambda": {
                    "parameter": "def",
                    "domain": {"variable": "hydra.core.packaging.Definition"},
                    "body": {
                      "let": {
                        "bindings": [
                          {
                            "name": "correct",
                            "term": {
                              "application": {
                                "function": {"variable": "hydra.core.parse.packaging.correctCrossModuleInjectionsInTerm"},
                                "argument": {"variable": "unionNames"}}},
                            "typeScheme": {
                              "variables": [],
                              "body": {"function": {"domain": {"variable": "hydra.core.model.Term"}, "codomain": {"variable": "hydra.core.model.Term"}}},
                              "constraints": []}}],
                        "body": {
                          "application": {
                            "function": {
                              "cases": {
                                "typeName": "hydra.core.packaging.Definition",
                                "cases": [
                                  {
                                    "name": "type",
                                    "handler": {
                                      "lambda": {"parameter": "_", "domain": {"variable": "hydra.core.packaging.TypeDefinition"}, "body": {"variable": "def"}}}},
                                  {
                                    "name": "term",
                                    "handler": {
                                      "lambda": {
                                        "parameter": "td",
                                        "domain": {"variable": "hydra.core.packaging.TermDefinition"},
                                        "body": {
                                          "inject": {
                                            "typeName": "hydra.core.packaging.Definition",
                                            "field": {
                                              "name": "term",
                                              "term": {
                                                "record": {
                                                  "typeName": "hydra.core.packaging.TermDefinition",
                                                  "fields": [
                                                    {
                                                      "name": "name",
                                                      "term": {
                                                        "application": {
                                                          "function": {"project": {"typeName": "hydra.core.packaging.TermDefinition", "fieldName": "name"}},
                                                          "argument": {"variable": "td"}}}},
                                                    {
                                                      "name": "metadata",
                                                      "term": {
                                                        "application": {
                                                          "function": {"project": {"typeName": "hydra.core.packaging.TermDefinition", "fieldName": "metadata"}},
                                                          "argument": {"variable": "td"}}}},
                                                    {
                                                      "name": "signature",
                                                      "term": {
                                                        "application": {
                                                          "function": {"project": {"typeName": "hydra.core.packaging.TermDefinition", "fieldName": "signature"}},
                                                          "argument": {"variable": "td"}}}},
                                                    {
                                                      "name": "body",
                                                      "term": {
                                                        "application": {
                                                          "function": {"variable": "correct"},
                                                          "argument": {
                                                            "application": {
                                                              "function": {"project": {"typeName": "hydra.core.packaging.TermDefinition", "fieldName": "body"}},
                                                              "argument": {"variable": "td"}}}}}}]}}}}}}}},
                                  {
                                    "name": "primitive",
                                    "handler": {
                                      "lambda": {
                                        "parameter": "pd",
                                        "domain": {"variable": "hydra.core.packaging.PrimitiveDefinition"},
                                        "body": {
                                          "inject": {
                                            "typeName": "hydra.core.packaging.Definition",
                                            "field": {
                                              "name": "primitive",
                                              "term": {
                                                "record": {
                                                  "typeName": "hydra.core.packaging.PrimitiveDefinition",
                                                  "fields": [
                                                    {
                                                      "name": "name",
                                                      "term": {
                                                        "application": {
                                                          "function": {"project": {"typeName": "hydra.core.packaging.PrimitiveDefinition", "fieldName": "name"}},
                                                          "argument": {"variable": "pd"}}}},
                                                    {
                                                      "name": "metadata",
                                                      "term": {
                                                        "application": {
                                                          "function": {"project": {"typeName": "hydra.core.packaging.PrimitiveDefinition", "fieldName": "metadata"}},
                                                          "argument": {"variable": "pd"}}}},
                                                    {
                                                      "name": "signature",
                                                      "term": {
                                                        "application": {
                                                          "function": {"project": {"typeName": "hydra.core.packaging.PrimitiveDefinition", "fieldName": "signature"}},
                                                          "argument": {"variable": "pd"}}}},
                                                    {
                                                      "name": "isPure",
                                                      "term": {
                                                        "application": {
                                                          "function": {"project": {"typeName": "hydra.core.packaging.PrimitiveDefinition", "fieldName": "isPure"}},
                                                          "argument": {"variable": "pd"}}}},
                                                    {
                                                      "name": "isTotal",
                                                      "term": {
                                                        "application": {
                                                          "function": {"project": {"typeName": "hydra.core.packaging.PrimitiveDefinition", "fieldName": "isTotal"}},
                                                          "argument": {"variable": "pd"}}}},
                                                    {
                                                      "name": "defaultImplementation",
                                                      "term": {
                                                        "application": {
                                                          "function": {
                                                            "application": {
                                                              "function": {
                                                                "typeApplication": {
                                                                  "body": {
                                                                    "typeApplication": {"body": {"variable": "hydra.core.lib.optionals.map"}, "type": {"variable": "hydra.core.model.Term"}}},
                                                                  "type": {"variable": "hydra.core.model.Term"}}},
                                                              "argument": {"variable": "correct"}}},
                                                          "argument": {
                                                            "application": {
                                                              "function": {"project": {"typeName": "hydra.core.packaging.PrimitiveDefinition", "fieldName": "defaultImplementation"}},
                                                              "argument": {"variable": "pd"}}}}}}]}}}}}}}}]}},
                            "argument": {"variable": "def"}}}}}}}}},
            "annotation": {
              "map": [
                {
                  "key": {"variable": "description"},
                  "value": {"literal": {"string": "Apply the cross-module record->injection correction to a definition's term bodies (#5/#837)"}}}]}}}}},
    {
      "term": {
        "name": "hydra.core.parse.packaging.correctCrossModuleInjectionsInTerm",
        "signature": {
          "typeParameters": [],
          "parameters": [
            {"name": "arg0", "type": {"set": {"variable": "hydra.core.model.Name"}}, "isLazy": false},
            {"name": "arg1", "type": {"variable": "hydra.core.model.Term"}, "isLazy": false}],
          "result": {"type": {"variable": "hydra.core.model.Term"}}},
        "body": {
          "annotated": {
            "body": {
              "lambda": {
                "parameter": "unionNames",
                "domain": {"set": {"variable": "hydra.core.model.Name"}},
                "body": {
                  "lambda": {
                    "parameter": "t0",
                    "domain": {"variable": "hydra.core.model.Term"},
                    "body": {
                      "let": {
                        "bindings": [
                          {
                            "name": "rewrite",
                            "term": {
                              "typeLambda": {
                                "parameter": "t0",
                                "body": {
                                  "lambda": {
                                    "parameter": "recurse",
                                    "domain": {"function": {"domain": {"variable": "hydra.core.model.Term"}, "codomain": {"variable": "t0"}}},
                                    "body": {
                                      "lambda": {
                                        "parameter": "term",
                                        "domain": {"variable": "hydra.core.model.Term"},
                                        "body": {
                                          "application": {
                                            "function": {
                                              "cases": {
                                                "typeName": "hydra.core.model.Term",
                                                "default": {"application": {"function": {"variable": "recurse"}, "argument": {"variable": "term"}}},
                                                "cases": [
                                                  {
                                                    "name": "record",
                                                    "handler": {
                                                      "lambda": {
                                                        "parameter": "r",
                                                        "domain": {"variable": "hydra.core.model.Record"},
                                                        "body": {
                                                          "let": {
                                                            "bindings": [
                                                              {
                                                                "name": "tname",
                                                                "term": {
                                                                  "application": {
                                                                    "function": {"project": {"typeName": "hydra.core.model.Record", "fieldName": "typeName"}},
                                                                    "argument": {"variable": "r"}}},
                                                                "typeScheme": {"variables": [], "body": {"variable": "hydra.core.model.Name"}, "constraints": []}}],
                                                            "body": {
                                                              "let": {
                                                                "bindings": [
                                                                  {
                                                                    "name": "flds",
                                                                    "term": {
                                                                      "application": {"function": {"project": {"typeName": "hydra.core.model.Record", "fieldName": "fields"}}, "argument": {"variable": "r"}}},
                                                                    "typeScheme": {"variables": [], "body": {"list": {"variable": "hydra.core.model.Field"}}, "constraints": []}}],
                                                                "body": {
                                                                  "application": {
                                                                    "function": {
                                                                      "application": {
                                                                        "function": {
                                                                          "application": {
                                                                            "function": {"typeApplication": {"body": {"variable": "hydra.core.lib.logic.ifElse"}, "type": {"variable": "t0"}}},
                                                                            "argument": {
                                                                              "application": {
                                                                                "function": {
                                                                                  "application": {
                                                                                    "function": {"variable": "hydra.core.lib.logic.and"},
                                                                                    "argument": {
                                                                                      "application": {
                                                                                        "function": {
                                                                                          "application": {
                                                                                            "function": {"typeApplication": {"body": {"variable": "hydra.core.lib.sets.member"}, "type": {"variable": "hydra.core.model.Name"}}},
                                                                                            "argument": {"variable": "tname"}}},
                                                                                        "argument": {"variable": "unionNames"}}}}},
                                                                                "argument": {
                                                                                  "application": {
                                                                                    "function": {
                                                                                      "application": {
                                                                                        "function": {"typeApplication": {"body": {"variable": "hydra.core.lib.equality.equal"}, "type": {"literal": {"integer": "int32"}}}},
                                                                                        "argument": {
                                                                                          "application": {
                                                                                            "function": {
                                                                                              "typeApplication": {"body": {"variable": "hydra.core.lib.lists.length"}, "type": {"variable": "hydra.core.model.Field"}}},
                                                                                            "argument": {"variable": "flds"}}}}},
                                                                                    "argument": {"literal": {"integer": {"int32": 1}}}}}}}}},
                                                                        "argument": {
                                                                          "application": {
                                                                            "function": {
                                                                              "application": {
                                                                                "function": {
                                                                                  "application": {
                                                                                    "function": {
                                                                                      "typeApplication": {
                                                                                        "body": {
                                                                                          "typeApplication": {"body": {"variable": "hydra.core.lib.optionals.match"}, "type": {"variable": "hydra.core.model.Field"}}},
                                                                                        "type": {"variable": "t0"}}},
                                                                                    "argument": {
                                                                                      "application": {
                                                                                        "function": {"typeApplication": {"body": {"variable": "hydra.core.lib.lists.head"}, "type": {"variable": "hydra.core.model.Field"}}},
                                                                                        "argument": {"variable": "flds"}}}}},
                                                                                "argument": {"application": {"function": {"variable": "recurse"}, "argument": {"variable": "term"}}}}},
                                                                            "argument": {
                                                                              "lambda": {
                                                                                "parameter": "f",
                                                                                "domain": {"variable": "hydra.core.model.Field"},
                                                                                "body": {
                                                                                  "application": {
                                                                                    "function": {"variable": "recurse"},
                                                                                    "argument": {
                                                                                      "inject": {
                                                                                        "typeName": "hydra.core.model.Term",
                                                                                        "field": {
                                                                                          "name": "inject",
                                                                                          "term": {
                                                                                            "record": {
                                                                                              "typeName": "hydra.core.model.Injection",
                                                                                              "fields": [{"name": "typeName", "term": {"variable": "tname"}}, {"name": "field", "term": {"variable": "f"}}]}}}}}}}}}}}}},
                                                                    "argument": {"application": {"function": {"variable": "recurse"}, "argument": {"variable": "term"}}}}}}}}}}}}]}},
                                            "argument": {"variable": "term"}}}}}}}}},
                            "typeScheme": {
                              "variables": ["t0"],
                              "body": {
                                "function": {
                                  "domain": {"function": {"domain": {"variable": "hydra.core.model.Term"}, "codomain": {"variable": "t0"}}},
                                  "codomain": {"function": {"domain": {"variable": "hydra.core.model.Term"}, "codomain": {"variable": "t0"}}}}},
                              "constraints": [{"key": "t0", "value": {"classes": []}}]}}],
                        "body": {
                          "application": {
                            "function": {
                              "application": {
                                "function": {"variable": "hydra.core.rewriting.rewriteTerm"},
                                "argument": {"typeApplication": {"body": {"variable": "rewrite"}, "type": {"variable": "hydra.core.model.Term"}}}}},
                            "argument": {"variable": "t0"}}}}}}}}},
            "annotation": {
              "map": [
                {
                  "key": {"variable": "description"},
                  "value": {
                    "literal": {"string": "Rewrite a one-field record over a KNOWN cross-module union type name into an injection (#5/#837)"}}}]}}}}},
    {
      "term": {
        "name": "hydra.core.parse.packaging.correctInjectionsInDefinition",
        "signature": {
          "typeParameters": [],
          "parameters": [
            {
              "name": "arg0",
              "type": {"map": {"keys": {"variable": "hydra.core.model.Name"}, "values": {"variable": "hydra.core.model.Type"}}},
              "isLazy": false},
            {"name": "arg1", "type": {"variable": "hydra.core.packaging.Definition"}, "isLazy": false}],
          "result": {"type": {"variable": "hydra.core.packaging.Definition"}}},
        "body": {
          "annotated": {
            "body": {
              "lambda": {
                "parameter": "env",
                "domain": {"map": {"keys": {"variable": "hydra.core.model.Name"}, "values": {"variable": "hydra.core.model.Type"}}},
                "body": {
                  "lambda": {
                    "parameter": "def",
                    "domain": {"variable": "hydra.core.packaging.Definition"},
                    "body": {
                      "let": {
                        "bindings": [
                          {
                            "name": "correct",
                            "term": {
                              "application": {"function": {"variable": "hydra.core.parse.packaging.correctInjectionsInTerm"}, "argument": {"variable": "env"}}},
                            "typeScheme": {
                              "variables": [],
                              "body": {"function": {"domain": {"variable": "hydra.core.model.Term"}, "codomain": {"variable": "hydra.core.model.Term"}}},
                              "constraints": []}}],
                        "body": {
                          "application": {
                            "function": {
                              "cases": {
                                "typeName": "hydra.core.packaging.Definition",
                                "cases": [
                                  {
                                    "name": "type",
                                    "handler": {
                                      "lambda": {"parameter": "_", "domain": {"variable": "hydra.core.packaging.TypeDefinition"}, "body": {"variable": "def"}}}},
                                  {
                                    "name": "term",
                                    "handler": {
                                      "lambda": {
                                        "parameter": "td",
                                        "domain": {"variable": "hydra.core.packaging.TermDefinition"},
                                        "body": {
                                          "inject": {
                                            "typeName": "hydra.core.packaging.Definition",
                                            "field": {
                                              "name": "term",
                                              "term": {
                                                "record": {
                                                  "typeName": "hydra.core.packaging.TermDefinition",
                                                  "fields": [
                                                    {
                                                      "name": "name",
                                                      "term": {
                                                        "application": {
                                                          "function": {"project": {"typeName": "hydra.core.packaging.TermDefinition", "fieldName": "name"}},
                                                          "argument": {"variable": "td"}}}},
                                                    {
                                                      "name": "metadata",
                                                      "term": {
                                                        "application": {
                                                          "function": {"project": {"typeName": "hydra.core.packaging.TermDefinition", "fieldName": "metadata"}},
                                                          "argument": {"variable": "td"}}}},
                                                    {
                                                      "name": "signature",
                                                      "term": {
                                                        "application": {
                                                          "function": {"project": {"typeName": "hydra.core.packaging.TermDefinition", "fieldName": "signature"}},
                                                          "argument": {"variable": "td"}}}},
                                                    {
                                                      "name": "body",
                                                      "term": {
                                                        "application": {
                                                          "function": {"variable": "correct"},
                                                          "argument": {
                                                            "application": {
                                                              "function": {"project": {"typeName": "hydra.core.packaging.TermDefinition", "fieldName": "body"}},
                                                              "argument": {"variable": "td"}}}}}}]}}}}}}}},
                                  {
                                    "name": "primitive",
                                    "handler": {
                                      "lambda": {
                                        "parameter": "pd",
                                        "domain": {"variable": "hydra.core.packaging.PrimitiveDefinition"},
                                        "body": {
                                          "inject": {
                                            "typeName": "hydra.core.packaging.Definition",
                                            "field": {
                                              "name": "primitive",
                                              "term": {
                                                "record": {
                                                  "typeName": "hydra.core.packaging.PrimitiveDefinition",
                                                  "fields": [
                                                    {
                                                      "name": "name",
                                                      "term": {
                                                        "application": {
                                                          "function": {"project": {"typeName": "hydra.core.packaging.PrimitiveDefinition", "fieldName": "name"}},
                                                          "argument": {"variable": "pd"}}}},
                                                    {
                                                      "name": "metadata",
                                                      "term": {
                                                        "application": {
                                                          "function": {"project": {"typeName": "hydra.core.packaging.PrimitiveDefinition", "fieldName": "metadata"}},
                                                          "argument": {"variable": "pd"}}}},
                                                    {
                                                      "name": "signature",
                                                      "term": {
                                                        "application": {
                                                          "function": {"project": {"typeName": "hydra.core.packaging.PrimitiveDefinition", "fieldName": "signature"}},
                                                          "argument": {"variable": "pd"}}}},
                                                    {
                                                      "name": "isPure",
                                                      "term": {
                                                        "application": {
                                                          "function": {"project": {"typeName": "hydra.core.packaging.PrimitiveDefinition", "fieldName": "isPure"}},
                                                          "argument": {"variable": "pd"}}}},
                                                    {
                                                      "name": "isTotal",
                                                      "term": {
                                                        "application": {
                                                          "function": {"project": {"typeName": "hydra.core.packaging.PrimitiveDefinition", "fieldName": "isTotal"}},
                                                          "argument": {"variable": "pd"}}}},
                                                    {
                                                      "name": "defaultImplementation",
                                                      "term": {
                                                        "application": {
                                                          "function": {
                                                            "application": {
                                                              "function": {
                                                                "typeApplication": {
                                                                  "body": {
                                                                    "typeApplication": {"body": {"variable": "hydra.core.lib.optionals.map"}, "type": {"variable": "hydra.core.model.Term"}}},
                                                                  "type": {"variable": "hydra.core.model.Term"}}},
                                                              "argument": {"variable": "correct"}}},
                                                          "argument": {
                                                            "application": {
                                                              "function": {"project": {"typeName": "hydra.core.packaging.PrimitiveDefinition", "fieldName": "defaultImplementation"}},
                                                              "argument": {"variable": "pd"}}}}}}]}}}}}}}}]}},
                            "argument": {"variable": "def"}}}}}}}}},
            "annotation": {
              "map": [
                {
                  "key": {"variable": "description"},
                  "value": {"literal": {"string": "Apply the record->injection correction to a definition's term bodies, per the type env (#809)"}}}]}}}}},
    {
      "term": {
        "name": "hydra.core.parse.packaging.correctInjectionsInTerm",
        "signature": {
          "typeParameters": [],
          "parameters": [
            {
              "name": "arg0",
              "type": {"map": {"keys": {"variable": "hydra.core.model.Name"}, "values": {"variable": "hydra.core.model.Type"}}},
              "isLazy": false},
            {"name": "arg1", "type": {"variable": "hydra.core.model.Term"}, "isLazy": false}],
          "result": {"type": {"variable": "hydra.core.model.Term"}}},
        "body": {
          "annotated": {
            "body": {
              "lambda": {
                "parameter": "env",
                "domain": {"map": {"keys": {"variable": "hydra.core.model.Name"}, "values": {"variable": "hydra.core.model.Type"}}},
                "body": {
                  "lambda": {
                    "parameter": "t0",
                    "domain": {"variable": "hydra.core.model.Term"},
                    "body": {
                      "let": {
                        "bindings": [
                          {
                            "name": "rewrite",
                            "term": {
                              "typeLambda": {
                                "parameter": "t0",
                                "body": {
                                  "lambda": {
                                    "parameter": "recurse",
                                    "domain": {"function": {"domain": {"variable": "hydra.core.model.Term"}, "codomain": {"variable": "t0"}}},
                                    "body": {
                                      "lambda": {
                                        "parameter": "term",
                                        "domain": {"variable": "hydra.core.model.Term"},
                                        "body": {
                                          "application": {
                                            "function": {
                                              "cases": {
                                                "typeName": "hydra.core.model.Term",
                                                "default": {"application": {"function": {"variable": "recurse"}, "argument": {"variable": "term"}}},
                                                "cases": [
                                                  {
                                                    "name": "record",
                                                    "handler": {
                                                      "lambda": {
                                                        "parameter": "r",
                                                        "domain": {"variable": "hydra.core.model.Record"},
                                                        "body": {
                                                          "let": {
                                                            "bindings": [
                                                              {
                                                                "name": "tname",
                                                                "term": {
                                                                  "application": {
                                                                    "function": {"project": {"typeName": "hydra.core.model.Record", "fieldName": "typeName"}},
                                                                    "argument": {"variable": "r"}}},
                                                                "typeScheme": {"variables": [], "body": {"variable": "hydra.core.model.Name"}, "constraints": []}}],
                                                            "body": {
                                                              "let": {
                                                                "bindings": [
                                                                  {
                                                                    "name": "flds",
                                                                    "term": {
                                                                      "application": {"function": {"project": {"typeName": "hydra.core.model.Record", "fieldName": "fields"}}, "argument": {"variable": "r"}}},
                                                                    "typeScheme": {"variables": [], "body": {"list": {"variable": "hydra.core.model.Field"}}, "constraints": []}}],
                                                                "body": {
                                                                  "application": {
                                                                    "function": {
                                                                      "application": {
                                                                        "function": {
                                                                          "application": {
                                                                            "function": {
                                                                              "typeApplication": {
                                                                                "body": {
                                                                                  "typeApplication": {"body": {"variable": "hydra.core.lib.optionals.match"}, "type": {"variable": "hydra.core.model.Type"}}},
                                                                                "type": {"variable": "t0"}}},
                                                                            "argument": {
                                                                              "application": {
                                                                                "function": {
                                                                                  "application": {
                                                                                    "function": {
                                                                                      "typeApplication": {
                                                                                        "body": {"typeApplication": {"body": {"variable": "hydra.core.lib.maps.lookup"}, "type": {"variable": "hydra.core.model.Name"}}},
                                                                                        "type": {"variable": "hydra.core.model.Type"}}},
                                                                                    "argument": {"variable": "tname"}}},
                                                                                "argument": {"variable": "env"}}}}},
                                                                        "argument": {"application": {"function": {"variable": "recurse"}, "argument": {"variable": "term"}}}}},
                                                                    "argument": {
                                                                      "lambda": {
                                                                        "parameter": "ty",
                                                                        "domain": {"variable": "hydra.core.model.Type"},
                                                                        "body": {
                                                                          "application": {
                                                                            "function": {
                                                                              "application": {
                                                                                "function": {
                                                                                  "application": {
                                                                                    "function": {"typeApplication": {"body": {"variable": "hydra.core.lib.logic.ifElse"}, "type": {"variable": "t0"}}},
                                                                                    "argument": {
                                                                                      "application": {
                                                                                        "function": {
                                                                                          "application": {
                                                                                            "function": {"variable": "hydra.core.lib.logic.and"},
                                                                                            "argument": {"application": {"function": {"variable": "hydra.core.parse.packaging.isUnionType"}, "argument": {"variable": "ty"}}}}},
                                                                                        "argument": {
                                                                                          "application": {
                                                                                            "function": {
                                                                                              "application": {
                                                                                                "function": {"typeApplication": {"body": {"variable": "hydra.core.lib.equality.equal"}, "type": {"literal": {"integer": "int32"}}}},
                                                                                                "argument": {
                                                                                                  "application": {
                                                                                                    "function": {
                                                                                                      "typeApplication": {"body": {"variable": "hydra.core.lib.lists.length"}, "type": {"variable": "hydra.core.model.Field"}}},
                                                                                                    "argument": {"variable": "flds"}}}}},
                                                                                            "argument": {"literal": {"integer": {"int32": 1}}}}}}}}},
                                                                                "argument": {
                                                                                  "application": {
                                                                                    "function": {
                                                                                      "application": {
                                                                                        "function": {
                                                                                          "application": {
                                                                                            "function": {
                                                                                              "typeApplication": {
                                                                                                "body": {
                                                                                                  "typeApplication": {"body": {"variable": "hydra.core.lib.optionals.match"}, "type": {"variable": "hydra.core.model.Field"}}},
                                                                                                "type": {"variable": "t0"}}},
                                                                                            "argument": {
                                                                                              "application": {
                                                                                                "function": {"typeApplication": {"body": {"variable": "hydra.core.lib.lists.head"}, "type": {"variable": "hydra.core.model.Field"}}},
                                                                                                "argument": {"variable": "flds"}}}}},
                                                                                        "argument": {"application": {"function": {"variable": "recurse"}, "argument": {"variable": "term"}}}}},
                                                                                    "argument": {
                                                                                      "lambda": {
                                                                                        "parameter": "f",
                                                                                        "domain": {"variable": "hydra.core.model.Field"},
                                                                                        "body": {
                                                                                          "application": {
                                                                                            "function": {"variable": "recurse"},
                                                                                            "argument": {
                                                                                              "inject": {
                                                                                                "typeName": "hydra.core.model.Term",
                                                                                                "field": {
                                                                                                  "name": "inject",
                                                                                                  "term": {
                                                                                                    "record": {
                                                                                                      "typeName": "hydra.core.model.Injection",
                                                                                                      "fields": [{"name": "typeName", "term": {"variable": "tname"}}, {"name": "field", "term": {"variable": "f"}}]}}}}}}}}}}}}},
                                                                            "argument": {"application": {"function": {"variable": "recurse"}, "argument": {"variable": "term"}}}}}}}}}}}}}}}}]}},
                                            "argument": {"variable": "term"}}}}}}}}},
                            "typeScheme": {
                              "variables": ["t0"],
                              "body": {
                                "function": {
                                  "domain": {"function": {"domain": {"variable": "hydra.core.model.Term"}, "codomain": {"variable": "t0"}}},
                                  "codomain": {"function": {"domain": {"variable": "hydra.core.model.Term"}, "codomain": {"variable": "t0"}}}}},
                              "constraints": [{"key": "t0", "value": {"classes": []}}]}}],
                        "body": {
                          "application": {
                            "function": {
                              "application": {
                                "function": {"variable": "hydra.core.rewriting.rewriteTerm"},
                                "argument": {"typeApplication": {"body": {"variable": "rewrite"}, "type": {"variable": "hydra.core.model.Term"}}}}},
                            "argument": {"variable": "t0"}}}}}}}}},
            "annotation": {
              "map": [
                {
                  "key": {"variable": "description"},
                  "value": {"literal": {"string": "Rewrite a one-field record over a union type into an injection, per the type env (#809)"}}}]}}}}},
    {
      "term": {
        "name": "hydra.core.parse.packaging.definitionParser",
        "signature": {
          "typeParameters": [],
          "parameters": [{"name": "arg0", "type": {"variable": "hydra.core.packaging.ModuleName"}, "isLazy": false}],
          "result": {
            "type": {
              "application": {"function": {"variable": "hydra.core.parsing.Parser"}, "argument": {"variable": "hydra.core.packaging.Definition"}}}}},
        "body": {
          "annotated": {
            "body": {
              "lambda": {
                "parameter": "modName",
                "domain": {"variable": "hydra.core.packaging.ModuleName"},
                "body": {
                  "application": {
                    "function": {
                      "typeApplication": {"body": {"variable": "hydra.core.parsers.choice"}, "type": {"variable": "hydra.core.packaging.Definition"}}},
                    "argument": {
                      "list": [
                        {
                          "application": {
                            "function": {
                              "typeApplication": {"body": {"variable": "hydra.core.parsers.try"}, "type": {"variable": "hydra.core.packaging.Definition"}}},
                            "argument": {
                              "application": {"function": {"variable": "hydra.core.parse.packaging.typeDefinitionParser"}, "argument": {"variable": "modName"}}}}},
                        {
                          "application": {
                            "function": {
                              "typeApplication": {"body": {"variable": "hydra.core.parsers.try"}, "type": {"variable": "hydra.core.packaging.Definition"}}},
                            "argument": {
                              "application": {"function": {"variable": "hydra.core.parse.packaging.termDefinitionParser"}, "argument": {"variable": "modName"}}}}},
                        {
                          "application": {"function": {"variable": "hydra.core.parse.packaging.primitiveDefinitionParser"}, "argument": {"variable": "modName"}}}]}}}}},
            "annotation": {
              "map": [
                {
                  "key": {"variable": "description"},
                  "value": {"literal": {"string": "Parse a single definition: type, term, or primitive"}}}]}}}}},
    {
      "term": {
        "name": "hydra.core.parse.packaging.docCommentBlock",
        "signature": {
          "typeParameters": [],
          "parameters": [{"name": "arg0", "type": {"variable": "hydra.core.packaging.ModuleName"}, "isLazy": false}],
          "result": {
            "type": {
              "application": {
                "function": {"variable": "hydra.core.parsing.Parser"},
                "argument": {"optional": {"variable": "hydra.core.packaging.EntityMetadata"}}}}}},
        "body": {
          "annotated": {
            "body": {
              "lambda": {
                "parameter": "modName",
                "domain": {"variable": "hydra.core.packaging.ModuleName"},
                "body": {
                  "application": {
                    "function": {
                      "application": {
                        "function": {
                          "typeApplication": {
                            "body": {"typeApplication": {"body": {"variable": "hydra.core.parsers.bind"}, "type": {"list": {"literal": "string"}}}},
                            "type": {"optional": {"variable": "hydra.core.packaging.EntityMetadata"}}}},
                        "argument": {
                          "application": {
                            "function": {"typeApplication": {"body": {"variable": "hydra.core.parsers.many"}, "type": {"literal": "string"}}},
                            "argument": {
                              "application": {
                                "function": {
                                  "application": {
                                    "function": {
                                      "typeApplication": {
                                        "body": {"typeApplication": {"body": {"variable": "hydra.core.parsers.bind"}, "type": {"literal": {"integer": "int32"}}}},
                                        "type": {"literal": "string"}}},
                                    "argument": {
                                      "application": {"function": {"variable": "hydra.core.parsers.char"}, "argument": {"literal": {"integer": {"int32": 35}}}}}}},
                                "argument": {
                                  "lambda": {
                                    "parameter": "_",
                                    "domain": {"literal": {"integer": "int32"}},
                                    "body": {
                                      "application": {
                                        "function": {
                                          "application": {
                                            "function": {
                                              "typeApplication": {
                                                "body": {"typeApplication": {"body": {"variable": "hydra.core.parsers.bind"}, "type": {"literal": {"integer": "int32"}}}},
                                                "type": {"literal": "string"}}},
                                            "argument": {
                                              "application": {"function": {"variable": "hydra.core.parsers.char"}, "argument": {"literal": {"integer": {"int32": 35}}}}}}},
                                        "argument": {
                                          "lambda": {
                                            "parameter": "_",
                                            "domain": {"literal": {"integer": "int32"}},
                                            "body": {
                                              "application": {
                                                "function": {
                                                  "application": {
                                                    "function": {
                                                      "typeApplication": {
                                                        "body": {
                                                          "typeApplication": {"body": {"variable": "hydra.core.parsers.bind"}, "type": {"optional": {"literal": {"integer": "int32"}}}}},
                                                        "type": {"literal": "string"}}},
                                                    "argument": {
                                                      "application": {
                                                        "function": {"typeApplication": {"body": {"variable": "hydra.core.parsers.optional"}, "type": {"literal": {"integer": "int32"}}}},
                                                        "argument": {
                                                          "application": {"function": {"variable": "hydra.core.parsers.char"}, "argument": {"literal": {"integer": {"int32": 32}}}}}}}}},
                                                "argument": {
                                                  "lambda": {
                                                    "parameter": "_",
                                                    "domain": {"optional": {"literal": {"integer": "int32"}}},
                                                    "body": {
                                                      "application": {
                                                        "function": {
                                                          "application": {
                                                            "function": {
                                                              "typeApplication": {
                                                                "body": {"typeApplication": {"body": {"variable": "hydra.core.parsers.bind"}, "type": {"literal": "string"}}},
                                                                "type": {"literal": "string"}}},
                                                            "argument": {
                                                              "application": {
                                                                "function": {
                                                                  "application": {
                                                                    "function": {
                                                                      "typeApplication": {
                                                                        "body": {
                                                                          "typeApplication": {"body": {"variable": "hydra.core.parsers.map"}, "type": {"list": {"literal": {"integer": "int32"}}}}},
                                                                        "type": {"literal": "string"}}},
                                                                    "argument": {
                                                                      "lambda": {
                                                                        "parameter": "cs",
                                                                        "domain": {"list": {"literal": {"integer": "int32"}}},
                                                                        "body": {"application": {"function": {"variable": "hydra.core.lib.strings.fromList"}, "argument": {"variable": "cs"}}}}}}},
                                                                "argument": {
                                                                  "application": {
                                                                    "function": {"typeApplication": {"body": {"variable": "hydra.core.parsers.many"}, "type": {"literal": {"integer": "int32"}}}},
                                                                    "argument": {
                                                                      "application": {
                                                                        "function": {"variable": "hydra.core.parsers.satisfy"},
                                                                        "argument": {
                                                                          "lambda": {
                                                                            "parameter": "c",
                                                                            "domain": {"literal": {"integer": "int32"}},
                                                                            "body": {
                                                                              "application": {
                                                                                "function": {"variable": "hydra.core.lib.logic.not"},
                                                                                "argument": {
                                                                                  "application": {
                                                                                    "function": {
                                                                                      "application": {
                                                                                        "function": {"typeApplication": {"body": {"variable": "hydra.core.lib.equality.equal"}, "type": {"literal": {"integer": "int32"}}}},
                                                                                        "argument": {"variable": "c"}}},
                                                                                    "argument": {"literal": {"integer": {"int32": 10}}}}}}}}}}}}}}}}},
                                                        "argument": {
                                                          "lambda": {
                                                            "parameter": "s",
                                                            "domain": {"literal": "string"},
                                                            "body": {
                                                              "application": {
                                                                "function": {
                                                                  "application": {
                                                                    "function": {
                                                                      "typeApplication": {
                                                                        "body": {"typeApplication": {"body": {"variable": "hydra.core.parsers.bind"}, "type": "unit"}},
                                                                        "type": {"literal": "string"}}},
                                                                    "argument": {
                                                                      "application": {
                                                                        "function": {
                                                                          "application": {
                                                                            "function": {
                                                                              "typeApplication": {
                                                                                "body": {
                                                                                  "typeApplication": {"body": {"variable": "hydra.core.parsers.map"}, "type": {"list": {"literal": {"integer": "int32"}}}}},
                                                                                "type": "unit"}},
                                                                            "argument": {"lambda": {"parameter": "_", "domain": {"list": {"literal": {"integer": "int32"}}}, "body": "unit"}}}},
                                                                        "argument": {
                                                                          "application": {
                                                                            "function": {"typeApplication": {"body": {"variable": "hydra.core.parsers.many"}, "type": {"literal": {"integer": "int32"}}}},
                                                                            "argument": {
                                                                              "application": {
                                                                                "function": {"variable": "hydra.core.parsers.satisfy"},
                                                                                "argument": {
                                                                                  "lambda": {
                                                                                    "parameter": "c",
                                                                                    "domain": {"literal": {"integer": "int32"}},
                                                                                    "body": {"application": {"function": {"variable": "hydra.core.lib.chars.isSpace"}, "argument": {"variable": "c"}}}}}}}}}}}}},
                                                                "argument": {
                                                                  "lambda": {
                                                                    "parameter": "_",
                                                                    "domain": "unit",
                                                                    "body": {
                                                                      "application": {
                                                                        "function": {"typeApplication": {"body": {"variable": "hydra.core.parsers.pure"}, "type": {"literal": "string"}}},
                                                                        "argument": {"variable": "s"}}}}}}}}}}}}}}}}}}}}}}}}}}},
                    "argument": {
                      "lambda": {
                        "parameter": "lns",
                        "domain": {"list": {"literal": "string"}},
                        "body": {
                          "application": {
                            "function": {
                              "application": {
                                "function": {
                                  "application": {
                                    "function": {
                                      "typeApplication": {
                                        "body": {"variable": "hydra.core.lib.logic.ifElse"},
                                        "type": {
                                          "application": {
                                            "function": {"variable": "hydra.core.parsing.Parser"},
                                            "argument": {"optional": {"variable": "hydra.core.packaging.EntityMetadata"}}}}}},
                                    "argument": {
                                      "application": {
                                        "function": {"typeApplication": {"body": {"variable": "hydra.core.lib.lists.isEmpty"}, "type": {"literal": "string"}}},
                                        "argument": {"variable": "lns"}}}}},
                                "argument": {
                                  "application": {
                                    "function": {
                                      "typeApplication": {
                                        "body": {"variable": "hydra.core.parsers.pure"},
                                        "type": {"optional": {"variable": "hydra.core.packaging.EntityMetadata"}}}},
                                    "argument": {"typeApplication": {"body": {"optional": null}, "type": {"variable": "hydra.core.packaging.EntityMetadata"}}}}}}},
                            "argument": {
                              "application": {
                                "function": {
                                  "typeApplication": {
                                    "body": {"variable": "hydra.core.parsers.pure"},
                                    "type": {"optional": {"variable": "hydra.core.packaging.EntityMetadata"}}}},
                                "argument": {
                                  "optional": {
                                    "application": {
                                      "function": {
                                        "application": {
                                          "function": {
                                            "lambda": {
                                              "parameter": "modName",
                                              "domain": {"variable": "hydra.core.packaging.ModuleName"},
                                              "body": {
                                                "lambda": {
                                                  "parameter": "lns",
                                                  "domain": {"list": {"literal": "string"}},
                                                  "body": {
                                                    "let": {
                                                      "bindings": [
                                                        {
                                                          "name": "sections",
                                                          "term": {
                                                            "application": {
                                                              "function": {
                                                                "lambda": {
                                                                  "parameter": "lns",
                                                                  "domain": {"list": {"literal": "string"}},
                                                                  "body": {
                                                                    "let": {
                                                                      "bindings": [
                                                                        {
                                                                          "name": "step",
                                                                          "term": {
                                                                            "lambda": {
                                                                              "parameter": "acc",
                                                                              "domain": {"list": {"list": {"literal": "string"}}},
                                                                              "body": {
                                                                                "lambda": {
                                                                                  "parameter": "ln",
                                                                                  "domain": {"literal": "string"},
                                                                                  "body": {
                                                                                    "application": {
                                                                                      "function": {
                                                                                        "application": {
                                                                                          "function": {
                                                                                            "application": {
                                                                                              "function": {
                                                                                                "typeApplication": {"body": {"variable": "hydra.core.lib.logic.ifElse"}, "type": {"list": {"list": {"literal": "string"}}}}},
                                                                                              "argument": {"application": {"function": {"variable": "hydra.core.lib.strings.isEmpty"}, "argument": {"variable": "ln"}}}}},
                                                                                          "argument": {
                                                                                            "application": {
                                                                                              "function": {
                                                                                                "application": {
                                                                                                  "function": {"typeApplication": {"body": {"variable": "hydra.core.lib.lists.concat2"}, "type": {"list": {"literal": "string"}}}},
                                                                                                  "argument": {"variable": "acc"}}},
                                                                                              "argument": {"list": [{"typeApplication": {"body": {"list": []}, "type": {"literal": "string"}}}]}}}}},
                                                                                      "argument": {
                                                                                        "let": {
                                                                                          "bindings": [
                                                                                            {
                                                                                              "name": "i",
                                                                                              "term": {
                                                                                                "application": {
                                                                                                  "function": {
                                                                                                    "application": {
                                                                                                      "function": {"typeApplication": {"body": {"variable": "hydra.core.lib.math.sub"}, "type": {"literal": {"integer": "int32"}}}},
                                                                                                      "argument": {
                                                                                                        "application": {
                                                                                                          "function": {"typeApplication": {"body": {"variable": "hydra.core.lib.lists.length"}, "type": {"list": {"literal": "string"}}}},
                                                                                                          "argument": {"variable": "acc"}}}}},
                                                                                                  "argument": {"literal": {"integer": {"int32": 1}}}}},
                                                                                              "typeScheme": {"variables": [], "body": {"literal": {"integer": "int32"}}, "constraints": []}}],
                                                                                          "body": {
                                                                                            "let": {
                                                                                              "bindings": [
                                                                                                {
                                                                                                  "name": "cur",
                                                                                                  "term": {
                                                                                                    "application": {
                                                                                                      "function": {
                                                                                                        "application": {
                                                                                                          "function": {
                                                                                                            "typeApplication": {"body": {"variable": "hydra.core.lib.optionals.withDefault"}, "type": {"list": {"literal": "string"}}}},
                                                                                                          "argument": {"typeApplication": {"body": {"list": []}, "type": {"literal": "string"}}}}},
                                                                                                      "argument": {
                                                                                                        "application": {
                                                                                                          "function": {"typeApplication": {"body": {"variable": "hydra.core.lib.lists.head"}, "type": {"list": {"literal": "string"}}}},
                                                                                                          "argument": {
                                                                                                            "application": {
                                                                                                              "function": {
                                                                                                                "application": {
                                                                                                                  "function": {"typeApplication": {"body": {"variable": "hydra.core.lib.lists.drop"}, "type": {"list": {"literal": "string"}}}},
                                                                                                                  "argument": {"variable": "i"}}},
                                                                                                              "argument": {"variable": "acc"}}}}}}},
                                                                                                  "typeScheme": {"variables": [], "body": {"list": {"literal": "string"}}, "constraints": []}}],
                                                                                              "body": {
                                                                                                "application": {
                                                                                                  "function": {
                                                                                                    "application": {
                                                                                                      "function": {"typeApplication": {"body": {"variable": "hydra.core.lib.lists.concat2"}, "type": {"list": {"literal": "string"}}}},
                                                                                                      "argument": {
                                                                                                        "application": {
                                                                                                          "function": {
                                                                                                            "application": {
                                                                                                              "function": {"typeApplication": {"body": {"variable": "hydra.core.lib.lists.take"}, "type": {"list": {"literal": "string"}}}},
                                                                                                              "argument": {"variable": "i"}}},
                                                                                                          "argument": {"variable": "acc"}}}}},
                                                                                                  "argument": {
                                                                                                    "list": [
                                                                                                      {
                                                                                                        "application": {
                                                                                                          "function": {
                                                                                                            "application": {
                                                                                                              "function": {"typeApplication": {"body": {"variable": "hydra.core.lib.lists.concat2"}, "type": {"literal": "string"}}},
                                                                                                              "argument": {"variable": "cur"}}},
                                                                                                          "argument": {"list": [{"variable": "ln"}]}}}]}}}}}}}}}}}}},
                                                                          "typeScheme": {
                                                                            "variables": [],
                                                                            "body": {
                                                                              "function": {
                                                                                "domain": {"list": {"list": {"literal": "string"}}},
                                                                                "codomain": {"function": {"domain": {"literal": "string"}, "codomain": {"list": {"list": {"literal": "string"}}}}}}},
                                                                            "constraints": []}}],
                                                                      "body": {
                                                                        "application": {
                                                                          "function": {
                                                                            "application": {
                                                                              "function": {"typeApplication": {"body": {"variable": "hydra.core.lib.lists.filter"}, "type": {"list": {"literal": "string"}}}},
                                                                              "argument": {
                                                                                "lambda": {
                                                                                  "parameter": "sec",
                                                                                  "domain": {"list": {"literal": "string"}},
                                                                                  "body": {
                                                                                    "application": {
                                                                                      "function": {"variable": "hydra.core.lib.logic.not"},
                                                                                      "argument": {
                                                                                        "application": {
                                                                                          "function": {"typeApplication": {"body": {"variable": "hydra.core.lib.lists.isEmpty"}, "type": {"literal": "string"}}},
                                                                                          "argument": {"variable": "sec"}}}}}}}}},
                                                                          "argument": {
                                                                            "application": {
                                                                              "function": {
                                                                                "application": {
                                                                                  "function": {
                                                                                    "application": {
                                                                                      "function": {
                                                                                        "typeApplication": {
                                                                                          "body": {
                                                                                            "typeApplication": {"body": {"variable": "hydra.core.lib.lists.foldl"}, "type": {"list": {"list": {"literal": "string"}}}}},
                                                                                          "type": {"literal": "string"}}},
                                                                                      "argument": {"variable": "step"}}},
                                                                                  "argument": {"list": [{"typeApplication": {"body": {"list": []}, "type": {"literal": "string"}}}]}}},
                                                                              "argument": {"variable": "lns"}}}}}}}}},
                                                              "argument": {"variable": "lns"}}},
                                                          "typeScheme": {"variables": [], "body": {"list": {"list": {"literal": "string"}}}, "constraints": []}}],
                                                      "body": {
                                                        "let": {
                                                          "bindings": [
                                                            {
                                                              "name": "isKeySection",
                                                              "term": {
                                                                "lambda": {
                                                                  "parameter": "sec",
                                                                  "domain": {"list": {"literal": "string"}},
                                                                  "body": {
                                                                    "application": {
                                                                      "function": {
                                                                        "application": {
                                                                          "function": {
                                                                            "application": {
                                                                              "function": {
                                                                                "typeApplication": {
                                                                                  "body": {"typeApplication": {"body": {"variable": "hydra.core.lib.optionals.match"}, "type": {"literal": "string"}}},
                                                                                  "type": {"literal": "boolean"}}},
                                                                              "argument": {
                                                                                "application": {
                                                                                  "function": {"typeApplication": {"body": {"variable": "hydra.core.lib.lists.head"}, "type": {"literal": "string"}}},
                                                                                  "argument": {"variable": "sec"}}}}},
                                                                          "argument": {"literal": {"boolean": false}}}},
                                                                      "argument": {
                                                                        "lambda": {
                                                                          "parameter": "s",
                                                                          "domain": {"literal": "string"},
                                                                          "body": {
                                                                            "application": {
                                                                              "function": {
                                                                                "application": {
                                                                                  "function": {
                                                                                    "application": {
                                                                                      "function": {
                                                                                        "typeApplication": {
                                                                                          "body": {"typeApplication": {"body": {"variable": "hydra.core.lib.optionals.match"}, "type": {"literal": {"integer": "int32"}}}},
                                                                                          "type": {"literal": "boolean"}}},
                                                                                      "argument": {
                                                                                        "application": {
                                                                                          "function": {
                                                                                            "application": {"function": {"variable": "hydra.core.lib.strings.charAt"}, "argument": {"literal": {"integer": {"int32": 0}}}}},
                                                                                          "argument": {"variable": "s"}}}}},
                                                                                  "argument": {"literal": {"boolean": false}}}},
                                                                              "argument": {
                                                                                "lambda": {
                                                                                  "parameter": "c",
                                                                                  "domain": {"literal": {"integer": "int32"}},
                                                                                  "body": {
                                                                                    "application": {
                                                                                      "function": {
                                                                                        "application": {
                                                                                          "function": {"typeApplication": {"body": {"variable": "hydra.core.lib.equality.equal"}, "type": {"literal": {"integer": "int32"}}}},
                                                                                          "argument": {"variable": "c"}}},
                                                                                      "argument": {"literal": {"integer": {"int32": 64}}}}}}}}}}}}}}},
                                                              "typeScheme": {
                                                                "variables": [],
                                                                "body": {"function": {"domain": {"list": {"literal": "string"}}, "codomain": {"literal": "boolean"}}},
                                                                "constraints": []}}],
                                                          "body": {
                                                            "let": {
                                                              "bindings": [
                                                                {
                                                                  "name": "keyLines",
                                                                  "term": {
                                                                    "application": {
                                                                      "function": {"typeApplication": {"body": {"variable": "hydra.core.lib.lists.concat"}, "type": {"literal": "string"}}},
                                                                      "argument": {
                                                                        "application": {
                                                                          "function": {
                                                                            "application": {
                                                                              "function": {"typeApplication": {"body": {"variable": "hydra.core.lib.lists.filter"}, "type": {"list": {"literal": "string"}}}},
                                                                              "argument": {"variable": "isKeySection"}}},
                                                                          "argument": {"variable": "sections"}}}}},
                                                                  "typeScheme": {"variables": [], "body": {"list": {"literal": "string"}}, "constraints": []}}],
                                                              "body": {
                                                                "let": {
                                                                  "bindings": [
                                                                    {
                                                                      "name": "nonKeySections",
                                                                      "term": {
                                                                        "application": {
                                                                          "function": {
                                                                            "application": {
                                                                              "function": {"typeApplication": {"body": {"variable": "hydra.core.lib.lists.filter"}, "type": {"list": {"literal": "string"}}}},
                                                                              "argument": {
                                                                                "lambda": {
                                                                                  "parameter": "sec",
                                                                                  "domain": {"list": {"literal": "string"}},
                                                                                  "body": {
                                                                                    "application": {
                                                                                      "function": {"variable": "hydra.core.lib.logic.not"},
                                                                                      "argument": {"application": {"function": {"variable": "isKeySection"}, "argument": {"variable": "sec"}}}}}}}}},
                                                                          "argument": {"variable": "sections"}}},
                                                                      "typeScheme": {"variables": [], "body": {"list": {"list": {"literal": "string"}}}, "constraints": []}}],
                                                                  "body": {
                                                                    "let": {
                                                                      "bindings": [
                                                                        {
                                                                          "name": "mdesc",
                                                                          "term": {
                                                                            "application": {
                                                                              "function": {
                                                                                "application": {
                                                                                  "function": {
                                                                                    "typeApplication": {
                                                                                      "body": {"typeApplication": {"body": {"variable": "hydra.core.lib.optionals.map"}, "type": {"list": {"literal": "string"}}}},
                                                                                      "type": {"literal": "string"}}},
                                                                                  "argument": {
                                                                                    "lambda": {
                                                                                      "parameter": "sec",
                                                                                      "domain": {"list": {"literal": "string"}},
                                                                                      "body": {
                                                                                        "application": {
                                                                                          "function": {"application": {"function": {"variable": "hydra.core.lib.strings.join"}, "argument": {"literal": {"string": "\n"}}}},
                                                                                          "argument": {"variable": "sec"}}}}}}},
                                                                              "argument": {
                                                                                "application": {
                                                                                  "function": {"typeApplication": {"body": {"variable": "hydra.core.lib.lists.head"}, "type": {"list": {"literal": "string"}}}},
                                                                                  "argument": {"variable": "nonKeySections"}}}}},
                                                                          "typeScheme": {"variables": [], "body": {"optional": {"literal": "string"}}, "constraints": []}}],
                                                                      "body": {
                                                                        "let": {
                                                                          "bindings": [
                                                                            {
                                                                              "name": "comments",
                                                                              "term": {
                                                                                "application": {
                                                                                  "function": {
                                                                                    "application": {
                                                                                      "function": {
                                                                                        "typeApplication": {"body": {"variable": "hydra.core.lib.optionals.withDefault"}, "type": {"list": {"literal": "string"}}}},
                                                                                      "argument": {"typeApplication": {"body": {"list": []}, "type": {"literal": "string"}}}}},
                                                                                  "argument": {
                                                                                    "application": {
                                                                                      "function": {"typeApplication": {"body": {"variable": "hydra.core.lib.lists.head"}, "type": {"list": {"literal": "string"}}}},
                                                                                      "argument": {
                                                                                        "application": {
                                                                                          "function": {
                                                                                            "application": {
                                                                                              "function": {"typeApplication": {"body": {"variable": "hydra.core.lib.lists.drop"}, "type": {"list": {"literal": "string"}}}},
                                                                                              "argument": {"literal": {"integer": {"int32": 1}}}}},
                                                                                          "argument": {"variable": "nonKeySections"}}}}}}},
                                                                              "typeScheme": {"variables": [], "body": {"list": {"literal": "string"}}, "constraints": []}}],
                                                                          "body": {
                                                                            "let": {
                                                                              "bindings": [
                                                                                {
                                                                                  "name": "seeAlso",
                                                                                  "term": {
                                                                                    "application": {
                                                                                      "function": {
                                                                                        "typeApplication": {"body": {"variable": "hydra.core.lib.optionals.givens"}, "type": {"variable": "hydra.core.packaging.EntityReference"}}},
                                                                                      "argument": {
                                                                                        "application": {
                                                                                          "function": {
                                                                                            "application": {
                                                                                              "function": {
                                                                                                "typeApplication": {
                                                                                                  "body": {"typeApplication": {"body": {"variable": "hydra.core.lib.lists.map"}, "type": {"literal": "string"}}},
                                                                                                  "type": {"optional": {"variable": "hydra.core.packaging.EntityReference"}}}},
                                                                                              "argument": {
                                                                                                "lambda": {
                                                                                                  "parameter": "ln",
                                                                                                  "domain": {"literal": "string"},
                                                                                                  "body": {
                                                                                                    "let": {
                                                                                                      "bindings": [
                                                                                                        {
                                                                                                          "name": "parts",
                                                                                                          "term": {
                                                                                                            "application": {
                                                                                                              "function": {"application": {"function": {"variable": "hydra.core.lib.strings.splitOn"}, "argument": {"literal": {"string": " "}}}},
                                                                                                              "argument": {"variable": "ln"}}},
                                                                                                          "typeScheme": {"variables": [], "body": {"list": {"literal": "string"}}, "constraints": []}}],
                                                                                                      "body": {
                                                                                                        "application": {
                                                                                                          "function": {
                                                                                                            "application": {
                                                                                                              "function": {
                                                                                                                "application": {
                                                                                                                  "function": {
                                                                                                                    "typeApplication": {
                                                                                                                      "body": {"variable": "hydra.core.lib.logic.ifElse"},
                                                                                                                      "type": {"optional": {"variable": "hydra.core.packaging.EntityReference"}}}},
                                                                                                                  "argument": {
                                                                                                                    "application": {
                                                                                                                      "function": {
                                                                                                                        "application": {
                                                                                                                          "function": {"typeApplication": {"body": {"variable": "hydra.core.lib.equality.equal"}, "type": {"literal": "string"}}},
                                                                                                                          "argument": {
                                                                                                                            "application": {
                                                                                                                              "function": {
                                                                                                                                "application": {
                                                                                                                                  "function": {"typeApplication": {"body": {"variable": "hydra.core.lib.optionals.withDefault"}, "type": {"literal": "string"}}},
                                                                                                                                  "argument": {"literal": {"string": ""}}}},
                                                                                                                              "argument": {
                                                                                                                                "application": {
                                                                                                                                  "function": {"typeApplication": {"body": {"variable": "hydra.core.lib.lists.head"}, "type": {"literal": "string"}}},
                                                                                                                                  "argument": {"variable": "parts"}}}}}}},
                                                                                                                      "argument": {"literal": {"string": "@seeAlso"}}}}}},
                                                                                                              "argument": {
                                                                                                                "application": {
                                                                                                                  "function": {"variable": "hydra.core.parse.docs.parseDocAnnotation"},
                                                                                                                  "argument": {
                                                                                                                    "application": {
                                                                                                                      "function": {"application": {"function": {"variable": "hydra.core.lib.strings.join"}, "argument": {"literal": {"string": " "}}}},
                                                                                                                      "argument": {
                                                                                                                        "application": {
                                                                                                                          "function": {
                                                                                                                            "application": {
                                                                                                                              "function": {"typeApplication": {"body": {"variable": "hydra.core.lib.lists.drop"}, "type": {"literal": "string"}}},
                                                                                                                              "argument": {"literal": {"integer": {"int32": 1}}}}},
                                                                                                                          "argument": {"variable": "parts"}}}}}}}}},
                                                                                                          "argument": {"typeApplication": {"body": {"optional": null}, "type": {"variable": "hydra.core.packaging.EntityReference"}}}}}}}}}}},
                                                                                          "argument": {"variable": "keyLines"}}}}},
                                                                                  "typeScheme": {"variables": [], "body": {"list": {"variable": "hydra.core.packaging.EntityReference"}}, "constraints": []}}],
                                                                              "body": {
                                                                                "let": {
                                                                                  "bindings": [
                                                                                    {
                                                                                      "name": "avail",
                                                                                      "term": {
                                                                                        "application": {
                                                                                          "function": {
                                                                                            "typeApplication": {"body": {"variable": "hydra.core.lib.optionals.givens"}, "type": {"variable": "hydra.core.packaging.Version"}}},
                                                                                          "argument": {
                                                                                            "application": {
                                                                                              "function": {
                                                                                                "application": {
                                                                                                  "function": {
                                                                                                    "typeApplication": {
                                                                                                      "body": {"typeApplication": {"body": {"variable": "hydra.core.lib.lists.map"}, "type": {"literal": "string"}}},
                                                                                                      "type": {"optional": {"variable": "hydra.core.packaging.Version"}}}},
                                                                                                  "argument": {
                                                                                                    "application": {
                                                                                                      "function": {
                                                                                                        "lambda": {
                                                                                                          "parameter": "tag",
                                                                                                          "domain": {"literal": "string"},
                                                                                                          "body": {
                                                                                                            "lambda": {
                                                                                                              "parameter": "ln",
                                                                                                              "domain": {"literal": "string"},
                                                                                                              "body": {
                                                                                                                "let": {
                                                                                                                  "bindings": [
                                                                                                                    {
                                                                                                                      "name": "parts",
                                                                                                                      "term": {
                                                                                                                        "application": {
                                                                                                                          "function": {"application": {"function": {"variable": "hydra.core.lib.strings.splitOn"}, "argument": {"literal": {"string": " "}}}},
                                                                                                                          "argument": {"variable": "ln"}}},
                                                                                                                      "typeScheme": {"variables": [], "body": {"list": {"literal": "string"}}, "constraints": []}}],
                                                                                                                  "body": {
                                                                                                                    "application": {
                                                                                                                      "function": {
                                                                                                                        "application": {
                                                                                                                          "function": {
                                                                                                                            "application": {
                                                                                                                              "function": {
                                                                                                                                "typeApplication": {
                                                                                                                                  "body": {"variable": "hydra.core.lib.logic.ifElse"},
                                                                                                                                  "type": {"optional": {"variable": "hydra.core.packaging.Version"}}}},
                                                                                                                              "argument": {
                                                                                                                                "application": {
                                                                                                                                  "function": {
                                                                                                                                    "application": {
                                                                                                                                      "function": {"typeApplication": {"body": {"variable": "hydra.core.lib.equality.equal"}, "type": {"literal": "string"}}},
                                                                                                                                      "argument": {
                                                                                                                                        "application": {
                                                                                                                                          "function": {
                                                                                                                                            "application": {
                                                                                                                                              "function": {"typeApplication": {"body": {"variable": "hydra.core.lib.optionals.withDefault"}, "type": {"literal": "string"}}},
                                                                                                                                              "argument": {"literal": {"string": ""}}}},
                                                                                                                                          "argument": {
                                                                                                                                            "application": {
                                                                                                                                              "function": {"typeApplication": {"body": {"variable": "hydra.core.lib.lists.head"}, "type": {"literal": "string"}}},
                                                                                                                                              "argument": {"variable": "parts"}}}}}}},
                                                                                                                                  "argument": {"variable": "tag"}}}}},
                                                                                                                          "argument": {
                                                                                                                            "optional": {
                                                                                                                              "wrap": {
                                                                                                                                "typeName": "hydra.core.packaging.Version",
                                                                                                                                "body": {
                                                                                                                                  "application": {
                                                                                                                                    "function": {"application": {"function": {"variable": "hydra.core.lib.strings.join"}, "argument": {"literal": {"string": " "}}}},
                                                                                                                                    "argument": {
                                                                                                                                      "application": {
                                                                                                                                        "function": {
                                                                                                                                          "application": {
                                                                                                                                            "function": {"typeApplication": {"body": {"variable": "hydra.core.lib.lists.drop"}, "type": {"literal": "string"}}},
                                                                                                                                            "argument": {"literal": {"integer": {"int32": 1}}}}},
                                                                                                                                        "argument": {"variable": "parts"}}}}}}}}}},
                                                                                                                      "argument": {"typeApplication": {"body": {"optional": null}, "type": {"variable": "hydra.core.packaging.Version"}}}}}}}}}}},
                                                                                                      "argument": {"literal": {"string": "@availableSince"}}}}}},
                                                                                              "argument": {"variable": "keyLines"}}}}},
                                                                                      "typeScheme": {"variables": [], "body": {"list": {"variable": "hydra.core.packaging.Version"}}, "constraints": []}}],
                                                                                  "body": {
                                                                                    "let": {
                                                                                      "bindings": [
                                                                                        {
                                                                                          "name": "depr",
                                                                                          "term": {
                                                                                            "application": {
                                                                                              "function": {
                                                                                                "typeApplication": {"body": {"variable": "hydra.core.lib.optionals.givens"}, "type": {"variable": "hydra.core.packaging.Version"}}},
                                                                                              "argument": {
                                                                                                "application": {
                                                                                                  "function": {
                                                                                                    "application": {
                                                                                                      "function": {
                                                                                                        "typeApplication": {
                                                                                                          "body": {"typeApplication": {"body": {"variable": "hydra.core.lib.lists.map"}, "type": {"literal": "string"}}},
                                                                                                          "type": {"optional": {"variable": "hydra.core.packaging.Version"}}}},
                                                                                                      "argument": {
                                                                                                        "application": {
                                                                                                          "function": {
                                                                                                            "lambda": {
                                                                                                              "parameter": "tag",
                                                                                                              "domain": {"literal": "string"},
                                                                                                              "body": {
                                                                                                                "lambda": {
                                                                                                                  "parameter": "ln",
                                                                                                                  "domain": {"literal": "string"},
                                                                                                                  "body": {
                                                                                                                    "let": {
                                                                                                                      "bindings": [
                                                                                                                        {
                                                                                                                          "name": "parts",
                                                                                                                          "term": {
                                                                                                                            "application": {
                                                                                                                              "function": {"application": {"function": {"variable": "hydra.core.lib.strings.splitOn"}, "argument": {"literal": {"string": " "}}}},
                                                                                                                              "argument": {"variable": "ln"}}},
                                                                                                                          "typeScheme": {"variables": [], "body": {"list": {"literal": "string"}}, "constraints": []}}],
                                                                                                                      "body": {
                                                                                                                        "application": {
                                                                                                                          "function": {
                                                                                                                            "application": {
                                                                                                                              "function": {
                                                                                                                                "application": {
                                                                                                                                  "function": {
                                                                                                                                    "typeApplication": {
                                                                                                                                      "body": {"variable": "hydra.core.lib.logic.ifElse"},
                                                                                                                                      "type": {"optional": {"variable": "hydra.core.packaging.Version"}}}},
                                                                                                                                  "argument": {
                                                                                                                                    "application": {
                                                                                                                                      "function": {
                                                                                                                                        "application": {
                                                                                                                                          "function": {"typeApplication": {"body": {"variable": "hydra.core.lib.equality.equal"}, "type": {"literal": "string"}}},
                                                                                                                                          "argument": {
                                                                                                                                            "application": {
                                                                                                                                              "function": {
                                                                                                                                                "application": {
                                                                                                                                                  "function": {"typeApplication": {"body": {"variable": "hydra.core.lib.optionals.withDefault"}, "type": {"literal": "string"}}},
                                                                                                                                                  "argument": {"literal": {"string": ""}}}},
                                                                                                                                              "argument": {
                                                                                                                                                "application": {
                                                                                                                                                  "function": {"typeApplication": {"body": {"variable": "hydra.core.lib.lists.head"}, "type": {"literal": "string"}}},
                                                                                                                                                  "argument": {"variable": "parts"}}}}}}},
                                                                                                                                      "argument": {"variable": "tag"}}}}},
                                                                                                                              "argument": {
                                                                                                                                "optional": {
                                                                                                                                  "wrap": {
                                                                                                                                    "typeName": "hydra.core.packaging.Version",
                                                                                                                                    "body": {
                                                                                                                                      "application": {
                                                                                                                                        "function": {"application": {"function": {"variable": "hydra.core.lib.strings.join"}, "argument": {"literal": {"string": " "}}}},
                                                                                                                                        "argument": {
                                                                                                                                          "application": {
                                                                                                                                            "function": {
                                                                                                                                              "application": {
                                                                                                                                                "function": {"typeApplication": {"body": {"variable": "hydra.core.lib.lists.drop"}, "type": {"literal": "string"}}},
                                                                                                                                                "argument": {"literal": {"integer": {"int32": 1}}}}},
                                                                                                                                            "argument": {"variable": "parts"}}}}}}}}}},
                                                                                                                          "argument": {"typeApplication": {"body": {"optional": null}, "type": {"variable": "hydra.core.packaging.Version"}}}}}}}}}}},
                                                                                                          "argument": {"literal": {"string": "@deprecatedSince"}}}}}},
                                                                                                  "argument": {"variable": "keyLines"}}}}},
                                                                                          "typeScheme": {"variables": [], "body": {"list": {"variable": "hydra.core.packaging.Version"}}, "constraints": []}}],
                                                                                      "body": {
                                                                                        "let": {
                                                                                          "bindings": [
                                                                                            {
                                                                                              "name": "provisions",
                                                                                              "term": {
                                                                                                "application": {
                                                                                                  "function": {
                                                                                                    "typeApplication": {"body": {"variable": "hydra.core.lib.optionals.givens"}, "type": {"variable": "hydra.core.packaging.Provision"}}},
                                                                                                  "argument": {
                                                                                                    "application": {
                                                                                                      "function": {
                                                                                                        "application": {
                                                                                                          "function": {
                                                                                                            "typeApplication": {
                                                                                                              "body": {"typeApplication": {"body": {"variable": "hydra.core.lib.lists.map"}, "type": {"literal": "string"}}},
                                                                                                              "type": {"optional": {"variable": "hydra.core.packaging.Provision"}}}},
                                                                                                          "argument": {
                                                                                                            "application": {
                                                                                                              "function": {
                                                                                                                "lambda": {
                                                                                                                  "parameter": "modName",
                                                                                                                  "domain": {"variable": "hydra.core.packaging.ModuleName"},
                                                                                                                  "body": {
                                                                                                                    "lambda": {
                                                                                                                      "parameter": "ln",
                                                                                                                      "domain": {"literal": "string"},
                                                                                                                      "body": {
                                                                                                                        "let": {
                                                                                                                          "bindings": [
                                                                                                                            {
                                                                                                                              "name": "tag",
                                                                                                                              "term": {
                                                                                                                                "application": {
                                                                                                                                  "function": {
                                                                                                                                    "application": {
                                                                                                                                      "function": {"typeApplication": {"body": {"variable": "hydra.core.lib.optionals.withDefault"}, "type": {"literal": "string"}}},
                                                                                                                                      "argument": {"literal": {"string": ""}}}},
                                                                                                                                  "argument": {
                                                                                                                                    "application": {
                                                                                                                                      "function": {"typeApplication": {"body": {"variable": "hydra.core.lib.lists.head"}, "type": {"literal": "string"}}},
                                                                                                                                      "argument": {
                                                                                                                                        "application": {
                                                                                                                                          "function": {"application": {"function": {"variable": "hydra.core.lib.strings.splitOn"}, "argument": {"literal": {"string": " "}}}},
                                                                                                                                          "argument": {"variable": "ln"}}}}}}},
                                                                                                                              "typeScheme": {"variables": [], "body": {"literal": "string"}, "constraints": []}}],
                                                                                                                          "body": {
                                                                                                                            "let": {
                                                                                                                              "bindings": [
                                                                                                                                {
                                                                                                                                  "name": "afterTag",
                                                                                                                                  "term": {
                                                                                                                                    "application": {
                                                                                                                                      "function": {"application": {"function": {"variable": "hydra.core.lib.strings.join"}, "argument": {"literal": {"string": " "}}}},
                                                                                                                                      "argument": {
                                                                                                                                        "application": {
                                                                                                                                          "function": {
                                                                                                                                            "application": {
                                                                                                                                              "function": {"typeApplication": {"body": {"variable": "hydra.core.lib.lists.drop"}, "type": {"literal": "string"}}},
                                                                                                                                              "argument": {"literal": {"integer": {"int32": 1}}}}},
                                                                                                                                          "argument": {
                                                                                                                                            "application": {
                                                                                                                                              "function": {"application": {"function": {"variable": "hydra.core.lib.strings.splitOn"}, "argument": {"literal": {"string": " "}}}},
                                                                                                                                              "argument": {"variable": "ln"}}}}}}},
                                                                                                                                  "typeScheme": {"variables": [], "body": {"literal": "string"}, "constraints": []}}],
                                                                                                                              "body": {
                                                                                                                                "let": {
                                                                                                                                  "bindings": [
                                                                                                                                    {
                                                                                                                                      "name": "nameAndStmt",
                                                                                                                                      "term": {
                                                                                                                                        "application": {
                                                                                                                                          "function": {"application": {"function": {"variable": "hydra.core.lib.strings.splitOn"}, "argument": {"literal": {"string": ": "}}}},
                                                                                                                                          "argument": {"variable": "afterTag"}}},
                                                                                                                                      "typeScheme": {"variables": [], "body": {"list": {"literal": "string"}}, "constraints": []}}],
                                                                                                                                  "body": {
                                                                                                                                    "let": {
                                                                                                                                      "bindings": [
                                                                                                                                        {
                                                                                                                                          "name": "localName",
                                                                                                                                          "term": {
                                                                                                                                            "application": {
                                                                                                                                              "function": {
                                                                                                                                                "application": {
                                                                                                                                                  "function": {"typeApplication": {"body": {"variable": "hydra.core.lib.optionals.withDefault"}, "type": {"literal": "string"}}},
                                                                                                                                                  "argument": {"literal": {"string": ""}}}},
                                                                                                                                              "argument": {
                                                                                                                                                "application": {
                                                                                                                                                  "function": {"typeApplication": {"body": {"variable": "hydra.core.lib.lists.head"}, "type": {"literal": "string"}}},
                                                                                                                                                  "argument": {"variable": "nameAndStmt"}}}}},
                                                                                                                                          "typeScheme": {"variables": [], "body": {"literal": "string"}, "constraints": []}}],
                                                                                                                                      "body": {
                                                                                                                                        "let": {
                                                                                                                                          "bindings": [
                                                                                                                                            {
                                                                                                                                              "name": "stmt",
                                                                                                                                              "term": {
                                                                                                                                                "application": {
                                                                                                                                                  "function": {"application": {"function": {"variable": "hydra.core.lib.strings.join"}, "argument": {"literal": {"string": ": "}}}},
                                                                                                                                                  "argument": {
                                                                                                                                                    "application": {
                                                                                                                                                      "function": {
                                                                                                                                                        "application": {
                                                                                                                                                          "function": {"typeApplication": {"body": {"variable": "hydra.core.lib.lists.drop"}, "type": {"literal": "string"}}},
                                                                                                                                                          "argument": {"literal": {"integer": {"int32": 1}}}}},
                                                                                                                                                      "argument": {"variable": "nameAndStmt"}}}}},
                                                                                                                                              "typeScheme": {"variables": [], "body": {"literal": "string"}, "constraints": []}}],
                                                                                                                                          "body": {
                                                                                                                                            "application": {
                                                                                                                                              "function": {
                                                                                                                                                "application": {
                                                                                                                                                  "function": {
                                                                                                                                                    "application": {
                                                                                                                                                      "function": {
                                                                                                                                                        "typeApplication": {
                                                                                                                                                          "body": {"variable": "hydra.core.lib.logic.ifElse"},
                                                                                                                                                          "type": {"optional": {"variable": "hydra.core.packaging.Provision"}}}},
                                                                                                                                                      "argument": {
                                                                                                                                                        "application": {
                                                                                                                                                          "function": {
                                                                                                                                                            "application": {
                                                                                                                                                              "function": {"typeApplication": {"body": {"variable": "hydra.core.lib.equality.equal"}, "type": {"literal": "string"}}},
                                                                                                                                                              "argument": {"variable": "tag"}}},
                                                                                                                                                          "argument": {"literal": {"string": "@requirement"}}}}}},
                                                                                                                                                  "argument": {
                                                                                                                                                    "optional": {
                                                                                                                                                      "record": {
                                                                                                                                                        "typeName": "hydra.core.packaging.Provision",
                                                                                                                                                        "fields": [
                                                                                                                                                          {
                                                                                                                                                            "name": "name",
                                                                                                                                                            "term": {
                                                                                                                                                              "application": {
                                                                                                                                                                "function": {
                                                                                                                                                                  "application": {"function": {"variable": "hydra.core.parse.packaging.qualifyLocalName"}, "argument": {"variable": "modName"}}},
                                                                                                                                                                "argument": {"variable": "localName"}}}},
                                                                                                                                                          {
                                                                                                                                                            "name": "kind",
                                                                                                                                                            "term": {"inject": {"typeName": "hydra.core.packaging.ProvisionKind", "field": {"name": "requirement", "term": "unit"}}}},
                                                                                                                                                          {"name": "statement", "term": {"variable": "stmt"}}]}}}}},
                                                                                                                                              "argument": {
                                                                                                                                                "application": {
                                                                                                                                                  "function": {
                                                                                                                                                    "application": {
                                                                                                                                                      "function": {
                                                                                                                                                        "application": {
                                                                                                                                                          "function": {
                                                                                                                                                            "typeApplication": {
                                                                                                                                                              "body": {"variable": "hydra.core.lib.logic.ifElse"},
                                                                                                                                                              "type": {"optional": {"variable": "hydra.core.packaging.Provision"}}}},
                                                                                                                                                          "argument": {
                                                                                                                                                            "application": {
                                                                                                                                                              "function": {
                                                                                                                                                                "application": {
                                                                                                                                                                  "function": {"typeApplication": {"body": {"variable": "hydra.core.lib.equality.equal"}, "type": {"literal": "string"}}},
                                                                                                                                                                  "argument": {"variable": "tag"}}},
                                                                                                                                                              "argument": {"literal": {"string": "@recommendation"}}}}}},
                                                                                                                                                      "argument": {
                                                                                                                                                        "optional": {
                                                                                                                                                          "record": {
                                                                                                                                                            "typeName": "hydra.core.packaging.Provision",
                                                                                                                                                            "fields": [
                                                                                                                                                              {
                                                                                                                                                                "name": "name",
                                                                                                                                                                "term": {
                                                                                                                                                                  "application": {
                                                                                                                                                                    "function": {
                                                                                                                                                                      "application": {"function": {"variable": "hydra.core.parse.packaging.qualifyLocalName"}, "argument": {"variable": "modName"}}},
                                                                                                                                                                    "argument": {"variable": "localName"}}}},
                                                                                                                                                              {
                                                                                                                                                                "name": "kind",
                                                                                                                                                                "term": {"inject": {"typeName": "hydra.core.packaging.ProvisionKind", "field": {"name": "recommendation", "term": "unit"}}}},
                                                                                                                                                              {"name": "statement", "term": {"variable": "stmt"}}]}}}}},
                                                                                                                                                  "argument": {"typeApplication": {"body": {"optional": null}, "type": {"variable": "hydra.core.packaging.Provision"}}}}}}}}}}}}}}}}}}}}},
                                                                                                              "argument": {"variable": "modName"}}}}},
                                                                                                      "argument": {"variable": "keyLines"}}}}},
                                                                                              "typeScheme": {"variables": [], "body": {"list": {"variable": "hydra.core.packaging.Provision"}}, "constraints": []}}],
                                                                                          "body": {
                                                                                            "let": {
                                                                                              "bindings": [
                                                                                                {
                                                                                                  "name": "mlifecycle",
                                                                                                  "term": {
                                                                                                    "application": {
                                                                                                      "function": {
                                                                                                        "application": {
                                                                                                          "function": {
                                                                                                            "application": {
                                                                                                              "function": {
                                                                                                                "typeApplication": {
                                                                                                                  "body": {"variable": "hydra.core.lib.logic.ifElse"},
                                                                                                                  "type": {"optional": {"variable": "hydra.core.packaging.LifecycleInfo"}}}},
                                                                                                              "argument": {
                                                                                                                "application": {
                                                                                                                  "function": {
                                                                                                                    "application": {
                                                                                                                      "function": {"variable": "hydra.core.lib.logic.and"},
                                                                                                                      "argument": {
                                                                                                                        "application": {
                                                                                                                          "function": {
                                                                                                                            "typeApplication": {"body": {"variable": "hydra.core.lib.lists.isEmpty"}, "type": {"variable": "hydra.core.packaging.Version"}}},
                                                                                                                          "argument": {"variable": "avail"}}}}},
                                                                                                                  "argument": {
                                                                                                                    "application": {
                                                                                                                      "function": {
                                                                                                                        "typeApplication": {"body": {"variable": "hydra.core.lib.lists.isEmpty"}, "type": {"variable": "hydra.core.packaging.Version"}}},
                                                                                                                      "argument": {"variable": "depr"}}}}}}},
                                                                                                          "argument": {"typeApplication": {"body": {"optional": null}, "type": {"variable": "hydra.core.packaging.LifecycleInfo"}}}}},
                                                                                                      "argument": {
                                                                                                        "optional": {
                                                                                                          "record": {
                                                                                                            "typeName": "hydra.core.packaging.LifecycleInfo",
                                                                                                            "fields": [
                                                                                                              {
                                                                                                                "name": "availableSince",
                                                                                                                "term": {
                                                                                                                  "application": {
                                                                                                                    "function": {
                                                                                                                      "typeApplication": {"body": {"variable": "hydra.core.lib.lists.head"}, "type": {"variable": "hydra.core.packaging.Version"}}},
                                                                                                                    "argument": {"variable": "avail"}}}},
                                                                                                              {
                                                                                                                "name": "deprecatedSince",
                                                                                                                "term": {
                                                                                                                  "application": {
                                                                                                                    "function": {
                                                                                                                      "typeApplication": {"body": {"variable": "hydra.core.lib.lists.head"}, "type": {"variable": "hydra.core.packaging.Version"}}},
                                                                                                                    "argument": {"variable": "depr"}}}}]}}}}},
                                                                                                  "typeScheme": {"variables": [], "body": {"optional": {"variable": "hydra.core.packaging.LifecycleInfo"}}, "constraints": []}}],
                                                                                              "body": {
                                                                                                "record": {
                                                                                                  "typeName": "hydra.core.packaging.EntityMetadata",
                                                                                                  "fields": [
                                                                                                    {"name": "description", "term": {"variable": "mdesc"}},
                                                                                                    {"name": "comments", "term": {"variable": "comments"}},
                                                                                                    {"name": "seeAlso", "term": {"variable": "seeAlso"}},
                                                                                                    {"name": "lifecycle", "term": {"variable": "mlifecycle"}},
                                                                                                    {"name": "provisions", "term": {"variable": "provisions"}}]}}}}}}}}}}}}}}}}}}}}}}}}}}}},
                                          "argument": {"variable": "modName"}}},
                                      "argument": {"variable": "lns"}}}}}}}}}}}}}},
            "annotation": {
              "map": [
                {
                  "key": {"variable": "description"},
                  "value": {
                    "literal": {"string": "Parse an optional leading '##' doc-comment block into an EntityMetadata, the inverse of entityMetadataDoc"}}}]}}}}},
    {
      "term": {
        "name": "hydra.core.parse.packaging.dottedIdentifier",
        "signature": {
          "typeParameters": [],
          "parameters": [],
          "result": {"type": {"application": {"function": {"variable": "hydra.core.parsing.Parser"}, "argument": {"literal": "string"}}}}},
        "body": {
          "annotated": {
            "body": {
              "application": {
                "function": {
                  "application": {
                    "function": {
                      "typeApplication": {
                        "body": {"typeApplication": {"body": {"variable": "hydra.core.parsers.map"}, "type": {"list": {"literal": "string"}}}},
                        "type": {"literal": "string"}}},
                    "argument": {
                      "lambda": {
                        "parameter": "segs",
                        "domain": {"list": {"literal": "string"}},
                        "body": {
                          "application": {
                            "function": {"application": {"function": {"variable": "hydra.core.lib.strings.join"}, "argument": {"literal": {"string": "."}}}},
                            "argument": {"variable": "segs"}}}}}}},
                "argument": {
                  "application": {
                    "function": {
                      "application": {
                        "function": {
                          "typeApplication": {
                            "body": {"typeApplication": {"body": {"variable": "hydra.core.parsers.sepBy1"}, "type": {"literal": "string"}}},
                            "type": {"literal": {"integer": "int32"}}}},
                        "argument": {
                          "application": {
                            "function": {
                              "application": {
                                "function": {
                                  "typeApplication": {
                                    "body": {
                                      "typeApplication": {"body": {"variable": "hydra.core.parsers.map"}, "type": {"list": {"literal": {"integer": "int32"}}}}},
                                    "type": {"literal": "string"}}},
                                "argument": {
                                  "lambda": {
                                    "parameter": "xs",
                                    "domain": {"list": {"literal": {"integer": "int32"}}},
                                    "body": {"application": {"function": {"variable": "hydra.core.lib.strings.fromList"}, "argument": {"variable": "xs"}}}}}}},
                            "argument": {
                              "application": {
                                "function": {"typeApplication": {"body": {"variable": "hydra.core.parsers.some"}, "type": {"literal": {"integer": "int32"}}}},
                                "argument": {
                                  "application": {
                                    "function": {"variable": "hydra.core.parsers.satisfy"},
                                    "argument": {
                                      "lambda": {
                                        "parameter": "c",
                                        "domain": {"literal": {"integer": "int32"}},
                                        "body": {"application": {"function": {"variable": "hydra.core.lib.chars.isAlphaNum"}, "argument": {"variable": "c"}}}}}}}}}}}}},
                    "argument": {
                      "application": {"function": {"variable": "hydra.core.parsers.char"}, "argument": {"literal": {"integer": {"int32": 46}}}}}}}}},
            "annotation": {
              "map": [
                {
                  "key": {"variable": "description"},
                  "value": {"literal": {"string": "Parse a dotted name (one or more alphanumeric segments joined by '.') as a String"}}}]}}}}},
    {
      "term": {
        "name": "hydra.core.parse.packaging.expandAliasedName",
        "signature": {
          "typeParameters": [],
          "parameters": [
            {
              "name": "arg0",
              "type": {"map": {"keys": {"literal": "string"}, "values": {"variable": "hydra.core.packaging.ModuleName"}}},
              "isLazy": false},
            {"name": "arg1", "type": {"variable": "hydra.core.model.Name"}, "isLazy": false}],
          "result": {"type": {"variable": "hydra.core.model.Name"}}},
        "body": {
          "annotated": {
            "body": {
              "lambda": {
                "parameter": "aliases",
                "domain": {"map": {"keys": {"literal": "string"}, "values": {"variable": "hydra.core.packaging.ModuleName"}}},
                "body": {
                  "lambda": {
                    "parameter": "n",
                    "domain": {"variable": "hydra.core.model.Name"},
                    "body": {
                      "let": {
                        "bindings": [
                          {
                            "name": "s",
                            "term": {"application": {"function": {"unwrap": "hydra.core.model.Name"}, "argument": {"variable": "n"}}},
                            "typeScheme": {"variables": [], "body": {"literal": "string"}, "constraints": []}}],
                        "body": {
                          "let": {
                            "bindings": [
                              {
                                "name": "segs",
                                "term": {
                                  "application": {
                                    "function": {"application": {"function": {"variable": "hydra.core.lib.strings.splitOn"}, "argument": {"literal": {"string": "."}}}},
                                    "argument": {"variable": "s"}}},
                                "typeScheme": {"variables": [], "body": {"list": {"literal": "string"}}, "constraints": []}}],
                            "body": {
                              "let": {
                                "bindings": [
                                  {
                                    "name": "segCount",
                                    "term": {
                                      "application": {
                                        "function": {"typeApplication": {"body": {"variable": "hydra.core.lib.lists.length"}, "type": {"literal": "string"}}},
                                        "argument": {"variable": "segs"}}},
                                    "typeScheme": {"variables": [], "body": {"literal": {"integer": "int32"}}, "constraints": []}}],
                                "body": {
                                  "let": {
                                    "bindings": [
                                      {
                                        "name": "tryLen",
                                        "term": {
                                          "lambda": {
                                            "parameter": "k",
                                            "domain": {"literal": {"integer": "int32"}},
                                            "body": {
                                              "let": {
                                                "bindings": [
                                                  {
                                                    "name": "prefix",
                                                    "term": {
                                                      "application": {
                                                        "function": {"application": {"function": {"variable": "hydra.core.lib.strings.join"}, "argument": {"literal": {"string": "."}}}},
                                                        "argument": {
                                                          "application": {
                                                            "function": {
                                                              "application": {
                                                                "function": {"typeApplication": {"body": {"variable": "hydra.core.lib.lists.take"}, "type": {"literal": "string"}}},
                                                                "argument": {"variable": "k"}}},
                                                            "argument": {"variable": "segs"}}}}},
                                                    "typeScheme": {"variables": [], "body": {"literal": "string"}, "constraints": []}}],
                                                "body": {
                                                  "application": {
                                                    "function": {
                                                      "application": {
                                                        "function": {
                                                          "typeApplication": {
                                                            "body": {
                                                              "typeApplication": {"body": {"variable": "hydra.core.lib.optionals.map"}, "type": {"variable": "hydra.core.packaging.ModuleName"}}},
                                                            "type": {"variable": "hydra.core.model.Name"}}},
                                                        "argument": {
                                                          "lambda": {
                                                            "parameter": "modName",
                                                            "domain": {"variable": "hydra.core.packaging.ModuleName"},
                                                            "body": {
                                                              "wrap": {
                                                                "typeName": "hydra.core.model.Name",
                                                                "body": {
                                                                  "application": {
                                                                    "function": {"application": {"function": {"variable": "hydra.core.lib.strings.join"}, "argument": {"literal": {"string": "."}}}},
                                                                    "argument": {
                                                                      "application": {
                                                                        "function": {
                                                                          "application": {
                                                                            "function": {"typeApplication": {"body": {"variable": "hydra.core.lib.lists.cons"}, "type": {"literal": "string"}}},
                                                                            "argument": {"application": {"function": {"unwrap": "hydra.core.packaging.ModuleName"}, "argument": {"variable": "modName"}}}}},
                                                                        "argument": {
                                                                          "application": {
                                                                            "function": {
                                                                              "application": {
                                                                                "function": {"typeApplication": {"body": {"variable": "hydra.core.lib.lists.drop"}, "type": {"literal": "string"}}},
                                                                                "argument": {"variable": "k"}}},
                                                                            "argument": {"variable": "segs"}}}}}}}}}}}}},
                                                    "argument": {
                                                      "application": {
                                                        "function": {
                                                          "application": {
                                                            "function": {
                                                              "typeApplication": {
                                                                "body": {"typeApplication": {"body": {"variable": "hydra.core.lib.maps.lookup"}, "type": {"literal": "string"}}},
                                                                "type": {"variable": "hydra.core.packaging.ModuleName"}}},
                                                            "argument": {"variable": "prefix"}}},
                                                        "argument": {"variable": "aliases"}}}}}}}}},
                                        "typeScheme": {
                                          "variables": [],
                                          "body": {
                                            "function": {"domain": {"literal": {"integer": "int32"}}, "codomain": {"optional": {"variable": "hydra.core.model.Name"}}}},
                                          "constraints": []}}],
                                    "body": {
                                      "let": {
                                        "bindings": [
                                          {
                                            "name": "prefixLens",
                                            "term": {
                                              "application": {
                                                "function": {
                                                  "application": {
                                                    "function": {
                                                      "application": {
                                                        "function": {
                                                          "typeApplication": {
                                                            "body": {
                                                              "typeApplication": {"body": {"variable": "hydra.core.lib.lists.foldl"}, "type": {"list": {"literal": {"integer": "int32"}}}}},
                                                            "type": {"literal": "string"}}},
                                                        "argument": {
                                                          "lambda": {
                                                            "parameter": "acc",
                                                            "domain": {"list": {"literal": {"integer": "int32"}}},
                                                            "body": {
                                                              "lambda": {
                                                                "parameter": "_seg",
                                                                "domain": {"literal": "string"},
                                                                "body": {
                                                                  "application": {
                                                                    "function": {
                                                                      "application": {
                                                                        "function": {"typeApplication": {"body": {"variable": "hydra.core.lib.lists.concat2"}, "type": {"literal": {"integer": "int32"}}}},
                                                                        "argument": {"variable": "acc"}}},
                                                                    "argument": {
                                                                      "list": [
                                                                        {
                                                                          "application": {
                                                                            "function": {
                                                                              "application": {
                                                                                "function": {"typeApplication": {"body": {"variable": "hydra.core.lib.math.add"}, "type": {"literal": {"integer": "int32"}}}},
                                                                                "argument": {
                                                                                  "application": {
                                                                                    "function": {"typeApplication": {"body": {"variable": "hydra.core.lib.lists.length"}, "type": {"literal": {"integer": "int32"}}}},
                                                                                    "argument": {"variable": "acc"}}}}},
                                                                            "argument": {"literal": {"integer": {"int32": 1}}}}}]}}}}}}}}},
                                                    "argument": {"typeApplication": {"body": {"list": []}, "type": {"literal": {"integer": "int32"}}}}}},
                                                "argument": {
                                                  "application": {
                                                    "function": {
                                                      "application": {
                                                        "function": {
                                                          "typeApplication": {"body": {"variable": "hydra.core.lib.optionals.withDefault"}, "type": {"list": {"literal": "string"}}}},
                                                        "argument": {"typeApplication": {"body": {"list": []}, "type": {"literal": "string"}}}}},
                                                    "argument": {
                                                      "application": {
                                                        "function": {"typeApplication": {"body": {"variable": "hydra.core.lib.lists.init"}, "type": {"literal": "string"}}},
                                                        "argument": {"variable": "segs"}}}}}}},
                                            "typeScheme": {"variables": [], "body": {"list": {"literal": {"integer": "int32"}}}, "constraints": []}}],
                                        "body": {
                                          "let": {
                                            "bindings": [
                                              {
                                                "name": "matches",
                                                "term": {
                                                  "application": {
                                                    "function": {
                                                      "application": {
                                                        "function": {
                                                          "typeApplication": {
                                                            "body": {
                                                              "typeApplication": {"body": {"variable": "hydra.core.lib.optionals.mapOptional"}, "type": {"literal": {"integer": "int32"}}}},
                                                            "type": {"variable": "hydra.core.model.Name"}}},
                                                        "argument": {"variable": "tryLen"}}},
                                                    "argument": {"variable": "prefixLens"}}},
                                                "typeScheme": {"variables": [], "body": {"list": {"variable": "hydra.core.model.Name"}}, "constraints": []}}],
                                            "body": {
                                              "application": {
                                                "function": {
                                                  "application": {
                                                    "function": {
                                                      "typeApplication": {"body": {"variable": "hydra.core.lib.optionals.withDefault"}, "type": {"variable": "hydra.core.model.Name"}}},
                                                    "argument": {"variable": "n"}}},
                                                "argument": {
                                                  "application": {
                                                    "function": {"typeApplication": {"body": {"variable": "hydra.core.lib.lists.last"}, "type": {"variable": "hydra.core.model.Name"}}},
                                                    "argument": {"variable": "matches"}}}}}}}}}}}}}}}}}}}}},
            "annotation": {
              "map": [
                {
                  "key": {"variable": "description"},
                  "value": {
                    "literal": {"string": "Expand a name's aliased leading prefix (longest match) to its full module name, per the given alias table"}}}]}}}}},
    {
      "term": {
        "name": "hydra.core.parse.packaging.expandAliasesInDefinition",
        "signature": {
          "typeParameters": [],
          "parameters": [
            {"name": "arg0", "type": {"variable": "hydra.core.packaging.ModuleName"}, "isLazy": false},
            {"name": "arg1", "type": {"set": {"literal": "string"}}, "isLazy": false},
            {
              "name": "arg2",
              "type": {"map": {"keys": {"literal": "string"}, "values": {"variable": "hydra.core.packaging.ModuleName"}}},
              "isLazy": false},
            {"name": "arg3", "type": {"variable": "hydra.core.packaging.Definition"}, "isLazy": false}],
          "result": {"type": {"variable": "hydra.core.packaging.Definition"}}},
        "body": {
          "annotated": {
            "body": {
              "lambda": {
                "parameter": "modName",
                "domain": {"variable": "hydra.core.packaging.ModuleName"},
                "body": {
                  "lambda": {
                    "parameter": "ownNames",
                    "domain": {"set": {"literal": "string"}},
                    "body": {
                      "lambda": {
                        "parameter": "aliases",
                        "domain": {"map": {"keys": {"literal": "string"}, "values": {"variable": "hydra.core.packaging.ModuleName"}}},
                        "body": {
                          "lambda": {
                            "parameter": "def",
                            "domain": {"variable": "hydra.core.packaging.Definition"},
                            "body": {
                              "let": {
                                "bindings": [
                                  {
                                    "name": "expandScheme",
                                    "term": {
                                      "lambda": {
                                        "parameter": "ts",
                                        "domain": {"variable": "hydra.core.model.TypeScheme"},
                                        "body": {
                                          "let": {
                                            "bindings": [
                                              {
                                                "name": "vars",
                                                "term": {
                                                  "application": {
                                                    "function": {"project": {"typeName": "hydra.core.model.TypeScheme", "fieldName": "variables"}},
                                                    "argument": {"variable": "ts"}}},
                                                "typeScheme": {"variables": [], "body": {"list": {"variable": "hydra.core.model.Name"}}, "constraints": []}}],
                                            "body": {
                                              "let": {
                                                "bindings": [
                                                  {
                                                    "name": "boundNames",
                                                    "term": {
                                                      "application": {
                                                        "function": {"typeApplication": {"body": {"variable": "hydra.core.lib.sets.fromList"}, "type": {"literal": "string"}}},
                                                        "argument": {
                                                          "application": {
                                                            "function": {
                                                              "application": {
                                                                "function": {
                                                                  "typeApplication": {
                                                                    "body": {"typeApplication": {"body": {"variable": "hydra.core.lib.lists.map"}, "type": {"variable": "hydra.core.model.Name"}}},
                                                                    "type": {"literal": "string"}}},
                                                                "argument": {
                                                                  "lambda": {
                                                                    "parameter": "v",
                                                                    "domain": {"variable": "hydra.core.model.Name"},
                                                                    "body": {"application": {"function": {"unwrap": "hydra.core.model.Name"}, "argument": {"variable": "v"}}}}}}},
                                                            "argument": {"variable": "vars"}}}}},
                                                    "typeScheme": {"variables": [], "body": {"set": {"literal": "string"}}, "constraints": []}}],
                                                "body": {
                                                  "record": {
                                                    "typeName": "hydra.core.model.TypeScheme",
                                                    "fields": [
                                                      {"name": "variables", "term": {"variable": "vars"}},
                                                      {
                                                        "name": "body",
                                                        "term": {
                                                          "application": {
                                                            "function": {
                                                              "application": {
                                                                "function": {
                                                                  "application": {
                                                                    "function": {
                                                                      "application": {
                                                                        "function": {
                                                                          "application": {
                                                                            "function": {"variable": "hydra.core.parse.packaging.expandAliasesInTypeSelfAware"},
                                                                            "argument": {"variable": "modName"}}},
                                                                        "argument": {"variable": "ownNames"}}},
                                                                    "argument": {"variable": "boundNames"}}},
                                                                "argument": {"variable": "aliases"}}},
                                                            "argument": {
                                                              "application": {
                                                                "function": {"project": {"typeName": "hydra.core.model.TypeScheme", "fieldName": "body"}},
                                                                "argument": {"variable": "ts"}}}}}},
                                                      {
                                                        "name": "constraints",
                                                        "term": {
                                                          "application": {
                                                            "function": {"project": {"typeName": "hydra.core.model.TypeScheme", "fieldName": "constraints"}},
                                                            "argument": {"variable": "ts"}}}}]}}}}}}}},
                                    "typeScheme": {
                                      "variables": [],
                                      "body": {
                                        "function": {"domain": {"variable": "hydra.core.model.TypeScheme"}, "codomain": {"variable": "hydra.core.model.TypeScheme"}}},
                                      "constraints": []}}],
                                "body": {
                                  "application": {
                                    "function": {
                                      "cases": {
                                        "typeName": "hydra.core.packaging.Definition",
                                        "cases": [
                                          {
                                            "name": "type",
                                            "handler": {
                                              "lambda": {
                                                "parameter": "td",
                                                "domain": {"variable": "hydra.core.packaging.TypeDefinition"},
                                                "body": {
                                                  "inject": {
                                                    "typeName": "hydra.core.packaging.Definition",
                                                    "field": {
                                                      "name": "type",
                                                      "term": {
                                                        "record": {
                                                          "typeName": "hydra.core.packaging.TypeDefinition",
                                                          "fields": [
                                                            {
                                                              "name": "name",
                                                              "term": {
                                                                "application": {
                                                                  "function": {"project": {"typeName": "hydra.core.packaging.TypeDefinition", "fieldName": "name"}},
                                                                  "argument": {"variable": "td"}}}},
                                                            {
                                                              "name": "metadata",
                                                              "term": {
                                                                "application": {
                                                                  "function": {"project": {"typeName": "hydra.core.packaging.TypeDefinition", "fieldName": "metadata"}},
                                                                  "argument": {"variable": "td"}}}},
                                                            {
                                                              "name": "body",
                                                              "term": {
                                                                "application": {
                                                                  "function": {"variable": "expandScheme"},
                                                                  "argument": {
                                                                    "application": {
                                                                      "function": {"project": {"typeName": "hydra.core.packaging.TypeDefinition", "fieldName": "body"}},
                                                                      "argument": {"variable": "td"}}}}}}]}}}}}}}},
                                          {
                                            "name": "term",
                                            "handler": {
                                              "lambda": {
                                                "parameter": "td",
                                                "domain": {"variable": "hydra.core.packaging.TermDefinition"},
                                                "body": {
                                                  "inject": {
                                                    "typeName": "hydra.core.packaging.Definition",
                                                    "field": {
                                                      "name": "term",
                                                      "term": {
                                                        "record": {
                                                          "typeName": "hydra.core.packaging.TermDefinition",
                                                          "fields": [
                                                            {
                                                              "name": "name",
                                                              "term": {
                                                                "application": {
                                                                  "function": {"project": {"typeName": "hydra.core.packaging.TermDefinition", "fieldName": "name"}},
                                                                  "argument": {"variable": "td"}}}},
                                                            {
                                                              "name": "metadata",
                                                              "term": {
                                                                "application": {
                                                                  "function": {"project": {"typeName": "hydra.core.packaging.TermDefinition", "fieldName": "metadata"}},
                                                                  "argument": {"variable": "td"}}}},
                                                            {
                                                              "name": "signature",
                                                              "term": {
                                                                "application": {
                                                                  "function": {
                                                                    "application": {
                                                                      "function": {
                                                                        "typeApplication": {
                                                                          "body": {
                                                                            "typeApplication": {"body": {"variable": "hydra.core.lib.optionals.map"}, "type": {"variable": "hydra.core.typing.TermSignature"}}},
                                                                          "type": {"variable": "hydra.core.typing.TermSignature"}}},
                                                                      "argument": {
                                                                        "application": {
                                                                          "function": {"variable": "hydra.core.parse.packaging.expandAliasesInTermSignature"},
                                                                          "argument": {"variable": "aliases"}}}}},
                                                                  "argument": {
                                                                    "application": {
                                                                      "function": {"project": {"typeName": "hydra.core.packaging.TermDefinition", "fieldName": "signature"}},
                                                                      "argument": {"variable": "td"}}}}}},
                                                            {
                                                              "name": "body",
                                                              "term": {
                                                                "application": {
                                                                  "function": {
                                                                    "application": {"function": {"variable": "hydra.core.parse.packaging.expandAliasesInTerm"}, "argument": {"variable": "aliases"}}},
                                                                  "argument": {
                                                                    "application": {
                                                                      "function": {"project": {"typeName": "hydra.core.packaging.TermDefinition", "fieldName": "body"}},
                                                                      "argument": {"variable": "td"}}}}}}]}}}}}}}},
                                          {
                                            "name": "primitive",
                                            "handler": {
                                              "lambda": {
                                                "parameter": "pd",
                                                "domain": {"variable": "hydra.core.packaging.PrimitiveDefinition"},
                                                "body": {
                                                  "inject": {
                                                    "typeName": "hydra.core.packaging.Definition",
                                                    "field": {
                                                      "name": "primitive",
                                                      "term": {
                                                        "record": {
                                                          "typeName": "hydra.core.packaging.PrimitiveDefinition",
                                                          "fields": [
                                                            {
                                                              "name": "name",
                                                              "term": {
                                                                "application": {
                                                                  "function": {"project": {"typeName": "hydra.core.packaging.PrimitiveDefinition", "fieldName": "name"}},
                                                                  "argument": {"variable": "pd"}}}},
                                                            {
                                                              "name": "metadata",
                                                              "term": {
                                                                "application": {
                                                                  "function": {"project": {"typeName": "hydra.core.packaging.PrimitiveDefinition", "fieldName": "metadata"}},
                                                                  "argument": {"variable": "pd"}}}},
                                                            {
                                                              "name": "signature",
                                                              "term": {
                                                                "application": {
                                                                  "function": {
                                                                    "application": {
                                                                      "function": {"variable": "hydra.core.parse.packaging.expandAliasesInTermSignature"},
                                                                      "argument": {"variable": "aliases"}}},
                                                                  "argument": {
                                                                    "application": {
                                                                      "function": {"project": {"typeName": "hydra.core.packaging.PrimitiveDefinition", "fieldName": "signature"}},
                                                                      "argument": {"variable": "pd"}}}}}},
                                                            {
                                                              "name": "isPure",
                                                              "term": {
                                                                "application": {
                                                                  "function": {"project": {"typeName": "hydra.core.packaging.PrimitiveDefinition", "fieldName": "isPure"}},
                                                                  "argument": {"variable": "pd"}}}},
                                                            {
                                                              "name": "isTotal",
                                                              "term": {
                                                                "application": {
                                                                  "function": {"project": {"typeName": "hydra.core.packaging.PrimitiveDefinition", "fieldName": "isTotal"}},
                                                                  "argument": {"variable": "pd"}}}},
                                                            {
                                                              "name": "defaultImplementation",
                                                              "term": {
                                                                "application": {
                                                                  "function": {
                                                                    "application": {
                                                                      "function": {
                                                                        "typeApplication": {
                                                                          "body": {
                                                                            "typeApplication": {"body": {"variable": "hydra.core.lib.optionals.map"}, "type": {"variable": "hydra.core.model.Term"}}},
                                                                          "type": {"variable": "hydra.core.model.Term"}}},
                                                                      "argument": {
                                                                        "application": {"function": {"variable": "hydra.core.parse.packaging.expandAliasesInTerm"}, "argument": {"variable": "aliases"}}}}},
                                                                  "argument": {
                                                                    "application": {
                                                                      "function": {"project": {"typeName": "hydra.core.packaging.PrimitiveDefinition", "fieldName": "defaultImplementation"}},
                                                                      "argument": {"variable": "pd"}}}}}}]}}}}}}}}]}},
                                    "argument": {"variable": "def"}}}}}}}}}}}}},
            "annotation": {
              "map": [
                {
                  "key": {"variable": "description"},
                  "value": {"literal": {"string": "Expand every aliased name reference inside a definition's body/signature"}}}]}}}}},
    {
      "term": {
        "name": "hydra.core.parse.packaging.expandAliasesInTerm",
        "signature": {
          "typeParameters": [],
          "parameters": [
            {
              "name": "arg0",
              "type": {"map": {"keys": {"literal": "string"}, "values": {"variable": "hydra.core.packaging.ModuleName"}}},
              "isLazy": false},
            {"name": "arg1", "type": {"variable": "hydra.core.model.Term"}, "isLazy": false}],
          "result": {"type": {"variable": "hydra.core.model.Term"}}},
        "body": {
          "annotated": {
            "body": {
              "lambda": {
                "parameter": "aliases",
                "domain": {"map": {"keys": {"literal": "string"}, "values": {"variable": "hydra.core.packaging.ModuleName"}}},
                "body": {
                  "lambda": {
                    "parameter": "t0",
                    "domain": {"variable": "hydra.core.model.Term"},
                    "body": {
                      "let": {
                        "bindings": [
                          {
                            "name": "expand",
                            "term": {
                              "application": {"function": {"variable": "hydra.core.parse.packaging.expandAliasedName"}, "argument": {"variable": "aliases"}}},
                            "typeScheme": {
                              "variables": [],
                              "body": {"function": {"domain": {"variable": "hydra.core.model.Name"}, "codomain": {"variable": "hydra.core.model.Name"}}},
                              "constraints": []}}],
                        "body": {
                          "let": {
                            "bindings": [
                              {
                                "name": "rewrite",
                                "term": {
                                  "lambda": {
                                    "parameter": "recurse",
                                    "domain": {"function": {"domain": {"variable": "hydra.core.model.Term"}, "codomain": {"variable": "hydra.core.model.Term"}}},
                                    "body": {
                                      "lambda": {
                                        "parameter": "term",
                                        "domain": {"variable": "hydra.core.model.Term"},
                                        "body": {
                                          "application": {
                                            "function": {
                                              "cases": {
                                                "typeName": "hydra.core.model.Term",
                                                "default": {"application": {"function": {"variable": "recurse"}, "argument": {"variable": "term"}}},
                                                "cases": [
                                                  {
                                                    "name": "variable",
                                                    "handler": {
                                                      "lambda": {
                                                        "parameter": "n",
                                                        "domain": {"variable": "hydra.core.model.Name"},
                                                        "body": {
                                                          "inject": {
                                                            "typeName": "hydra.core.model.Term",
                                                            "field": {"name": "variable", "term": {"application": {"function": {"variable": "expand"}, "argument": {"variable": "n"}}}}}}}}},
                                                  {
                                                    "name": "project",
                                                    "handler": {
                                                      "lambda": {
                                                        "parameter": "p",
                                                        "domain": {"variable": "hydra.core.model.Projection"},
                                                        "body": {
                                                          "inject": {
                                                            "typeName": "hydra.core.model.Term",
                                                            "field": {
                                                              "name": "project",
                                                              "term": {
                                                                "record": {
                                                                  "typeName": "hydra.core.model.Projection",
                                                                  "fields": [
                                                                    {
                                                                      "name": "typeName",
                                                                      "term": {
                                                                        "application": {
                                                                          "function": {"variable": "expand"},
                                                                          "argument": {
                                                                            "application": {
                                                                              "function": {"project": {"typeName": "hydra.core.model.Projection", "fieldName": "typeName"}},
                                                                              "argument": {"variable": "p"}}}}}},
                                                                    {
                                                                      "name": "fieldName",
                                                                      "term": {
                                                                        "application": {
                                                                          "function": {"variable": "expand"},
                                                                          "argument": {
                                                                            "application": {
                                                                              "function": {"project": {"typeName": "hydra.core.model.Projection", "fieldName": "fieldName"}},
                                                                              "argument": {"variable": "p"}}}}}}]}}}}}}}},
                                                  {
                                                    "name": "record",
                                                    "handler": {
                                                      "lambda": {
                                                        "parameter": "r",
                                                        "domain": {"variable": "hydra.core.model.Record"},
                                                        "body": {
                                                          "application": {
                                                            "function": {"variable": "recurse"},
                                                            "argument": {
                                                              "inject": {
                                                                "typeName": "hydra.core.model.Term",
                                                                "field": {
                                                                  "name": "record",
                                                                  "term": {
                                                                    "record": {
                                                                      "typeName": "hydra.core.model.Record",
                                                                      "fields": [
                                                                        {
                                                                          "name": "typeName",
                                                                          "term": {
                                                                            "application": {
                                                                              "function": {"variable": "expand"},
                                                                              "argument": {
                                                                                "application": {
                                                                                  "function": {"project": {"typeName": "hydra.core.model.Record", "fieldName": "typeName"}},
                                                                                  "argument": {"variable": "r"}}}}}},
                                                                        {
                                                                          "name": "fields",
                                                                          "term": {
                                                                            "application": {"function": {"project": {"typeName": "hydra.core.model.Record", "fieldName": "fields"}}, "argument": {"variable": "r"}}}}]}}}}}}}}}},
                                                  {
                                                    "name": "unwrap",
                                                    "handler": {
                                                      "lambda": {
                                                        "parameter": "n",
                                                        "domain": {"variable": "hydra.core.model.Name"},
                                                        "body": {
                                                          "inject": {
                                                            "typeName": "hydra.core.model.Term",
                                                            "field": {"name": "unwrap", "term": {"application": {"function": {"variable": "expand"}, "argument": {"variable": "n"}}}}}}}}},
                                                  {
                                                    "name": "wrap",
                                                    "handler": {
                                                      "lambda": {
                                                        "parameter": "w",
                                                        "domain": {"variable": "hydra.core.model.WrappedTerm"},
                                                        "body": {
                                                          "application": {
                                                            "function": {"variable": "recurse"},
                                                            "argument": {
                                                              "inject": {
                                                                "typeName": "hydra.core.model.Term",
                                                                "field": {
                                                                  "name": "wrap",
                                                                  "term": {
                                                                    "record": {
                                                                      "typeName": "hydra.core.model.WrappedTerm",
                                                                      "fields": [
                                                                        {
                                                                          "name": "typeName",
                                                                          "term": {
                                                                            "application": {
                                                                              "function": {"variable": "expand"},
                                                                              "argument": {
                                                                                "application": {
                                                                                  "function": {"project": {"typeName": "hydra.core.model.WrappedTerm", "fieldName": "typeName"}},
                                                                                  "argument": {"variable": "w"}}}}}},
                                                                        {
                                                                          "name": "body",
                                                                          "term": {
                                                                            "application": {
                                                                              "function": {"project": {"typeName": "hydra.core.model.WrappedTerm", "fieldName": "body"}},
                                                                              "argument": {"variable": "w"}}}}]}}}}}}}}}},
                                                  {
                                                    "name": "cases",
                                                    "handler": {
                                                      "lambda": {
                                                        "parameter": "cs",
                                                        "domain": {"variable": "hydra.core.model.CaseStatement"},
                                                        "body": {
                                                          "application": {
                                                            "function": {"variable": "recurse"},
                                                            "argument": {
                                                              "inject": {
                                                                "typeName": "hydra.core.model.Term",
                                                                "field": {
                                                                  "name": "cases",
                                                                  "term": {
                                                                    "record": {
                                                                      "typeName": "hydra.core.model.CaseStatement",
                                                                      "fields": [
                                                                        {
                                                                          "name": "typeName",
                                                                          "term": {
                                                                            "application": {
                                                                              "function": {"variable": "expand"},
                                                                              "argument": {
                                                                                "application": {
                                                                                  "function": {"project": {"typeName": "hydra.core.model.CaseStatement", "fieldName": "typeName"}},
                                                                                  "argument": {"variable": "cs"}}}}}},
                                                                        {
                                                                          "name": "default",
                                                                          "term": {
                                                                            "application": {
                                                                              "function": {"project": {"typeName": "hydra.core.model.CaseStatement", "fieldName": "default"}},
                                                                              "argument": {"variable": "cs"}}}},
                                                                        {
                                                                          "name": "cases",
                                                                          "term": {
                                                                            "application": {
                                                                              "function": {"project": {"typeName": "hydra.core.model.CaseStatement", "fieldName": "cases"}},
                                                                              "argument": {"variable": "cs"}}}}]}}}}}}}}}},
                                                  {
                                                    "name": "inject",
                                                    "handler": {
                                                      "lambda": {
                                                        "parameter": "inj",
                                                        "domain": {"variable": "hydra.core.model.Injection"},
                                                        "body": {
                                                          "application": {
                                                            "function": {"variable": "recurse"},
                                                            "argument": {
                                                              "inject": {
                                                                "typeName": "hydra.core.model.Term",
                                                                "field": {
                                                                  "name": "inject",
                                                                  "term": {
                                                                    "record": {
                                                                      "typeName": "hydra.core.model.Injection",
                                                                      "fields": [
                                                                        {
                                                                          "name": "typeName",
                                                                          "term": {
                                                                            "application": {
                                                                              "function": {"variable": "expand"},
                                                                              "argument": {
                                                                                "application": {
                                                                                  "function": {"project": {"typeName": "hydra.core.model.Injection", "fieldName": "typeName"}},
                                                                                  "argument": {"variable": "inj"}}}}}},
                                                                        {
                                                                          "name": "field",
                                                                          "term": {
                                                                            "application": {
                                                                              "function": {"project": {"typeName": "hydra.core.model.Injection", "fieldName": "field"}},
                                                                              "argument": {"variable": "inj"}}}}]}}}}}}}}}}]}},
                                            "argument": {"variable": "term"}}}}}}},
                                "typeScheme": {
                                  "variables": [],
                                  "body": {
                                    "function": {
                                      "domain": {"function": {"domain": {"variable": "hydra.core.model.Term"}, "codomain": {"variable": "hydra.core.model.Term"}}},
                                      "codomain": {"function": {"domain": {"variable": "hydra.core.model.Term"}, "codomain": {"variable": "hydra.core.model.Term"}}}}},
                                  "constraints": []}}],
                            "body": {
                              "application": {
                                "function": {"application": {"function": {"variable": "hydra.core.rewriting.rewriteTerm"}, "argument": {"variable": "rewrite"}}},
                                "argument": {"variable": "t0"}}}}}}}}}}},
            "annotation": {
              "map": [
                {
                  "key": {"variable": "description"},
                  "value": {"literal": {"string": "Expand every aliased name reference inside a term, per the given alias table"}}}]}}}}},
    {
      "term": {
        "name": "hydra.core.parse.packaging.expandAliasesInTermSignature",
        "signature": {
          "typeParameters": [],
          "parameters": [
            {
              "name": "arg0",
              "type": {"map": {"keys": {"literal": "string"}, "values": {"variable": "hydra.core.packaging.ModuleName"}}},
              "isLazy": false},
            {"name": "arg1", "type": {"variable": "hydra.core.typing.TermSignature"}, "isLazy": false}],
          "result": {"type": {"variable": "hydra.core.typing.TermSignature"}}},
        "body": {
          "annotated": {
            "body": {
              "lambda": {
                "parameter": "aliases",
                "domain": {"map": {"keys": {"literal": "string"}, "values": {"variable": "hydra.core.packaging.ModuleName"}}},
                "body": {
                  "lambda": {
                    "parameter": "sig",
                    "domain": {"variable": "hydra.core.typing.TermSignature"},
                    "body": {
                      "let": {
                        "bindings": [
                          {
                            "name": "expand",
                            "term": {
                              "application": {"function": {"variable": "hydra.core.parse.packaging.expandAliasesInType"}, "argument": {"variable": "aliases"}}},
                            "typeScheme": {
                              "variables": [],
                              "body": {"function": {"domain": {"variable": "hydra.core.model.Type"}, "codomain": {"variable": "hydra.core.model.Type"}}},
                              "constraints": []}}],
                        "body": {
                          "record": {
                            "typeName": "hydra.core.typing.TermSignature",
                            "fields": [
                              {
                                "name": "typeParameters",
                                "term": {
                                  "application": {
                                    "function": {"project": {"typeName": "hydra.core.typing.TermSignature", "fieldName": "typeParameters"}},
                                    "argument": {"variable": "sig"}}}},
                              {
                                "name": "parameters",
                                "term": {
                                  "application": {
                                    "function": {
                                      "application": {
                                        "function": {
                                          "typeApplication": {
                                            "body": {
                                              "typeApplication": {"body": {"variable": "hydra.core.lib.lists.map"}, "type": {"variable": "hydra.core.typing.Parameter"}}},
                                            "type": {"variable": "hydra.core.typing.Parameter"}}},
                                        "argument": {
                                          "lambda": {
                                            "parameter": "p",
                                            "domain": {"variable": "hydra.core.typing.Parameter"},
                                            "body": {
                                              "record": {
                                                "typeName": "hydra.core.typing.Parameter",
                                                "fields": [
                                                  {
                                                    "name": "name",
                                                    "term": {
                                                      "application": {
                                                        "function": {"project": {"typeName": "hydra.core.typing.Parameter", "fieldName": "name"}},
                                                        "argument": {"variable": "p"}}}},
                                                  {
                                                    "name": "description",
                                                    "term": {
                                                      "application": {
                                                        "function": {"project": {"typeName": "hydra.core.typing.Parameter", "fieldName": "description"}},
                                                        "argument": {"variable": "p"}}}},
                                                  {
                                                    "name": "type",
                                                    "term": {
                                                      "application": {
                                                        "function": {"variable": "expand"},
                                                        "argument": {
                                                          "application": {
                                                            "function": {"project": {"typeName": "hydra.core.typing.Parameter", "fieldName": "type"}},
                                                            "argument": {"variable": "p"}}}}}},
                                                  {
                                                    "name": "isLazy",
                                                    "term": {
                                                      "application": {
                                                        "function": {"project": {"typeName": "hydra.core.typing.Parameter", "fieldName": "isLazy"}},
                                                        "argument": {"variable": "p"}}}}]}}}}}},
                                    "argument": {
                                      "application": {
                                        "function": {"project": {"typeName": "hydra.core.typing.TermSignature", "fieldName": "parameters"}},
                                        "argument": {"variable": "sig"}}}}}},
                              {
                                "name": "result",
                                "term": {
                                  "let": {
                                    "bindings": [
                                      {
                                        "name": "r",
                                        "term": {
                                          "application": {
                                            "function": {"project": {"typeName": "hydra.core.typing.TermSignature", "fieldName": "result"}},
                                            "argument": {"variable": "sig"}}},
                                        "typeScheme": {"variables": [], "body": {"variable": "hydra.core.typing.Result"}, "constraints": []}}],
                                    "body": {
                                      "record": {
                                        "typeName": "hydra.core.typing.Result",
                                        "fields": [
                                          {
                                            "name": "description",
                                            "term": {
                                              "application": {
                                                "function": {"project": {"typeName": "hydra.core.typing.Result", "fieldName": "description"}},
                                                "argument": {"variable": "r"}}}},
                                          {
                                            "name": "type",
                                            "term": {
                                              "application": {
                                                "function": {"variable": "expand"},
                                                "argument": {
                                                  "application": {"function": {"project": {"typeName": "hydra.core.typing.Result", "fieldName": "type"}}, "argument": {"variable": "r"}}}}}}]}}}}}]}}}}}}}},
            "annotation": {
              "map": [
                {
                  "key": {"variable": "description"},
                  "value": {"literal": {"string": "Expand every aliased name reference inside a term signature's parameter and result types"}}}]}}}}},
    {
      "term": {
        "name": "hydra.core.parse.packaging.expandAliasesInType",
        "signature": {
          "typeParameters": [],
          "parameters": [
            {
              "name": "arg0",
              "type": {"map": {"keys": {"literal": "string"}, "values": {"variable": "hydra.core.packaging.ModuleName"}}},
              "isLazy": false},
            {"name": "arg1", "type": {"variable": "hydra.core.model.Type"}, "isLazy": false}],
          "result": {"type": {"variable": "hydra.core.model.Type"}}},
        "body": {
          "annotated": {
            "body": {
              "lambda": {
                "parameter": "aliases",
                "domain": {"map": {"keys": {"literal": "string"}, "values": {"variable": "hydra.core.packaging.ModuleName"}}},
                "body": {
                  "lambda": {
                    "parameter": "typ0",
                    "domain": {"variable": "hydra.core.model.Type"},
                    "body": {
                      "let": {
                        "bindings": [
                          {
                            "name": "rewrite",
                            "term": {
                              "lambda": {
                                "parameter": "recurse",
                                "domain": {"function": {"domain": {"variable": "hydra.core.model.Type"}, "codomain": {"variable": "hydra.core.model.Type"}}},
                                "body": {
                                  "lambda": {
                                    "parameter": "typ",
                                    "domain": {"variable": "hydra.core.model.Type"},
                                    "body": {
                                      "application": {
                                        "function": {
                                          "cases": {
                                            "typeName": "hydra.core.model.Type",
                                            "default": {"application": {"function": {"variable": "recurse"}, "argument": {"variable": "typ"}}},
                                            "cases": [
                                              {
                                                "name": "variable",
                                                "handler": {
                                                  "lambda": {
                                                    "parameter": "n",
                                                    "domain": {"variable": "hydra.core.model.Name"},
                                                    "body": {
                                                      "inject": {
                                                        "typeName": "hydra.core.model.Type",
                                                        "field": {
                                                          "name": "variable",
                                                          "term": {
                                                            "application": {
                                                              "function": {
                                                                "application": {"function": {"variable": "hydra.core.parse.packaging.expandAliasedName"}, "argument": {"variable": "aliases"}}},
                                                              "argument": {"variable": "n"}}}}}}}}}]}},
                                        "argument": {"variable": "typ"}}}}}}},
                            "typeScheme": {
                              "variables": [],
                              "body": {
                                "function": {
                                  "domain": {"function": {"domain": {"variable": "hydra.core.model.Type"}, "codomain": {"variable": "hydra.core.model.Type"}}},
                                  "codomain": {"function": {"domain": {"variable": "hydra.core.model.Type"}, "codomain": {"variable": "hydra.core.model.Type"}}}}},
                              "constraints": []}}],
                        "body": {
                          "application": {
                            "function": {"application": {"function": {"variable": "hydra.core.rewriting.rewriteType"}, "argument": {"variable": "rewrite"}}},
                            "argument": {"variable": "typ0"}}}}}}}}},
            "annotation": {
              "map": [
                {
                  "key": {"variable": "description"},
                  "value": {"literal": {"string": "Expand every aliased name reference inside a type, per the given alias table"}}}]}}}}},
    {
      "term": {
        "name": "hydra.core.parse.packaging.expandAliasesInTypeSelfAware",
        "signature": {
          "typeParameters": [],
          "parameters": [
            {"name": "arg0", "type": {"variable": "hydra.core.packaging.ModuleName"}, "isLazy": false},
            {"name": "arg1", "type": {"set": {"literal": "string"}}, "isLazy": false},
            {"name": "arg2", "type": {"set": {"literal": "string"}}, "isLazy": false},
            {
              "name": "arg3",
              "type": {"map": {"keys": {"literal": "string"}, "values": {"variable": "hydra.core.packaging.ModuleName"}}},
              "isLazy": false},
            {"name": "arg4", "type": {"variable": "hydra.core.model.Type"}, "isLazy": false}],
          "result": {"type": {"variable": "hydra.core.model.Type"}}},
        "body": {
          "annotated": {
            "body": {
              "lambda": {
                "parameter": "modName",
                "domain": {"variable": "hydra.core.packaging.ModuleName"},
                "body": {
                  "lambda": {
                    "parameter": "ownNames",
                    "domain": {"set": {"literal": "string"}},
                    "body": {
                      "lambda": {
                        "parameter": "bound0",
                        "domain": {"set": {"literal": "string"}},
                        "body": {
                          "lambda": {
                            "parameter": "aliases",
                            "domain": {"map": {"keys": {"literal": "string"}, "values": {"variable": "hydra.core.packaging.ModuleName"}}},
                            "body": {
                              "lambda": {
                                "parameter": "typ0",
                                "domain": {"variable": "hydra.core.model.Type"},
                                "body": {
                                  "application": {
                                    "function": {
                                      "application": {
                                        "function": {
                                          "application": {
                                            "function": {
                                              "application": {
                                                "function": {
                                                  "application": {
                                                    "function": {"variable": "hydra.core.parse.packaging.expandAliasesInTypeSelfAwareGo"},
                                                    "argument": {"variable": "modName"}}},
                                                "argument": {"variable": "aliases"}}},
                                            "argument": {"variable": "ownNames"}}},
                                        "argument": {"variable": "bound0"}}},
                                    "argument": {"variable": "typ0"}}}}}}}}}}}}},
            "annotation": {
              "map": [
                {
                  "key": {"variable": "description"},
                  "value": {
                    "literal": {
                      "string": "Expand aliased AND bare self-referencing names inside a type, tracking bound type variables and the module's own declared names"}}}]}}}}},
    {
      "term": {
        "name": "hydra.core.parse.packaging.expandAliasesInTypeSelfAwareGo",
        "signature": {
          "typeParameters": [],
          "parameters": [
            {"name": "arg0", "type": {"variable": "hydra.core.packaging.ModuleName"}, "isLazy": false},
            {
              "name": "arg1",
              "type": {"map": {"keys": {"literal": "string"}, "values": {"variable": "hydra.core.packaging.ModuleName"}}},
              "isLazy": false},
            {"name": "arg2", "type": {"set": {"literal": "string"}}, "isLazy": false},
            {"name": "arg3", "type": {"set": {"literal": "string"}}, "isLazy": false},
            {"name": "arg4", "type": {"variable": "hydra.core.model.Type"}, "isLazy": false}],
          "result": {"type": {"variable": "hydra.core.model.Type"}}},
        "body": {
          "annotated": {
            "body": {
              "lambda": {
                "parameter": "modName",
                "domain": {"variable": "hydra.core.packaging.ModuleName"},
                "body": {
                  "lambda": {
                    "parameter": "aliases",
                    "domain": {"map": {"keys": {"literal": "string"}, "values": {"variable": "hydra.core.packaging.ModuleName"}}},
                    "body": {
                      "lambda": {
                        "parameter": "ownNames",
                        "domain": {"set": {"literal": "string"}},
                        "body": {
                          "lambda": {
                            "parameter": "bound",
                            "domain": {"set": {"literal": "string"}},
                            "body": {
                              "lambda": {
                                "parameter": "typ",
                                "domain": {"variable": "hydra.core.model.Type"},
                                "body": {
                                  "let": {
                                    "bindings": [
                                      {
                                        "name": "recurse",
                                        "term": {
                                          "application": {
                                            "function": {
                                              "application": {
                                                "function": {
                                                  "application": {
                                                    "function": {
                                                      "application": {
                                                        "function": {"variable": "hydra.core.parse.packaging.expandAliasesInTypeSelfAwareGo"},
                                                        "argument": {"variable": "modName"}}},
                                                    "argument": {"variable": "aliases"}}},
                                                "argument": {"variable": "ownNames"}}},
                                            "argument": {"variable": "bound"}}},
                                        "typeScheme": {
                                          "variables": [],
                                          "body": {"function": {"domain": {"variable": "hydra.core.model.Type"}, "codomain": {"variable": "hydra.core.model.Type"}}},
                                          "constraints": []}}],
                                    "body": {
                                      "let": {
                                        "bindings": [
                                          {
                                            "name": "forField",
                                            "term": {
                                              "lambda": {
                                                "parameter": "field",
                                                "domain": {"variable": "hydra.core.model.FieldType"},
                                                "body": {
                                                  "record": {
                                                    "typeName": "hydra.core.model.FieldType",
                                                    "fields": [
                                                      {
                                                        "name": "name",
                                                        "term": {
                                                          "application": {
                                                            "function": {"project": {"typeName": "hydra.core.model.FieldType", "fieldName": "name"}},
                                                            "argument": {"variable": "field"}}}},
                                                      {
                                                        "name": "type",
                                                        "term": {
                                                          "application": {
                                                            "function": {"variable": "recurse"},
                                                            "argument": {
                                                              "application": {
                                                                "function": {"project": {"typeName": "hydra.core.model.FieldType", "fieldName": "type"}},
                                                                "argument": {"variable": "field"}}}}}}]}}}},
                                            "typeScheme": {
                                              "variables": [],
                                              "body": {
                                                "function": {"domain": {"variable": "hydra.core.model.FieldType"}, "codomain": {"variable": "hydra.core.model.FieldType"}}},
                                              "constraints": []}}],
                                        "body": {
                                          "application": {
                                            "function": {
                                              "cases": {
                                                "typeName": "hydra.core.model.Type",
                                                "cases": [
                                                  {
                                                    "name": "annotated",
                                                    "handler": {
                                                      "lambda": {
                                                        "parameter": "at",
                                                        "domain": {"variable": "hydra.core.model.AnnotatedType"},
                                                        "body": {
                                                          "inject": {
                                                            "typeName": "hydra.core.model.Type",
                                                            "field": {
                                                              "name": "annotated",
                                                              "term": {
                                                                "record": {
                                                                  "typeName": "hydra.core.model.AnnotatedType",
                                                                  "fields": [
                                                                    {
                                                                      "name": "body",
                                                                      "term": {
                                                                        "application": {
                                                                          "function": {"variable": "recurse"},
                                                                          "argument": {
                                                                            "application": {
                                                                              "function": {"project": {"typeName": "hydra.core.model.AnnotatedType", "fieldName": "body"}},
                                                                              "argument": {"variable": "at"}}}}}},
                                                                    {
                                                                      "name": "annotation",
                                                                      "term": {
                                                                        "application": {
                                                                          "function": {"project": {"typeName": "hydra.core.model.AnnotatedType", "fieldName": "annotation"}},
                                                                          "argument": {"variable": "at"}}}}]}}}}}}}},
                                                  {
                                                    "name": "application",
                                                    "handler": {
                                                      "lambda": {
                                                        "parameter": "app",
                                                        "domain": {"variable": "hydra.core.model.ApplicationType"},
                                                        "body": {
                                                          "inject": {
                                                            "typeName": "hydra.core.model.Type",
                                                            "field": {
                                                              "name": "application",
                                                              "term": {
                                                                "record": {
                                                                  "typeName": "hydra.core.model.ApplicationType",
                                                                  "fields": [
                                                                    {
                                                                      "name": "function",
                                                                      "term": {
                                                                        "application": {
                                                                          "function": {"variable": "recurse"},
                                                                          "argument": {
                                                                            "application": {
                                                                              "function": {"project": {"typeName": "hydra.core.model.ApplicationType", "fieldName": "function"}},
                                                                              "argument": {"variable": "app"}}}}}},
                                                                    {
                                                                      "name": "argument",
                                                                      "term": {
                                                                        "application": {
                                                                          "function": {"variable": "recurse"},
                                                                          "argument": {
                                                                            "application": {
                                                                              "function": {"project": {"typeName": "hydra.core.model.ApplicationType", "fieldName": "argument"}},
                                                                              "argument": {"variable": "app"}}}}}}]}}}}}}}},
                                                  {
                                                    "name": "effect",
                                                    "handler": {
                                                      "lambda": {
                                                        "parameter": "t",
                                                        "domain": {"variable": "hydra.core.model.Type"},
                                                        "body": {
                                                          "inject": {
                                                            "typeName": "hydra.core.model.Type",
                                                            "field": {"name": "effect", "term": {"application": {"function": {"variable": "recurse"}, "argument": {"variable": "t"}}}}}}}}},
                                                  {
                                                    "name": "either",
                                                    "handler": {
                                                      "lambda": {
                                                        "parameter": "et",
                                                        "domain": {"variable": "hydra.core.model.EitherType"},
                                                        "body": {
                                                          "inject": {
                                                            "typeName": "hydra.core.model.Type",
                                                            "field": {
                                                              "name": "either",
                                                              "term": {
                                                                "record": {
                                                                  "typeName": "hydra.core.model.EitherType",
                                                                  "fields": [
                                                                    {
                                                                      "name": "left",
                                                                      "term": {
                                                                        "application": {
                                                                          "function": {"variable": "recurse"},
                                                                          "argument": {
                                                                            "application": {
                                                                              "function": {"project": {"typeName": "hydra.core.model.EitherType", "fieldName": "left"}},
                                                                              "argument": {"variable": "et"}}}}}},
                                                                    {
                                                                      "name": "right",
                                                                      "term": {
                                                                        "application": {
                                                                          "function": {"variable": "recurse"},
                                                                          "argument": {
                                                                            "application": {
                                                                              "function": {"project": {"typeName": "hydra.core.model.EitherType", "fieldName": "right"}},
                                                                              "argument": {"variable": "et"}}}}}}]}}}}}}}},
                                                  {
                                                    "name": "forall",
                                                    "handler": {
                                                      "lambda": {
                                                        "parameter": "ft",
                                                        "domain": {"variable": "hydra.core.model.ForallType"},
                                                        "body": {
                                                          "let": {
                                                            "bindings": [
                                                              {
                                                                "name": "param",
                                                                "term": {
                                                                  "application": {
                                                                    "function": {"project": {"typeName": "hydra.core.model.ForallType", "fieldName": "parameter"}},
                                                                    "argument": {"variable": "ft"}}},
                                                                "typeScheme": {"variables": [], "body": {"variable": "hydra.core.model.Name"}, "constraints": []}}],
                                                            "body": {
                                                              "let": {
                                                                "bindings": [
                                                                  {
                                                                    "name": "bound'",
                                                                    "term": {
                                                                      "application": {
                                                                        "function": {
                                                                          "application": {
                                                                            "function": {"typeApplication": {"body": {"variable": "hydra.core.lib.sets.insert"}, "type": {"literal": "string"}}},
                                                                            "argument": {"application": {"function": {"unwrap": "hydra.core.model.Name"}, "argument": {"variable": "param"}}}}},
                                                                        "argument": {"variable": "bound"}}},
                                                                    "typeScheme": {"variables": [], "body": {"set": {"literal": "string"}}, "constraints": []}}],
                                                                "body": {
                                                                  "inject": {
                                                                    "typeName": "hydra.core.model.Type",
                                                                    "field": {
                                                                      "name": "forall",
                                                                      "term": {
                                                                        "record": {
                                                                          "typeName": "hydra.core.model.ForallType",
                                                                          "fields": [
                                                                            {"name": "parameter", "term": {"variable": "param"}},
                                                                            {
                                                                              "name": "body",
                                                                              "term": {
                                                                                "application": {
                                                                                  "function": {
                                                                                    "application": {
                                                                                      "function": {
                                                                                        "application": {
                                                                                          "function": {
                                                                                            "application": {
                                                                                              "function": {
                                                                                                "application": {
                                                                                                  "function": {"variable": "hydra.core.parse.packaging.expandAliasesInTypeSelfAwareGo"},
                                                                                                  "argument": {"variable": "modName"}}},
                                                                                              "argument": {"variable": "aliases"}}},
                                                                                          "argument": {"variable": "ownNames"}}},
                                                                                      "argument": {"variable": "bound'"}}},
                                                                                  "argument": {
                                                                                    "application": {
                                                                                      "function": {"project": {"typeName": "hydra.core.model.ForallType", "fieldName": "body"}},
                                                                                      "argument": {"variable": "ft"}}}}}}]}}}}}}}}}}}},
                                                  {
                                                    "name": "function",
                                                    "handler": {
                                                      "lambda": {
                                                        "parameter": "fun",
                                                        "domain": {"variable": "hydra.core.model.FunctionType"},
                                                        "body": {
                                                          "inject": {
                                                            "typeName": "hydra.core.model.Type",
                                                            "field": {
                                                              "name": "function",
                                                              "term": {
                                                                "record": {
                                                                  "typeName": "hydra.core.model.FunctionType",
                                                                  "fields": [
                                                                    {
                                                                      "name": "domain",
                                                                      "term": {
                                                                        "application": {
                                                                          "function": {"variable": "recurse"},
                                                                          "argument": {
                                                                            "application": {
                                                                              "function": {"project": {"typeName": "hydra.core.model.FunctionType", "fieldName": "domain"}},
                                                                              "argument": {"variable": "fun"}}}}}},
                                                                    {
                                                                      "name": "codomain",
                                                                      "term": {
                                                                        "application": {
                                                                          "function": {"variable": "recurse"},
                                                                          "argument": {
                                                                            "application": {
                                                                              "function": {"project": {"typeName": "hydra.core.model.FunctionType", "fieldName": "codomain"}},
                                                                              "argument": {"variable": "fun"}}}}}}]}}}}}}}},
                                                  {
                                                    "name": "list",
                                                    "handler": {
                                                      "lambda": {
                                                        "parameter": "t",
                                                        "domain": {"variable": "hydra.core.model.Type"},
                                                        "body": {
                                                          "inject": {
                                                            "typeName": "hydra.core.model.Type",
                                                            "field": {"name": "list", "term": {"application": {"function": {"variable": "recurse"}, "argument": {"variable": "t"}}}}}}}}},
                                                  {
                                                    "name": "literal",
                                                    "handler": {
                                                      "lambda": {
                                                        "parameter": "lt",
                                                        "domain": {"variable": "hydra.core.model.LiteralType"},
                                                        "body": {"inject": {"typeName": "hydra.core.model.Type", "field": {"name": "literal", "term": {"variable": "lt"}}}}}}},
                                                  {
                                                    "name": "map",
                                                    "handler": {
                                                      "lambda": {
                                                        "parameter": "mt",
                                                        "domain": {"variable": "hydra.core.model.MapType"},
                                                        "body": {
                                                          "inject": {
                                                            "typeName": "hydra.core.model.Type",
                                                            "field": {
                                                              "name": "map",
                                                              "term": {
                                                                "record": {
                                                                  "typeName": "hydra.core.model.MapType",
                                                                  "fields": [
                                                                    {
                                                                      "name": "keys",
                                                                      "term": {
                                                                        "application": {
                                                                          "function": {"variable": "recurse"},
                                                                          "argument": {
                                                                            "application": {"function": {"project": {"typeName": "hydra.core.model.MapType", "fieldName": "keys"}}, "argument": {"variable": "mt"}}}}}},
                                                                    {
                                                                      "name": "values",
                                                                      "term": {
                                                                        "application": {
                                                                          "function": {"variable": "recurse"},
                                                                          "argument": {
                                                                            "application": {
                                                                              "function": {"project": {"typeName": "hydra.core.model.MapType", "fieldName": "values"}},
                                                                              "argument": {"variable": "mt"}}}}}}]}}}}}}}},
                                                  {
                                                    "name": "optional",
                                                    "handler": {
                                                      "lambda": {
                                                        "parameter": "t",
                                                        "domain": {"variable": "hydra.core.model.Type"},
                                                        "body": {
                                                          "inject": {
                                                            "typeName": "hydra.core.model.Type",
                                                            "field": {"name": "optional", "term": {"application": {"function": {"variable": "recurse"}, "argument": {"variable": "t"}}}}}}}}},
                                                  {
                                                    "name": "pair",
                                                    "handler": {
                                                      "lambda": {
                                                        "parameter": "pt",
                                                        "domain": {"variable": "hydra.core.model.PairType"},
                                                        "body": {
                                                          "inject": {
                                                            "typeName": "hydra.core.model.Type",
                                                            "field": {
                                                              "name": "pair",
                                                              "term": {
                                                                "record": {
                                                                  "typeName": "hydra.core.model.PairType",
                                                                  "fields": [
                                                                    {
                                                                      "name": "first",
                                                                      "term": {
                                                                        "application": {
                                                                          "function": {"variable": "recurse"},
                                                                          "argument": {
                                                                            "application": {
                                                                              "function": {"project": {"typeName": "hydra.core.model.PairType", "fieldName": "first"}},
                                                                              "argument": {"variable": "pt"}}}}}},
                                                                    {
                                                                      "name": "second",
                                                                      "term": {
                                                                        "application": {
                                                                          "function": {"variable": "recurse"},
                                                                          "argument": {
                                                                            "application": {
                                                                              "function": {"project": {"typeName": "hydra.core.model.PairType", "fieldName": "second"}},
                                                                              "argument": {"variable": "pt"}}}}}}]}}}}}}}},
                                                  {
                                                    "name": "record",
                                                    "handler": {
                                                      "lambda": {
                                                        "parameter": "rt",
                                                        "domain": {"list": {"variable": "hydra.core.model.FieldType"}},
                                                        "body": {
                                                          "inject": {
                                                            "typeName": "hydra.core.model.Type",
                                                            "field": {
                                                              "name": "record",
                                                              "term": {
                                                                "application": {
                                                                  "function": {
                                                                    "application": {
                                                                      "function": {
                                                                        "typeApplication": {
                                                                          "body": {
                                                                            "typeApplication": {"body": {"variable": "hydra.core.lib.lists.map"}, "type": {"variable": "hydra.core.model.FieldType"}}},
                                                                          "type": {"variable": "hydra.core.model.FieldType"}}},
                                                                      "argument": {"variable": "forField"}}},
                                                                  "argument": {"variable": "rt"}}}}}}}}},
                                                  {
                                                    "name": "set",
                                                    "handler": {
                                                      "lambda": {
                                                        "parameter": "t",
                                                        "domain": {"variable": "hydra.core.model.Type"},
                                                        "body": {
                                                          "inject": {
                                                            "typeName": "hydra.core.model.Type",
                                                            "field": {"name": "set", "term": {"application": {"function": {"variable": "recurse"}, "argument": {"variable": "t"}}}}}}}}},
                                                  {
                                                    "name": "union",
                                                    "handler": {
                                                      "lambda": {
                                                        "parameter": "rt",
                                                        "domain": {"list": {"variable": "hydra.core.model.FieldType"}},
                                                        "body": {
                                                          "inject": {
                                                            "typeName": "hydra.core.model.Type",
                                                            "field": {
                                                              "name": "union",
                                                              "term": {
                                                                "application": {
                                                                  "function": {
                                                                    "application": {
                                                                      "function": {
                                                                        "typeApplication": {
                                                                          "body": {
                                                                            "typeApplication": {"body": {"variable": "hydra.core.lib.lists.map"}, "type": {"variable": "hydra.core.model.FieldType"}}},
                                                                          "type": {"variable": "hydra.core.model.FieldType"}}},
                                                                      "argument": {"variable": "forField"}}},
                                                                  "argument": {"variable": "rt"}}}}}}}}},
                                                  {
                                                    "name": "unit",
                                                    "handler": {
                                                      "lambda": {
                                                        "parameter": "_",
                                                        "domain": "unit",
                                                        "body": {"inject": {"typeName": "hydra.core.model.Type", "field": {"name": "unit", "term": "unit"}}}}}},
                                                  {
                                                    "name": "variable",
                                                    "handler": {
                                                      "lambda": {
                                                        "parameter": "n",
                                                        "domain": {"variable": "hydra.core.model.Name"},
                                                        "body": {
                                                          "inject": {
                                                            "typeName": "hydra.core.model.Type",
                                                            "field": {
                                                              "name": "variable",
                                                              "term": {
                                                                "application": {
                                                                  "function": {
                                                                    "application": {
                                                                      "function": {
                                                                        "application": {
                                                                          "function": {
                                                                            "application": {
                                                                              "function": {
                                                                                "application": {"function": {"variable": "hydra.core.parse.packaging.expandTypeNameRefSelfAware"}, "argument": {"variable": "modName"}}},
                                                                              "argument": {"variable": "aliases"}}},
                                                                          "argument": {"variable": "ownNames"}}},
                                                                      "argument": {"variable": "bound"}}},
                                                                  "argument": {"variable": "n"}}}}}}}}},
                                                  {
                                                    "name": "void",
                                                    "handler": {
                                                      "lambda": {
                                                        "parameter": "_",
                                                        "domain": "unit",
                                                        "body": {"inject": {"typeName": "hydra.core.model.Type", "field": {"name": "void", "term": "unit"}}}}}},
                                                  {
                                                    "name": "wrap",
                                                    "handler": {
                                                      "lambda": {
                                                        "parameter": "wt",
                                                        "domain": {"variable": "hydra.core.model.Type"},
                                                        "body": {
                                                          "inject": {
                                                            "typeName": "hydra.core.model.Type",
                                                            "field": {"name": "wrap", "term": {"application": {"function": {"variable": "recurse"}, "argument": {"variable": "wt"}}}}}}}}}]}},
                                            "argument": {"variable": "typ"}}}}}}}}}}}}}}}}},
            "annotation": {
              "map": [
                {
                  "key": {"variable": "description"},
                  "value": {
                    "literal": {"string": "Recursively expand aliased and bare self-referencing names inside a type, tracking bound type variables"}}}]}}}}},
    {
      "term": {
        "name": "hydra.core.parse.packaging.expandTypeNameRefSelfAware",
        "signature": {
          "typeParameters": [],
          "parameters": [
            {"name": "arg0", "type": {"variable": "hydra.core.packaging.ModuleName"}, "isLazy": false},
            {
              "name": "arg1",
              "type": {"map": {"keys": {"literal": "string"}, "values": {"variable": "hydra.core.packaging.ModuleName"}}},
              "isLazy": false},
            {"name": "arg2", "type": {"set": {"literal": "string"}}, "isLazy": false},
            {"name": "arg3", "type": {"set": {"literal": "string"}}, "isLazy": false},
            {"name": "arg4", "type": {"variable": "hydra.core.model.Name"}, "isLazy": false}],
          "result": {"type": {"variable": "hydra.core.model.Name"}}},
        "body": {
          "annotated": {
            "body": {
              "lambda": {
                "parameter": "modName",
                "domain": {"variable": "hydra.core.packaging.ModuleName"},
                "body": {
                  "lambda": {
                    "parameter": "aliases",
                    "domain": {"map": {"keys": {"literal": "string"}, "values": {"variable": "hydra.core.packaging.ModuleName"}}},
                    "body": {
                      "lambda": {
                        "parameter": "ownNames",
                        "domain": {"set": {"literal": "string"}},
                        "body": {
                          "lambda": {
                            "parameter": "bound",
                            "domain": {"set": {"literal": "string"}},
                            "body": {
                              "lambda": {
                                "parameter": "n",
                                "domain": {"variable": "hydra.core.model.Name"},
                                "body": {
                                  "let": {
                                    "bindings": [
                                      {
                                        "name": "s",
                                        "term": {"application": {"function": {"unwrap": "hydra.core.model.Name"}, "argument": {"variable": "n"}}},
                                        "typeScheme": {"variables": [], "body": {"literal": "string"}, "constraints": []}}],
                                    "body": {
                                      "application": {
                                        "function": {
                                          "application": {
                                            "function": {
                                              "application": {
                                                "function": {
                                                  "typeApplication": {"body": {"variable": "hydra.core.lib.logic.ifElse"}, "type": {"variable": "hydra.core.model.Name"}}},
                                                "argument": {
                                                  "application": {
                                                    "function": {
                                                      "application": {
                                                        "function": {"typeApplication": {"body": {"variable": "hydra.core.lib.sets.member"}, "type": {"literal": "string"}}},
                                                        "argument": {"variable": "s"}}},
                                                    "argument": {"variable": "bound"}}}}},
                                            "argument": {"variable": "n"}}},
                                        "argument": {
                                          "let": {
                                            "bindings": [
                                              {
                                                "name": "expanded",
                                                "term": {
                                                  "application": {
                                                    "function": {
                                                      "application": {"function": {"variable": "hydra.core.parse.packaging.expandAliasedName"}, "argument": {"variable": "aliases"}}},
                                                    "argument": {"variable": "n"}}},
                                                "typeScheme": {"variables": [], "body": {"variable": "hydra.core.model.Name"}, "constraints": []}}],
                                            "body": {
                                              "application": {
                                                "function": {
                                                  "application": {
                                                    "function": {
                                                      "application": {
                                                        "function": {
                                                          "typeApplication": {"body": {"variable": "hydra.core.lib.logic.ifElse"}, "type": {"variable": "hydra.core.model.Name"}}},
                                                        "argument": {
                                                          "application": {
                                                            "function": {
                                                              "application": {
                                                                "function": {
                                                                  "typeApplication": {"body": {"variable": "hydra.core.lib.equality.equal"}, "type": {"variable": "hydra.core.model.Name"}}},
                                                                "argument": {"variable": "expanded"}}},
                                                            "argument": {"variable": "n"}}}}},
                                                    "argument": {
                                                      "application": {
                                                        "function": {
                                                          "application": {
                                                            "function": {
                                                              "application": {
                                                                "function": {
                                                                  "typeApplication": {"body": {"variable": "hydra.core.lib.logic.ifElse"}, "type": {"variable": "hydra.core.model.Name"}}},
                                                                "argument": {
                                                                  "application": {
                                                                    "function": {
                                                                      "application": {
                                                                        "function": {"variable": "hydra.core.lib.logic.and"},
                                                                        "argument": {
                                                                          "application": {
                                                                            "function": {
                                                                              "application": {
                                                                                "function": {"typeApplication": {"body": {"variable": "hydra.core.lib.equality.equal"}, "type": {"literal": {"integer": "int32"}}}},
                                                                                "argument": {
                                                                                  "application": {
                                                                                    "function": {"typeApplication": {"body": {"variable": "hydra.core.lib.lists.length"}, "type": {"literal": "string"}}},
                                                                                    "argument": {
                                                                                      "application": {
                                                                                        "function": {"application": {"function": {"variable": "hydra.core.lib.strings.splitOn"}, "argument": {"literal": {"string": "."}}}},
                                                                                        "argument": {"variable": "s"}}}}}}},
                                                                            "argument": {"literal": {"integer": {"int32": 1}}}}}}},
                                                                    "argument": {
                                                                      "application": {
                                                                        "function": {
                                                                          "application": {
                                                                            "function": {"typeApplication": {"body": {"variable": "hydra.core.lib.sets.member"}, "type": {"literal": "string"}}},
                                                                            "argument": {"variable": "s"}}},
                                                                        "argument": {"variable": "ownNames"}}}}}}},
                                                            "argument": {
                                                              "application": {
                                                                "function": {
                                                                  "application": {"function": {"variable": "hydra.core.parse.packaging.qualifyLocalName"}, "argument": {"variable": "modName"}}},
                                                                "argument": {"variable": "s"}}}}},
                                                        "argument": {"variable": "n"}}}}},
                                                "argument": {"variable": "expanded"}}}}}}}}}}}}}}}}}}},
            "annotation": {
              "map": [
                {
                  "key": {"variable": "description"},
                  "value": {
                    "literal": {
                      "string": "Expand a single type-level name reference, treating a bare unbound name as a self-reference only when it is one of the module's own declared names"}}}]}}}}},
    {
      "term": {
        "name": "hydra.core.parse.packaging.identifier",
        "signature": {
          "typeParameters": [],
          "parameters": [],
          "result": {"type": {"application": {"function": {"variable": "hydra.core.parsing.Parser"}, "argument": {"literal": "string"}}}}},
        "body": {
          "annotated": {
            "body": {
              "application": {
                "function": {"typeApplication": {"body": {"variable": "hydra.core.parse.packaging.token"}, "type": {"literal": "string"}}},
                "argument": {
                  "application": {
                    "function": {
                      "application": {
                        "function": {
                          "typeApplication": {
                            "body": {
                              "typeApplication": {"body": {"variable": "hydra.core.parsers.map"}, "type": {"list": {"literal": {"integer": "int32"}}}}},
                            "type": {"literal": "string"}}},
                        "argument": {
                          "lambda": {
                            "parameter": "xs",
                            "domain": {"list": {"literal": {"integer": "int32"}}},
                            "body": {"application": {"function": {"variable": "hydra.core.lib.strings.fromList"}, "argument": {"variable": "xs"}}}}}}},
                    "argument": {
                      "application": {
                        "function": {"typeApplication": {"body": {"variable": "hydra.core.parsers.some"}, "type": {"literal": {"integer": "int32"}}}},
                        "argument": {
                          "application": {
                            "function": {"variable": "hydra.core.parsers.satisfy"},
                            "argument": {
                              "lambda": {
                                "parameter": "c",
                                "domain": {"literal": {"integer": "int32"}},
                                "body": {"application": {"function": {"variable": "hydra.core.lib.chars.isAlphaNum"}, "argument": {"variable": "c"}}}}}}}}}}}}},
            "annotation": {
              "map": [
                {
                  "key": {"variable": "description"},
                  "value": {"literal": {"string": "Parse a bare dotted name (TODO: backtick-escaped form per syntax.md 2.4)"}}}]}}}}},
    {
      "term": {
        "name": "hydra.core.parse.packaging.importDecl",
        "signature": {
          "typeParameters": [],
          "parameters": [],
          "result": {
            "type": {
              "application": {
                "function": {"variable": "hydra.core.parsing.Parser"},
                "argument": {
                  "pair": {"first": {"variable": "hydra.core.packaging.ModuleDependency"}, "second": {"optional": {"literal": "string"}}}}}}}},
        "body": {
          "annotated": {
            "body": {
              "application": {
                "function": {
                  "application": {
                    "function": {
                      "typeApplication": {
                        "body": {"typeApplication": {"body": {"variable": "hydra.core.parsers.bind"}, "type": {"literal": "string"}}},
                        "type": {
                          "pair": {"first": {"variable": "hydra.core.packaging.ModuleDependency"}, "second": {"optional": {"literal": "string"}}}}}},
                    "argument": {
                      "application": {"function": {"variable": "hydra.core.parse.packaging.keyword"}, "argument": {"literal": {"string": "import"}}}}}},
                "argument": {
                  "lambda": {
                    "parameter": "_",
                    "domain": {"literal": "string"},
                    "body": {
                      "application": {
                        "function": {
                          "application": {
                            "function": {
                              "typeApplication": {
                                "body": {
                                  "typeApplication": {"body": {"variable": "hydra.core.parsers.bind"}, "type": {"variable": "hydra.core.packaging.ModuleName"}}},
                                "type": {
                                  "pair": {"first": {"variable": "hydra.core.packaging.ModuleDependency"}, "second": {"optional": {"literal": "string"}}}}}},
                            "argument": {
                              "application": {
                                "function": {
                                  "typeApplication": {"body": {"variable": "hydra.core.parse.packaging.token"}, "type": {"variable": "hydra.core.packaging.ModuleName"}}},
                                "argument": {"variable": "hydra.core.parse.packaging.moduleName"}}}}},
                        "argument": {
                          "lambda": {
                            "parameter": "modName",
                            "domain": {"variable": "hydra.core.packaging.ModuleName"},
                            "body": {
                              "application": {
                                "function": {
                                  "application": {
                                    "function": {
                                      "typeApplication": {
                                        "body": {"typeApplication": {"body": {"variable": "hydra.core.parsers.bind"}, "type": {"optional": {"literal": "string"}}}},
                                        "type": {
                                          "pair": {"first": {"variable": "hydra.core.packaging.ModuleDependency"}, "second": {"optional": {"literal": "string"}}}}}},
                                    "argument": {
                                      "application": {
                                        "function": {"typeApplication": {"body": {"variable": "hydra.core.parsers.optional"}, "type": {"literal": "string"}}},
                                        "argument": {
                                          "application": {
                                            "function": {
                                              "application": {
                                                "function": {
                                                  "typeApplication": {
                                                    "body": {"typeApplication": {"body": {"variable": "hydra.core.parsers.bind"}, "type": {"literal": "string"}}},
                                                    "type": {"literal": "string"}}},
                                                "argument": {
                                                  "application": {"function": {"variable": "hydra.core.parse.packaging.keyword"}, "argument": {"literal": {"string": "as"}}}}}},
                                            "argument": {
                                              "lambda": {
                                                "parameter": "_",
                                                "domain": {"literal": "string"},
                                                "body": {
                                                  "application": {
                                                    "function": {"typeApplication": {"body": {"variable": "hydra.core.parse.packaging.token"}, "type": {"literal": "string"}}},
                                                    "argument": {"variable": "hydra.core.parse.packaging.dottedIdentifier"}}}}}}}}}}},
                                "argument": {
                                  "lambda": {
                                    "parameter": "malias",
                                    "domain": {"optional": {"literal": "string"}},
                                    "body": {
                                      "application": {
                                        "function": {
                                          "application": {
                                            "function": {
                                              "typeApplication": {
                                                "body": {
                                                  "typeApplication": {
                                                    "body": {"variable": "hydra.core.parsers.bind"},
                                                    "type": {"optional": {"variable": "hydra.core.packaging.PackageName"}}}},
                                                "type": {
                                                  "pair": {"first": {"variable": "hydra.core.packaging.ModuleDependency"}, "second": {"optional": {"literal": "string"}}}}}},
                                            "argument": {
                                              "application": {
                                                "function": {
                                                  "typeApplication": {"body": {"variable": "hydra.core.parsers.optional"}, "type": {"variable": "hydra.core.packaging.PackageName"}}},
                                                "argument": {"variable": "hydra.core.parse.packaging.modulePackage"}}}}},
                                        "argument": {
                                          "lambda": {
                                            "parameter": "mpkg",
                                            "domain": {"optional": {"variable": "hydra.core.packaging.PackageName"}},
                                            "body": {
                                              "application": {
                                                "function": {
                                                  "typeApplication": {
                                                    "body": {"variable": "hydra.core.parsers.pure"},
                                                    "type": {
                                                      "pair": {"first": {"variable": "hydra.core.packaging.ModuleDependency"}, "second": {"optional": {"literal": "string"}}}}}},
                                                "argument": {
                                                  "typeApplication": {
                                                    "body": {
                                                      "typeApplication": {
                                                        "body": {
                                                          "pair": {
                                                            "first": {
                                                              "record": {
                                                                "typeName": "hydra.core.packaging.ModuleDependency",
                                                                "fields": [{"name": "module", "term": {"variable": "modName"}}, {"name": "package", "term": {"variable": "mpkg"}}]}},
                                                            "second": {"variable": "malias"}}},
                                                        "type": {"variable": "hydra.core.packaging.ModuleDependency"}}},
                                                    "type": {"optional": {"literal": "string"}}}}}}}}}}}}}}}}}}}}}},
            "annotation": {
              "map": [
                {
                  "key": {"variable": "description"},
                  "value": {"literal": {"string": "Parse an import declaration, returning its ModuleDependency paired with the optional alias"}}}]}}}}},
    {
      "term": {
        "name": "hydra.core.parse.packaging.isUnionType",
        "signature": {
          "typeParameters": [],
          "parameters": [{"name": "arg0", "type": {"variable": "hydra.core.model.Type"}, "isLazy": false}],
          "result": {"type": {"literal": "boolean"}}},
        "body": {
          "annotated": {
            "body": {
              "lambda": {
                "parameter": "typ",
                "domain": {"variable": "hydra.core.model.Type"},
                "body": {
                  "application": {
                    "function": {
                      "cases": {
                        "typeName": "hydra.core.model.Type",
                        "default": {"literal": {"boolean": false}},
                        "cases": [
                          {
                            "name": "union",
                            "handler": {
                              "lambda": {
                                "parameter": "_",
                                "domain": {"list": {"variable": "hydra.core.model.FieldType"}},
                                "body": {"literal": {"boolean": true}}}}}]}},
                    "argument": {
                      "application": {"function": {"variable": "hydra.core.strip.deannotateTypeParameters"}, "argument": {"variable": "typ"}}}}}}},
            "annotation": {
              "map": [
                {
                  "key": {"variable": "description"},
                  "value": {"literal": {"string": "True iff a type (after stripping foralls/annotations) is a union type (#809)"}}}]}}}}},
    {
      "term": {
        "name": "hydra.core.parse.packaging.keyword",
        "signature": {
          "typeParameters": [],
          "parameters": [{"name": "arg0", "type": {"literal": "string"}, "isLazy": false}],
          "result": {"type": {"application": {"function": {"variable": "hydra.core.parsing.Parser"}, "argument": {"literal": "string"}}}}},
        "body": {
          "annotated": {
            "body": {
              "lambda": {
                "parameter": "kw",
                "domain": {"literal": "string"},
                "body": {
                  "application": {
                    "function": {"typeApplication": {"body": {"variable": "hydra.core.parse.packaging.token"}, "type": {"literal": "string"}}},
                    "argument": {"application": {"function": {"variable": "hydra.core.parsers.string"}, "argument": {"variable": "kw"}}}}}}},
            "annotation": {
              "map": [
                {
                  "key": {"variable": "description"},
                  "value": {"literal": {"string": "Parse a specific keyword, followed by optional trailing whitespace"}}}]}}}}},
    {
      "term": {
        "name": "hydra.core.parse.packaging.moduleHeader",
        "signature": {
          "typeParameters": [],
          "parameters": [],
          "result": {
            "type": {
              "application": {"function": {"variable": "hydra.core.parsing.Parser"}, "argument": {"variable": "hydra.core.packaging.ModuleName"}}}}},
        "body": {
          "annotated": {
            "body": {
              "application": {
                "function": {
                  "application": {
                    "function": {
                      "typeApplication": {
                        "body": {"typeApplication": {"body": {"variable": "hydra.core.parsers.bind"}, "type": {"literal": "string"}}},
                        "type": {"variable": "hydra.core.packaging.ModuleName"}}},
                    "argument": {
                      "application": {"function": {"variable": "hydra.core.parse.packaging.keyword"}, "argument": {"literal": {"string": "module"}}}}}},
                "argument": {
                  "lambda": {
                    "parameter": "_",
                    "domain": {"literal": "string"},
                    "body": {
                      "application": {
                        "function": {
                          "typeApplication": {"body": {"variable": "hydra.core.parse.packaging.token"}, "type": {"variable": "hydra.core.packaging.ModuleName"}}},
                        "argument": {"variable": "hydra.core.parse.packaging.moduleName"}}}}}}},
            "annotation": {
              "map": [
                {
                  "key": {"variable": "description"},
                  "value": {"literal": {"string": "Parse the module header: 'module' followed by a dotted module name"}}}]}}}}},
    {
      "term": {
        "name": "hydra.core.parse.packaging.moduleName",
        "signature": {
          "typeParameters": [],
          "parameters": [],
          "result": {
            "type": {
              "application": {"function": {"variable": "hydra.core.parsing.Parser"}, "argument": {"variable": "hydra.core.packaging.ModuleName"}}}}},
        "body": {
          "annotated": {
            "body": {
              "application": {
                "function": {
                  "application": {
                    "function": {
                      "typeApplication": {
                        "body": {"typeApplication": {"body": {"variable": "hydra.core.parsers.map"}, "type": {"literal": "string"}}},
                        "type": {"variable": "hydra.core.packaging.ModuleName"}}},
                    "argument": {
                      "lambda": {
                        "parameter": "s",
                        "domain": {"literal": "string"},
                        "body": {"wrap": {"typeName": "hydra.core.packaging.ModuleName", "body": {"variable": "s"}}}}}}},
                "argument": {"variable": "hydra.core.parse.packaging.dottedIdentifier"}}},
            "annotation": {"map": [{"key": {"variable": "description"}, "value": {"literal": {"string": "Parse a dotted module name"}}}]}}}}},
    {
      "term": {
        "name": "hydra.core.parse.packaging.modulePackage",
        "signature": {
          "typeParameters": [],
          "parameters": [],
          "result": {
            "type": {
              "application": {"function": {"variable": "hydra.core.parsing.Parser"}, "argument": {"variable": "hydra.core.packaging.PackageName"}}}}},
        "body": {
          "annotated": {
            "body": {
              "application": {
                "function": {
                  "application": {
                    "function": {
                      "typeApplication": {
                        "body": {"typeApplication": {"body": {"variable": "hydra.core.parsers.bind"}, "type": {"literal": "string"}}},
                        "type": {"variable": "hydra.core.packaging.PackageName"}}},
                    "argument": {
                      "application": {"function": {"variable": "hydra.core.parse.packaging.keyword"}, "argument": {"literal": {"string": "from"}}}}}},
                "argument": {
                  "lambda": {
                    "parameter": "_",
                    "domain": {"literal": "string"},
                    "body": {
                      "application": {
                        "function": {
                          "application": {
                            "function": {
                              "typeApplication": {
                                "body": {"typeApplication": {"body": {"variable": "hydra.core.parsers.map"}, "type": {"literal": "string"}}},
                                "type": {"variable": "hydra.core.packaging.PackageName"}}},
                            "argument": {
                              "lambda": {
                                "parameter": "s",
                                "domain": {"literal": "string"},
                                "body": {"wrap": {"typeName": "hydra.core.packaging.PackageName", "body": {"variable": "s"}}}}}}},
                        "argument": {"variable": "hydra.core.parse.packaging.identifier"}}}}}}},
            "annotation": {"map": [{"key": {"variable": "description"}, "value": {"literal": {"string": "Parse a 'from <packageName>' clause"}}}]}}}}},
    {
      "term": {
        "name": "hydra.core.parse.packaging.moduleParser",
        "signature": {
          "typeParameters": [],
          "parameters": [],
          "result": {
            "type": {
              "application": {"function": {"variable": "hydra.core.parsing.Parser"}, "argument": {"variable": "hydra.core.packaging.Module"}}}}},
        "body": {
          "annotated": {
            "body": {
              "application": {
                "function": {
                  "application": {
                    "function": {
                      "typeApplication": {
                        "body": {"typeApplication": {"body": {"variable": "hydra.core.parsers.bind"}, "type": {"list": {"literal": "string"}}}},
                        "type": {"variable": "hydra.core.packaging.Module"}}},
                    "argument": {
                      "application": {
                        "function": {"typeApplication": {"body": {"variable": "hydra.core.parsers.many"}, "type": {"literal": "string"}}},
                        "argument": {
                          "application": {
                            "function": {
                              "application": {
                                "function": {
                                  "typeApplication": {
                                    "body": {"typeApplication": {"body": {"variable": "hydra.core.parsers.bind"}, "type": {"literal": {"integer": "int32"}}}},
                                    "type": {"literal": "string"}}},
                                "argument": {
                                  "application": {"function": {"variable": "hydra.core.parsers.char"}, "argument": {"literal": {"integer": {"int32": 35}}}}}}},
                            "argument": {
                              "lambda": {
                                "parameter": "_",
                                "domain": {"literal": {"integer": "int32"}},
                                "body": {
                                  "application": {
                                    "function": {
                                      "application": {
                                        "function": {
                                          "typeApplication": {
                                            "body": {"typeApplication": {"body": {"variable": "hydra.core.parsers.bind"}, "type": {"literal": {"integer": "int32"}}}},
                                            "type": {"literal": "string"}}},
                                        "argument": {
                                          "application": {"function": {"variable": "hydra.core.parsers.char"}, "argument": {"literal": {"integer": {"int32": 35}}}}}}},
                                    "argument": {
                                      "lambda": {
                                        "parameter": "_",
                                        "domain": {"literal": {"integer": "int32"}},
                                        "body": {
                                          "application": {
                                            "function": {
                                              "application": {
                                                "function": {
                                                  "typeApplication": {
                                                    "body": {
                                                      "typeApplication": {"body": {"variable": "hydra.core.parsers.bind"}, "type": {"optional": {"literal": {"integer": "int32"}}}}},
                                                    "type": {"literal": "string"}}},
                                                "argument": {
                                                  "application": {
                                                    "function": {"typeApplication": {"body": {"variable": "hydra.core.parsers.optional"}, "type": {"literal": {"integer": "int32"}}}},
                                                    "argument": {
                                                      "application": {"function": {"variable": "hydra.core.parsers.char"}, "argument": {"literal": {"integer": {"int32": 32}}}}}}}}},
                                            "argument": {
                                              "lambda": {
                                                "parameter": "_",
                                                "domain": {"optional": {"literal": {"integer": "int32"}}},
                                                "body": {
                                                  "application": {
                                                    "function": {
                                                      "application": {
                                                        "function": {
                                                          "typeApplication": {
                                                            "body": {"typeApplication": {"body": {"variable": "hydra.core.parsers.bind"}, "type": {"literal": "string"}}},
                                                            "type": {"literal": "string"}}},
                                                        "argument": {
                                                          "application": {
                                                            "function": {
                                                              "application": {
                                                                "function": {
                                                                  "typeApplication": {
                                                                    "body": {
                                                                      "typeApplication": {"body": {"variable": "hydra.core.parsers.map"}, "type": {"list": {"literal": {"integer": "int32"}}}}},
                                                                    "type": {"literal": "string"}}},
                                                                "argument": {
                                                                  "lambda": {
                                                                    "parameter": "cs",
                                                                    "domain": {"list": {"literal": {"integer": "int32"}}},
                                                                    "body": {"application": {"function": {"variable": "hydra.core.lib.strings.fromList"}, "argument": {"variable": "cs"}}}}}}},
                                                            "argument": {
                                                              "application": {
                                                                "function": {"typeApplication": {"body": {"variable": "hydra.core.parsers.many"}, "type": {"literal": {"integer": "int32"}}}},
                                                                "argument": {
                                                                  "application": {
                                                                    "function": {"variable": "hydra.core.parsers.satisfy"},
                                                                    "argument": {
                                                                      "lambda": {
                                                                        "parameter": "c",
                                                                        "domain": {"literal": {"integer": "int32"}},
                                                                        "body": {
                                                                          "application": {
                                                                            "function": {"variable": "hydra.core.lib.logic.not"},
                                                                            "argument": {
                                                                              "application": {
                                                                                "function": {
                                                                                  "application": {
                                                                                    "function": {"typeApplication": {"body": {"variable": "hydra.core.lib.equality.equal"}, "type": {"literal": {"integer": "int32"}}}},
                                                                                    "argument": {"variable": "c"}}},
                                                                                "argument": {"literal": {"integer": {"int32": 10}}}}}}}}}}}}}}}}},
                                                    "argument": {
                                                      "lambda": {
                                                        "parameter": "s",
                                                        "domain": {"literal": "string"},
                                                        "body": {
                                                          "application": {
                                                            "function": {
                                                              "application": {
                                                                "function": {
                                                                  "typeApplication": {
                                                                    "body": {"typeApplication": {"body": {"variable": "hydra.core.parsers.bind"}, "type": "unit"}},
                                                                    "type": {"literal": "string"}}},
                                                                "argument": {
                                                                  "application": {
                                                                    "function": {
                                                                      "application": {
                                                                        "function": {
                                                                          "typeApplication": {
                                                                            "body": {
                                                                              "typeApplication": {"body": {"variable": "hydra.core.parsers.map"}, "type": {"list": {"literal": {"integer": "int32"}}}}},
                                                                            "type": "unit"}},
                                                                        "argument": {"lambda": {"parameter": "_", "domain": {"list": {"literal": {"integer": "int32"}}}, "body": "unit"}}}},
                                                                    "argument": {
                                                                      "application": {
                                                                        "function": {"typeApplication": {"body": {"variable": "hydra.core.parsers.many"}, "type": {"literal": {"integer": "int32"}}}},
                                                                        "argument": {
                                                                          "application": {
                                                                            "function": {"variable": "hydra.core.parsers.satisfy"},
                                                                            "argument": {
                                                                              "lambda": {
                                                                                "parameter": "c",
                                                                                "domain": {"literal": {"integer": "int32"}},
                                                                                "body": {"application": {"function": {"variable": "hydra.core.lib.chars.isSpace"}, "argument": {"variable": "c"}}}}}}}}}}}}},
                                                            "argument": {
                                                              "lambda": {
                                                                "parameter": "_",
                                                                "domain": "unit",
                                                                "body": {
                                                                  "application": {
                                                                    "function": {"typeApplication": {"body": {"variable": "hydra.core.parsers.pure"}, "type": {"literal": "string"}}},
                                                                    "argument": {"variable": "s"}}}}}}}}}}}}}}}}}}}}}}}}}}},
                "argument": {
                  "lambda": {
                    "parameter": "lns",
                    "domain": {"list": {"literal": "string"}},
                    "body": {
                      "application": {
                        "function": {
                          "application": {
                            "function": {
                              "typeApplication": {
                                "body": {
                                  "typeApplication": {"body": {"variable": "hydra.core.parsers.bind"}, "type": {"variable": "hydra.core.packaging.ModuleName"}}},
                                "type": {"variable": "hydra.core.packaging.Module"}}},
                            "argument": {"variable": "hydra.core.parse.packaging.moduleHeader"}}},
                        "argument": {
                          "lambda": {
                            "parameter": "modName",
                            "domain": {"variable": "hydra.core.packaging.ModuleName"},
                            "body": {
                              "application": {
                                "function": {
                                  "application": {
                                    "function": {
                                      "typeApplication": {
                                        "body": {
                                          "typeApplication": {
                                            "body": {"variable": "hydra.core.parsers.bind"},
                                            "type": {
                                              "list": {
                                                "pair": {"first": {"variable": "hydra.core.packaging.ModuleDependency"}, "second": {"optional": {"literal": "string"}}}}}}},
                                        "type": {"variable": "hydra.core.packaging.Module"}}},
                                    "argument": {
                                      "application": {
                                        "function": {
                                          "typeApplication": {
                                            "body": {"variable": "hydra.core.parsers.many"},
                                            "type": {
                                              "pair": {"first": {"variable": "hydra.core.packaging.ModuleDependency"}, "second": {"optional": {"literal": "string"}}}}}},
                                        "argument": {"variable": "hydra.core.parse.packaging.importDecl"}}}}},
                                "argument": {
                                  "lambda": {
                                    "parameter": "imports",
                                    "domain": {
                                      "list": {
                                        "pair": {"first": {"variable": "hydra.core.packaging.ModuleDependency"}, "second": {"optional": {"literal": "string"}}}}},
                                    "body": {
                                      "let": {
                                        "bindings": [
                                          {
                                            "name": "aliases",
                                            "term": {
                                              "application": {
                                                "function": {
                                                  "typeApplication": {
                                                    "body": {"typeApplication": {"body": {"variable": "hydra.core.lib.maps.fromList"}, "type": {"literal": "string"}}},
                                                    "type": {"variable": "hydra.core.packaging.ModuleName"}}},
                                                "argument": {
                                                  "application": {
                                                    "function": {
                                                      "typeApplication": {
                                                        "body": {"variable": "hydra.core.lib.optionals.givens"},
                                                        "type": {"pair": {"first": {"literal": "string"}, "second": {"variable": "hydra.core.packaging.ModuleName"}}}}},
                                                    "argument": {
                                                      "application": {
                                                        "function": {
                                                          "application": {
                                                            "function": {
                                                              "typeApplication": {
                                                                "body": {
                                                                  "typeApplication": {
                                                                    "body": {"variable": "hydra.core.lib.lists.map"},
                                                                    "type": {
                                                                      "pair": {"first": {"variable": "hydra.core.packaging.ModuleDependency"}, "second": {"optional": {"literal": "string"}}}}}},
                                                                "type": {"optional": {"pair": {"first": {"literal": "string"}, "second": {"variable": "hydra.core.packaging.ModuleName"}}}}}},
                                                            "argument": {
                                                              "lambda": {
                                                                "parameter": "p",
                                                                "domain": {
                                                                  "pair": {"first": {"variable": "hydra.core.packaging.ModuleDependency"}, "second": {"optional": {"literal": "string"}}}},
                                                                "body": {
                                                                  "application": {
                                                                    "function": {
                                                                      "application": {
                                                                        "function": {
                                                                          "typeApplication": {
                                                                            "body": {"typeApplication": {"body": {"variable": "hydra.core.lib.optionals.map"}, "type": {"literal": "string"}}},
                                                                            "type": {"pair": {"first": {"literal": "string"}, "second": {"variable": "hydra.core.packaging.ModuleName"}}}}},
                                                                        "argument": {
                                                                          "lambda": {
                                                                            "parameter": "alias",
                                                                            "domain": {"literal": "string"},
                                                                            "body": {
                                                                              "typeApplication": {
                                                                                "body": {
                                                                                  "typeApplication": {
                                                                                    "body": {
                                                                                      "pair": {
                                                                                        "first": {"variable": "alias"},
                                                                                        "second": {
                                                                                          "application": {
                                                                                            "function": {"project": {"typeName": "hydra.core.packaging.ModuleDependency", "fieldName": "module"}},
                                                                                            "argument": {
                                                                                              "application": {
                                                                                                "function": {
                                                                                                  "typeApplication": {
                                                                                                    "body": {
                                                                                                      "typeApplication": {"body": {"variable": "hydra.core.lib.pairs.first"}, "type": {"variable": "hydra.core.packaging.ModuleDependency"}}},
                                                                                                    "type": {"optional": {"literal": "string"}}}},
                                                                                                "argument": {"variable": "p"}}}}}}},
                                                                                    "type": {"literal": "string"}}},
                                                                                "type": {"variable": "hydra.core.packaging.ModuleName"}}}}}}},
                                                                    "argument": {
                                                                      "application": {
                                                                        "function": {
                                                                          "typeApplication": {
                                                                            "body": {
                                                                              "typeApplication": {"body": {"variable": "hydra.core.lib.pairs.second"}, "type": {"variable": "hydra.core.packaging.ModuleDependency"}}},
                                                                            "type": {"optional": {"literal": "string"}}}},
                                                                        "argument": {"variable": "p"}}}}}}}}},
                                                        "argument": {"variable": "imports"}}}}}}},
                                            "typeScheme": {
                                              "variables": [],
                                              "body": {"map": {"keys": {"literal": "string"}, "values": {"variable": "hydra.core.packaging.ModuleName"}}},
                                              "constraints": []}}],
                                        "body": {
                                          "let": {
                                            "bindings": [
                                              {
                                                "name": "mmeta",
                                                "term": {
                                                  "application": {
                                                    "function": {
                                                      "application": {
                                                        "function": {
                                                          "application": {
                                                            "function": {
                                                              "typeApplication": {
                                                                "body": {"variable": "hydra.core.lib.logic.ifElse"},
                                                                "type": {"optional": {"variable": "hydra.core.packaging.EntityMetadata"}}}},
                                                            "argument": {
                                                              "application": {
                                                                "function": {"typeApplication": {"body": {"variable": "hydra.core.lib.lists.isEmpty"}, "type": {"literal": "string"}}},
                                                                "argument": {"variable": "lns"}}}}},
                                                        "argument": {"typeApplication": {"body": {"optional": null}, "type": {"variable": "hydra.core.packaging.EntityMetadata"}}}}},
                                                    "argument": {
                                                      "optional": {
                                                        "application": {
                                                          "function": {
                                                            "application": {
                                                              "function": {
                                                                "lambda": {
                                                                  "parameter": "modName",
                                                                  "domain": {"variable": "hydra.core.packaging.ModuleName"},
                                                                  "body": {
                                                                    "lambda": {
                                                                      "parameter": "lns",
                                                                      "domain": {"list": {"literal": "string"}},
                                                                      "body": {
                                                                        "let": {
                                                                          "bindings": [
                                                                            {
                                                                              "name": "sections",
                                                                              "term": {
                                                                                "application": {
                                                                                  "function": {
                                                                                    "lambda": {
                                                                                      "parameter": "lns",
                                                                                      "domain": {"list": {"literal": "string"}},
                                                                                      "body": {
                                                                                        "let": {
                                                                                          "bindings": [
                                                                                            {
                                                                                              "name": "step",
                                                                                              "term": {
                                                                                                "lambda": {
                                                                                                  "parameter": "acc",
                                                                                                  "domain": {"list": {"list": {"literal": "string"}}},
                                                                                                  "body": {
                                                                                                    "lambda": {
                                                                                                      "parameter": "ln",
                                                                                                      "domain": {"literal": "string"},
                                                                                                      "body": {
                                                                                                        "application": {
                                                                                                          "function": {
                                                                                                            "application": {
                                                                                                              "function": {
                                                                                                                "application": {
                                                                                                                  "function": {
                                                                                                                    "typeApplication": {"body": {"variable": "hydra.core.lib.logic.ifElse"}, "type": {"list": {"list": {"literal": "string"}}}}},
                                                                                                                  "argument": {"application": {"function": {"variable": "hydra.core.lib.strings.isEmpty"}, "argument": {"variable": "ln"}}}}},
                                                                                                              "argument": {
                                                                                                                "application": {
                                                                                                                  "function": {
                                                                                                                    "application": {
                                                                                                                      "function": {"typeApplication": {"body": {"variable": "hydra.core.lib.lists.concat2"}, "type": {"list": {"literal": "string"}}}},
                                                                                                                      "argument": {"variable": "acc"}}},
                                                                                                                  "argument": {"list": [{"typeApplication": {"body": {"list": []}, "type": {"literal": "string"}}}]}}}}},
                                                                                                          "argument": {
                                                                                                            "let": {
                                                                                                              "bindings": [
                                                                                                                {
                                                                                                                  "name": "i",
                                                                                                                  "term": {
                                                                                                                    "application": {
                                                                                                                      "function": {
                                                                                                                        "application": {
                                                                                                                          "function": {"typeApplication": {"body": {"variable": "hydra.core.lib.math.sub"}, "type": {"literal": {"integer": "int32"}}}},
                                                                                                                          "argument": {
                                                                                                                            "application": {
                                                                                                                              "function": {"typeApplication": {"body": {"variable": "hydra.core.lib.lists.length"}, "type": {"list": {"literal": "string"}}}},
                                                                                                                              "argument": {"variable": "acc"}}}}},
                                                                                                                      "argument": {"literal": {"integer": {"int32": 1}}}}},
                                                                                                                  "typeScheme": {"variables": [], "body": {"literal": {"integer": "int32"}}, "constraints": []}}],
                                                                                                              "body": {
                                                                                                                "let": {
                                                                                                                  "bindings": [
                                                                                                                    {
                                                                                                                      "name": "cur",
                                                                                                                      "term": {
                                                                                                                        "application": {
                                                                                                                          "function": {
                                                                                                                            "application": {
                                                                                                                              "function": {
                                                                                                                                "typeApplication": {"body": {"variable": "hydra.core.lib.optionals.withDefault"}, "type": {"list": {"literal": "string"}}}},
                                                                                                                              "argument": {"typeApplication": {"body": {"list": []}, "type": {"literal": "string"}}}}},
                                                                                                                          "argument": {
                                                                                                                            "application": {
                                                                                                                              "function": {"typeApplication": {"body": {"variable": "hydra.core.lib.lists.head"}, "type": {"list": {"literal": "string"}}}},
                                                                                                                              "argument": {
                                                                                                                                "application": {
                                                                                                                                  "function": {
                                                                                                                                    "application": {
                                                                                                                                      "function": {"typeApplication": {"body": {"variable": "hydra.core.lib.lists.drop"}, "type": {"list": {"literal": "string"}}}},
                                                                                                                                      "argument": {"variable": "i"}}},
                                                                                                                                  "argument": {"variable": "acc"}}}}}}},
                                                                                                                      "typeScheme": {"variables": [], "body": {"list": {"literal": "string"}}, "constraints": []}}],
                                                                                                                  "body": {
                                                                                                                    "application": {
                                                                                                                      "function": {
                                                                                                                        "application": {
                                                                                                                          "function": {"typeApplication": {"body": {"variable": "hydra.core.lib.lists.concat2"}, "type": {"list": {"literal": "string"}}}},
                                                                                                                          "argument": {
                                                                                                                            "application": {
                                                                                                                              "function": {
                                                                                                                                "application": {
                                                                                                                                  "function": {"typeApplication": {"body": {"variable": "hydra.core.lib.lists.take"}, "type": {"list": {"literal": "string"}}}},
                                                                                                                                  "argument": {"variable": "i"}}},
                                                                                                                              "argument": {"variable": "acc"}}}}},
                                                                                                                      "argument": {
                                                                                                                        "list": [
                                                                                                                          {
                                                                                                                            "application": {
                                                                                                                              "function": {
                                                                                                                                "application": {
                                                                                                                                  "function": {"typeApplication": {"body": {"variable": "hydra.core.lib.lists.concat2"}, "type": {"literal": "string"}}},
                                                                                                                                  "argument": {"variable": "cur"}}},
                                                                                                                              "argument": {"list": [{"variable": "ln"}]}}}]}}}}}}}}}}}}},
                                                                                              "typeScheme": {
                                                                                                "variables": [],
                                                                                                "body": {
                                                                                                  "function": {
                                                                                                    "domain": {"list": {"list": {"literal": "string"}}},
                                                                                                    "codomain": {"function": {"domain": {"literal": "string"}, "codomain": {"list": {"list": {"literal": "string"}}}}}}},
                                                                                                "constraints": []}}],
                                                                                          "body": {
                                                                                            "application": {
                                                                                              "function": {
                                                                                                "application": {
                                                                                                  "function": {"typeApplication": {"body": {"variable": "hydra.core.lib.lists.filter"}, "type": {"list": {"literal": "string"}}}},
                                                                                                  "argument": {
                                                                                                    "lambda": {
                                                                                                      "parameter": "sec",
                                                                                                      "domain": {"list": {"literal": "string"}},
                                                                                                      "body": {
                                                                                                        "application": {
                                                                                                          "function": {"variable": "hydra.core.lib.logic.not"},
                                                                                                          "argument": {
                                                                                                            "application": {
                                                                                                              "function": {"typeApplication": {"body": {"variable": "hydra.core.lib.lists.isEmpty"}, "type": {"literal": "string"}}},
                                                                                                              "argument": {"variable": "sec"}}}}}}}}},
                                                                                              "argument": {
                                                                                                "application": {
                                                                                                  "function": {
                                                                                                    "application": {
                                                                                                      "function": {
                                                                                                        "application": {
                                                                                                          "function": {
                                                                                                            "typeApplication": {
                                                                                                              "body": {
                                                                                                                "typeApplication": {"body": {"variable": "hydra.core.lib.lists.foldl"}, "type": {"list": {"list": {"literal": "string"}}}}},
                                                                                                              "type": {"literal": "string"}}},
                                                                                                          "argument": {"variable": "step"}}},
                                                                                                      "argument": {"list": [{"typeApplication": {"body": {"list": []}, "type": {"literal": "string"}}}]}}},
                                                                                                  "argument": {"variable": "lns"}}}}}}}}},
                                                                                  "argument": {"variable": "lns"}}},
                                                                              "typeScheme": {"variables": [], "body": {"list": {"list": {"literal": "string"}}}, "constraints": []}}],
                                                                          "body": {
                                                                            "let": {
                                                                              "bindings": [
                                                                                {
                                                                                  "name": "isKeySection",
                                                                                  "term": {
                                                                                    "lambda": {
                                                                                      "parameter": "sec",
                                                                                      "domain": {"list": {"literal": "string"}},
                                                                                      "body": {
                                                                                        "application": {
                                                                                          "function": {
                                                                                            "application": {
                                                                                              "function": {
                                                                                                "application": {
                                                                                                  "function": {
                                                                                                    "typeApplication": {
                                                                                                      "body": {"typeApplication": {"body": {"variable": "hydra.core.lib.optionals.match"}, "type": {"literal": "string"}}},
                                                                                                      "type": {"literal": "boolean"}}},
                                                                                                  "argument": {
                                                                                                    "application": {
                                                                                                      "function": {"typeApplication": {"body": {"variable": "hydra.core.lib.lists.head"}, "type": {"literal": "string"}}},
                                                                                                      "argument": {"variable": "sec"}}}}},
                                                                                              "argument": {"literal": {"boolean": false}}}},
                                                                                          "argument": {
                                                                                            "lambda": {
                                                                                              "parameter": "s",
                                                                                              "domain": {"literal": "string"},
                                                                                              "body": {
                                                                                                "application": {
                                                                                                  "function": {
                                                                                                    "application": {
                                                                                                      "function": {
                                                                                                        "application": {
                                                                                                          "function": {
                                                                                                            "typeApplication": {
                                                                                                              "body": {"typeApplication": {"body": {"variable": "hydra.core.lib.optionals.match"}, "type": {"literal": {"integer": "int32"}}}},
                                                                                                              "type": {"literal": "boolean"}}},
                                                                                                          "argument": {
                                                                                                            "application": {
                                                                                                              "function": {
                                                                                                                "application": {"function": {"variable": "hydra.core.lib.strings.charAt"}, "argument": {"literal": {"integer": {"int32": 0}}}}},
                                                                                                              "argument": {"variable": "s"}}}}},
                                                                                                      "argument": {"literal": {"boolean": false}}}},
                                                                                                  "argument": {
                                                                                                    "lambda": {
                                                                                                      "parameter": "c",
                                                                                                      "domain": {"literal": {"integer": "int32"}},
                                                                                                      "body": {
                                                                                                        "application": {
                                                                                                          "function": {
                                                                                                            "application": {
                                                                                                              "function": {"typeApplication": {"body": {"variable": "hydra.core.lib.equality.equal"}, "type": {"literal": {"integer": "int32"}}}},
                                                                                                              "argument": {"variable": "c"}}},
                                                                                                          "argument": {"literal": {"integer": {"int32": 64}}}}}}}}}}}}}}},
                                                                                  "typeScheme": {
                                                                                    "variables": [],
                                                                                    "body": {"function": {"domain": {"list": {"literal": "string"}}, "codomain": {"literal": "boolean"}}},
                                                                                    "constraints": []}}],
                                                                              "body": {
                                                                                "let": {
                                                                                  "bindings": [
                                                                                    {
                                                                                      "name": "keyLines",
                                                                                      "term": {
                                                                                        "application": {
                                                                                          "function": {"typeApplication": {"body": {"variable": "hydra.core.lib.lists.concat"}, "type": {"literal": "string"}}},
                                                                                          "argument": {
                                                                                            "application": {
                                                                                              "function": {
                                                                                                "application": {
                                                                                                  "function": {"typeApplication": {"body": {"variable": "hydra.core.lib.lists.filter"}, "type": {"list": {"literal": "string"}}}},
                                                                                                  "argument": {"variable": "isKeySection"}}},
                                                                                              "argument": {"variable": "sections"}}}}},
                                                                                      "typeScheme": {"variables": [], "body": {"list": {"literal": "string"}}, "constraints": []}}],
                                                                                  "body": {
                                                                                    "let": {
                                                                                      "bindings": [
                                                                                        {
                                                                                          "name": "nonKeySections",
                                                                                          "term": {
                                                                                            "application": {
                                                                                              "function": {
                                                                                                "application": {
                                                                                                  "function": {"typeApplication": {"body": {"variable": "hydra.core.lib.lists.filter"}, "type": {"list": {"literal": "string"}}}},
                                                                                                  "argument": {
                                                                                                    "lambda": {
                                                                                                      "parameter": "sec",
                                                                                                      "domain": {"list": {"literal": "string"}},
                                                                                                      "body": {
                                                                                                        "application": {
                                                                                                          "function": {"variable": "hydra.core.lib.logic.not"},
                                                                                                          "argument": {"application": {"function": {"variable": "isKeySection"}, "argument": {"variable": "sec"}}}}}}}}},
                                                                                              "argument": {"variable": "sections"}}},
                                                                                          "typeScheme": {"variables": [], "body": {"list": {"list": {"literal": "string"}}}, "constraints": []}}],
                                                                                      "body": {
                                                                                        "let": {
                                                                                          "bindings": [
                                                                                            {
                                                                                              "name": "mdesc",
                                                                                              "term": {
                                                                                                "application": {
                                                                                                  "function": {
                                                                                                    "application": {
                                                                                                      "function": {
                                                                                                        "typeApplication": {
                                                                                                          "body": {"typeApplication": {"body": {"variable": "hydra.core.lib.optionals.map"}, "type": {"list": {"literal": "string"}}}},
                                                                                                          "type": {"literal": "string"}}},
                                                                                                      "argument": {
                                                                                                        "lambda": {
                                                                                                          "parameter": "sec",
                                                                                                          "domain": {"list": {"literal": "string"}},
                                                                                                          "body": {
                                                                                                            "application": {
                                                                                                              "function": {"application": {"function": {"variable": "hydra.core.lib.strings.join"}, "argument": {"literal": {"string": "\n"}}}},
                                                                                                              "argument": {"variable": "sec"}}}}}}},
                                                                                                  "argument": {
                                                                                                    "application": {
                                                                                                      "function": {"typeApplication": {"body": {"variable": "hydra.core.lib.lists.head"}, "type": {"list": {"literal": "string"}}}},
                                                                                                      "argument": {"variable": "nonKeySections"}}}}},
                                                                                              "typeScheme": {"variables": [], "body": {"optional": {"literal": "string"}}, "constraints": []}}],
                                                                                          "body": {
                                                                                            "let": {
                                                                                              "bindings": [
                                                                                                {
                                                                                                  "name": "comments",
                                                                                                  "term": {
                                                                                                    "application": {
                                                                                                      "function": {
                                                                                                        "application": {
                                                                                                          "function": {
                                                                                                            "typeApplication": {"body": {"variable": "hydra.core.lib.optionals.withDefault"}, "type": {"list": {"literal": "string"}}}},
                                                                                                          "argument": {"typeApplication": {"body": {"list": []}, "type": {"literal": "string"}}}}},
                                                                                                      "argument": {
                                                                                                        "application": {
                                                                                                          "function": {"typeApplication": {"body": {"variable": "hydra.core.lib.lists.head"}, "type": {"list": {"literal": "string"}}}},
                                                                                                          "argument": {
                                                                                                            "application": {
                                                                                                              "function": {
                                                                                                                "application": {
                                                                                                                  "function": {"typeApplication": {"body": {"variable": "hydra.core.lib.lists.drop"}, "type": {"list": {"literal": "string"}}}},
                                                                                                                  "argument": {"literal": {"integer": {"int32": 1}}}}},
                                                                                                              "argument": {"variable": "nonKeySections"}}}}}}},
                                                                                                  "typeScheme": {"variables": [], "body": {"list": {"literal": "string"}}, "constraints": []}}],
                                                                                              "body": {
                                                                                                "let": {
                                                                                                  "bindings": [
                                                                                                    {
                                                                                                      "name": "seeAlso",
                                                                                                      "term": {
                                                                                                        "application": {
                                                                                                          "function": {
                                                                                                            "typeApplication": {"body": {"variable": "hydra.core.lib.optionals.givens"}, "type": {"variable": "hydra.core.packaging.EntityReference"}}},
                                                                                                          "argument": {
                                                                                                            "application": {
                                                                                                              "function": {
                                                                                                                "application": {
                                                                                                                  "function": {
                                                                                                                    "typeApplication": {
                                                                                                                      "body": {"typeApplication": {"body": {"variable": "hydra.core.lib.lists.map"}, "type": {"literal": "string"}}},
                                                                                                                      "type": {"optional": {"variable": "hydra.core.packaging.EntityReference"}}}},
                                                                                                                  "argument": {
                                                                                                                    "lambda": {
                                                                                                                      "parameter": "ln",
                                                                                                                      "domain": {"literal": "string"},
                                                                                                                      "body": {
                                                                                                                        "let": {
                                                                                                                          "bindings": [
                                                                                                                            {
                                                                                                                              "name": "parts",
                                                                                                                              "term": {
                                                                                                                                "application": {
                                                                                                                                  "function": {"application": {"function": {"variable": "hydra.core.lib.strings.splitOn"}, "argument": {"literal": {"string": " "}}}},
                                                                                                                                  "argument": {"variable": "ln"}}},
                                                                                                                              "typeScheme": {"variables": [], "body": {"list": {"literal": "string"}}, "constraints": []}}],
                                                                                                                          "body": {
                                                                                                                            "application": {
                                                                                                                              "function": {
                                                                                                                                "application": {
                                                                                                                                  "function": {
                                                                                                                                    "application": {
                                                                                                                                      "function": {
                                                                                                                                        "typeApplication": {
                                                                                                                                          "body": {"variable": "hydra.core.lib.logic.ifElse"},
                                                                                                                                          "type": {"optional": {"variable": "hydra.core.packaging.EntityReference"}}}},
                                                                                                                                      "argument": {
                                                                                                                                        "application": {
                                                                                                                                          "function": {
                                                                                                                                            "application": {
                                                                                                                                              "function": {"typeApplication": {"body": {"variable": "hydra.core.lib.equality.equal"}, "type": {"literal": "string"}}},
                                                                                                                                              "argument": {
                                                                                                                                                "application": {
                                                                                                                                                  "function": {
                                                                                                                                                    "application": {
                                                                                                                                                      "function": {"typeApplication": {"body": {"variable": "hydra.core.lib.optionals.withDefault"}, "type": {"literal": "string"}}},
                                                                                                                                                      "argument": {"literal": {"string": ""}}}},
                                                                                                                                                  "argument": {
                                                                                                                                                    "application": {
                                                                                                                                                      "function": {"typeApplication": {"body": {"variable": "hydra.core.lib.lists.head"}, "type": {"literal": "string"}}},
                                                                                                                                                      "argument": {"variable": "parts"}}}}}}},
                                                                                                                                          "argument": {"literal": {"string": "@seeAlso"}}}}}},
                                                                                                                                  "argument": {
                                                                                                                                    "application": {
                                                                                                                                      "function": {"variable": "hydra.core.parse.docs.parseDocAnnotation"},
                                                                                                                                      "argument": {
                                                                                                                                        "application": {
                                                                                                                                          "function": {"application": {"function": {"variable": "hydra.core.lib.strings.join"}, "argument": {"literal": {"string": " "}}}},
                                                                                                                                          "argument": {
                                                                                                                                            "application": {
                                                                                                                                              "function": {
                                                                                                                                                "application": {
                                                                                                                                                  "function": {"typeApplication": {"body": {"variable": "hydra.core.lib.lists.drop"}, "type": {"literal": "string"}}},
                                                                                                                                                  "argument": {"literal": {"integer": {"int32": 1}}}}},
                                                                                                                                              "argument": {"variable": "parts"}}}}}}}}},
                                                                                                                              "argument": {"typeApplication": {"body": {"optional": null}, "type": {"variable": "hydra.core.packaging.EntityReference"}}}}}}}}}}},
                                                                                                              "argument": {"variable": "keyLines"}}}}},
                                                                                                      "typeScheme": {"variables": [], "body": {"list": {"variable": "hydra.core.packaging.EntityReference"}}, "constraints": []}}],
                                                                                                  "body": {
                                                                                                    "let": {
                                                                                                      "bindings": [
                                                                                                        {
                                                                                                          "name": "avail",
                                                                                                          "term": {
                                                                                                            "application": {
                                                                                                              "function": {
                                                                                                                "typeApplication": {"body": {"variable": "hydra.core.lib.optionals.givens"}, "type": {"variable": "hydra.core.packaging.Version"}}},
                                                                                                              "argument": {
                                                                                                                "application": {
                                                                                                                  "function": {
                                                                                                                    "application": {
                                                                                                                      "function": {
                                                                                                                        "typeApplication": {
                                                                                                                          "body": {"typeApplication": {"body": {"variable": "hydra.core.lib.lists.map"}, "type": {"literal": "string"}}},
                                                                                                                          "type": {"optional": {"variable": "hydra.core.packaging.Version"}}}},
                                                                                                                      "argument": {
                                                                                                                        "application": {
                                                                                                                          "function": {
                                                                                                                            "lambda": {
                                                                                                                              "parameter": "tag",
                                                                                                                              "domain": {"literal": "string"},
                                                                                                                              "body": {
                                                                                                                                "lambda": {
                                                                                                                                  "parameter": "ln",
                                                                                                                                  "domain": {"literal": "string"},
                                                                                                                                  "body": {
                                                                                                                                    "let": {
                                                                                                                                      "bindings": [
                                                                                                                                        {
                                                                                                                                          "name": "parts",
                                                                                                                                          "term": {
                                                                                                                                            "application": {
                                                                                                                                              "function": {"application": {"function": {"variable": "hydra.core.lib.strings.splitOn"}, "argument": {"literal": {"string": " "}}}},
                                                                                                                                              "argument": {"variable": "ln"}}},
                                                                                                                                          "typeScheme": {"variables": [], "body": {"list": {"literal": "string"}}, "constraints": []}}],
                                                                                                                                      "body": {
                                                                                                                                        "application": {
                                                                                                                                          "function": {
                                                                                                                                            "application": {
                                                                                                                                              "function": {
                                                                                                                                                "application": {
                                                                                                                                                  "function": {
                                                                                                                                                    "typeApplication": {
                                                                                                                                                      "body": {"variable": "hydra.core.lib.logic.ifElse"},
                                                                                                                                                      "type": {"optional": {"variable": "hydra.core.packaging.Version"}}}},
                                                                                                                                                  "argument": {
                                                                                                                                                    "application": {
                                                                                                                                                      "function": {
                                                                                                                                                        "application": {
                                                                                                                                                          "function": {"typeApplication": {"body": {"variable": "hydra.core.lib.equality.equal"}, "type": {"literal": "string"}}},
                                                                                                                                                          "argument": {
                                                                                                                                                            "application": {
                                                                                                                                                              "function": {
                                                                                                                                                                "application": {
                                                                                                                                                                  "function": {"typeApplication": {"body": {"variable": "hydra.core.lib.optionals.withDefault"}, "type": {"literal": "string"}}},
                                                                                                                                                                  "argument": {"literal": {"string": ""}}}},
                                                                                                                                                              "argument": {
                                                                                                                                                                "application": {
                                                                                                                                                                  "function": {"typeApplication": {"body": {"variable": "hydra.core.lib.lists.head"}, "type": {"literal": "string"}}},
                                                                                                                                                                  "argument": {"variable": "parts"}}}}}}},
                                                                                                                                                      "argument": {"variable": "tag"}}}}},
                                                                                                                                              "argument": {
                                                                                                                                                "optional": {
                                                                                                                                                  "wrap": {
                                                                                                                                                    "typeName": "hydra.core.packaging.Version",
                                                                                                                                                    "body": {
                                                                                                                                                      "application": {
                                                                                                                                                        "function": {"application": {"function": {"variable": "hydra.core.lib.strings.join"}, "argument": {"literal": {"string": " "}}}},
                                                                                                                                                        "argument": {
                                                                                                                                                          "application": {
                                                                                                                                                            "function": {
                                                                                                                                                              "application": {
                                                                                                                                                                "function": {"typeApplication": {"body": {"variable": "hydra.core.lib.lists.drop"}, "type": {"literal": "string"}}},
                                                                                                                                                                "argument": {"literal": {"integer": {"int32": 1}}}}},
                                                                                                                                                            "argument": {"variable": "parts"}}}}}}}}}},
                                                                                                                                          "argument": {"typeApplication": {"body": {"optional": null}, "type": {"variable": "hydra.core.packaging.Version"}}}}}}}}}}},
                                                                                                                          "argument": {"literal": {"string": "@availableSince"}}}}}},
                                                                                                                  "argument": {"variable": "keyLines"}}}}},
                                                                                                          "typeScheme": {"variables": [], "body": {"list": {"variable": "hydra.core.packaging.Version"}}, "constraints": []}}],
                                                                                                      "body": {
                                                                                                        "let": {
                                                                                                          "bindings": [
                                                                                                            {
                                                                                                              "name": "depr",
                                                                                                              "term": {
                                                                                                                "application": {
                                                                                                                  "function": {
                                                                                                                    "typeApplication": {"body": {"variable": "hydra.core.lib.optionals.givens"}, "type": {"variable": "hydra.core.packaging.Version"}}},
                                                                                                                  "argument": {
                                                                                                                    "application": {
                                                                                                                      "function": {
                                                                                                                        "application": {
                                                                                                                          "function": {
                                                                                                                            "typeApplication": {
                                                                                                                              "body": {"typeApplication": {"body": {"variable": "hydra.core.lib.lists.map"}, "type": {"literal": "string"}}},
                                                                                                                              "type": {"optional": {"variable": "hydra.core.packaging.Version"}}}},
                                                                                                                          "argument": {
                                                                                                                            "application": {
                                                                                                                              "function": {
                                                                                                                                "lambda": {
                                                                                                                                  "parameter": "tag",
                                                                                                                                  "domain": {"literal": "string"},
                                                                                                                                  "body": {
                                                                                                                                    "lambda": {
                                                                                                                                      "parameter": "ln",
                                                                                                                                      "domain": {"literal": "string"},
                                                                                                                                      "body": {
                                                                                                                                        "let": {
                                                                                                                                          "bindings": [
                                                                                                                                            {
                                                                                                                                              "name": "parts",
                                                                                                                                              "term": {
                                                                                                                                                "application": {
                                                                                                                                                  "function": {"application": {"function": {"variable": "hydra.core.lib.strings.splitOn"}, "argument": {"literal": {"string": " "}}}},
                                                                                                                                                  "argument": {"variable": "ln"}}},
                                                                                                                                              "typeScheme": {"variables": [], "body": {"list": {"literal": "string"}}, "constraints": []}}],
                                                                                                                                          "body": {
                                                                                                                                            "application": {
                                                                                                                                              "function": {
                                                                                                                                                "application": {
                                                                                                                                                  "function": {
                                                                                                                                                    "application": {
                                                                                                                                                      "function": {
                                                                                                                                                        "typeApplication": {
                                                                                                                                                          "body": {"variable": "hydra.core.lib.logic.ifElse"},
                                                                                                                                                          "type": {"optional": {"variable": "hydra.core.packaging.Version"}}}},
                                                                                                                                                      "argument": {
                                                                                                                                                        "application": {
                                                                                                                                                          "function": {
                                                                                                                                                            "application": {
                                                                                                                                                              "function": {"typeApplication": {"body": {"variable": "hydra.core.lib.equality.equal"}, "type": {"literal": "string"}}},
                                                                                                                                                              "argument": {
                                                                                                                                                                "application": {
                                                                                                                                                                  "function": {
                                                                                                                                                                    "application": {
                                                                                                                                                                      "function": {"typeApplication": {"body": {"variable": "hydra.core.lib.optionals.withDefault"}, "type": {"literal": "string"}}},
                                                                                                                                                                      "argument": {"literal": {"string": ""}}}},
                                                                                                                                                                  "argument": {
                                                                                                                                                                    "application": {
                                                                                                                                                                      "function": {"typeApplication": {"body": {"variable": "hydra.core.lib.lists.head"}, "type": {"literal": "string"}}},
                                                                                                                                                                      "argument": {"variable": "parts"}}}}}}},
                                                                                                                                                          "argument": {"variable": "tag"}}}}},
                                                                                                                                                  "argument": {
                                                                                                                                                    "optional": {
                                                                                                                                                      "wrap": {
                                                                                                                                                        "typeName": "hydra.core.packaging.Version",
                                                                                                                                                        "body": {
                                                                                                                                                          "application": {
                                                                                                                                                            "function": {"application": {"function": {"variable": "hydra.core.lib.strings.join"}, "argument": {"literal": {"string": " "}}}},
                                                                                                                                                            "argument": {
                                                                                                                                                              "application": {
                                                                                                                                                                "function": {
                                                                                                                                                                  "application": {
                                                                                                                                                                    "function": {"typeApplication": {"body": {"variable": "hydra.core.lib.lists.drop"}, "type": {"literal": "string"}}},
                                                                                                                                                                    "argument": {"literal": {"integer": {"int32": 1}}}}},
                                                                                                                                                                "argument": {"variable": "parts"}}}}}}}}}},
                                                                                                                                              "argument": {"typeApplication": {"body": {"optional": null}, "type": {"variable": "hydra.core.packaging.Version"}}}}}}}}}}},
                                                                                                                              "argument": {"literal": {"string": "@deprecatedSince"}}}}}},
                                                                                                                      "argument": {"variable": "keyLines"}}}}},
                                                                                                              "typeScheme": {"variables": [], "body": {"list": {"variable": "hydra.core.packaging.Version"}}, "constraints": []}}],
                                                                                                          "body": {
                                                                                                            "let": {
                                                                                                              "bindings": [
                                                                                                                {
                                                                                                                  "name": "provisions",
                                                                                                                  "term": {
                                                                                                                    "application": {
                                                                                                                      "function": {
                                                                                                                        "typeApplication": {"body": {"variable": "hydra.core.lib.optionals.givens"}, "type": {"variable": "hydra.core.packaging.Provision"}}},
                                                                                                                      "argument": {
                                                                                                                        "application": {
                                                                                                                          "function": {
                                                                                                                            "application": {
                                                                                                                              "function": {
                                                                                                                                "typeApplication": {
                                                                                                                                  "body": {"typeApplication": {"body": {"variable": "hydra.core.lib.lists.map"}, "type": {"literal": "string"}}},
                                                                                                                                  "type": {"optional": {"variable": "hydra.core.packaging.Provision"}}}},
                                                                                                                              "argument": {
                                                                                                                                "application": {
                                                                                                                                  "function": {
                                                                                                                                    "lambda": {
                                                                                                                                      "parameter": "modName",
                                                                                                                                      "domain": {"variable": "hydra.core.packaging.ModuleName"},
                                                                                                                                      "body": {
                                                                                                                                        "lambda": {
                                                                                                                                          "parameter": "ln",
                                                                                                                                          "domain": {"literal": "string"},
                                                                                                                                          "body": {
                                                                                                                                            "let": {
                                                                                                                                              "bindings": [
                                                                                                                                                {
                                                                                                                                                  "name": "tag",
                                                                                                                                                  "term": {
                                                                                                                                                    "application": {
                                                                                                                                                      "function": {
                                                                                                                                                        "application": {
                                                                                                                                                          "function": {"typeApplication": {"body": {"variable": "hydra.core.lib.optionals.withDefault"}, "type": {"literal": "string"}}},
                                                                                                                                                          "argument": {"literal": {"string": ""}}}},
                                                                                                                                                      "argument": {
                                                                                                                                                        "application": {
                                                                                                                                                          "function": {"typeApplication": {"body": {"variable": "hydra.core.lib.lists.head"}, "type": {"literal": "string"}}},
                                                                                                                                                          "argument": {
                                                                                                                                                            "application": {
                                                                                                                                                              "function": {"application": {"function": {"variable": "hydra.core.lib.strings.splitOn"}, "argument": {"literal": {"string": " "}}}},
                                                                                                                                                              "argument": {"variable": "ln"}}}}}}},
                                                                                                                                                  "typeScheme": {"variables": [], "body": {"literal": "string"}, "constraints": []}}],
                                                                                                                                              "body": {
                                                                                                                                                "let": {
                                                                                                                                                  "bindings": [
                                                                                                                                                    {
                                                                                                                                                      "name": "afterTag",
                                                                                                                                                      "term": {
                                                                                                                                                        "application": {
                                                                                                                                                          "function": {"application": {"function": {"variable": "hydra.core.lib.strings.join"}, "argument": {"literal": {"string": " "}}}},
                                                                                                                                                          "argument": {
                                                                                                                                                            "application": {
                                                                                                                                                              "function": {
                                                                                                                                                                "application": {
                                                                                                                                                                  "function": {"typeApplication": {"body": {"variable": "hydra.core.lib.lists.drop"}, "type": {"literal": "string"}}},
                                                                                                                                                                  "argument": {"literal": {"integer": {"int32": 1}}}}},
                                                                                                                                                              "argument": {
                                                                                                                                                                "application": {
                                                                                                                                                                  "function": {"application": {"function": {"variable": "hydra.core.lib.strings.splitOn"}, "argument": {"literal": {"string": " "}}}},
                                                                                                                                                                  "argument": {"variable": "ln"}}}}}}},
                                                                                                                                                      "typeScheme": {"variables": [], "body": {"literal": "string"}, "constraints": []}}],
                                                                                                                                                  "body": {
                                                                                                                                                    "let": {
                                                                                                                                                      "bindings": [
                                                                                                                                                        {
                                                                                                                                                          "name": "nameAndStmt",
                                                                                                                                                          "term": {
                                                                                                                                                            "application": {
                                                                                                                                                              "function": {"application": {"function": {"variable": "hydra.core.lib.strings.splitOn"}, "argument": {"literal": {"string": ": "}}}},
                                                                                                                                                              "argument": {"variable": "afterTag"}}},
                                                                                                                                                          "typeScheme": {"variables": [], "body": {"list": {"literal": "string"}}, "constraints": []}}],
                                                                                                                                                      "body": {
                                                                                                                                                        "let": {
                                                                                                                                                          "bindings": [
                                                                                                                                                            {
                                                                                                                                                              "name": "localName",
                                                                                                                                                              "term": {
                                                                                                                                                                "application": {
                                                                                                                                                                  "function": {
                                                                                                                                                                    "application": {
                                                                                                                                                                      "function": {"typeApplication": {"body": {"variable": "hydra.core.lib.optionals.withDefault"}, "type": {"literal": "string"}}},
                                                                                                                                                                      "argument": {"literal": {"string": ""}}}},
                                                                                                                                                                  "argument": {
                                                                                                                                                                    "application": {
                                                                                                                                                                      "function": {"typeApplication": {"body": {"variable": "hydra.core.lib.lists.head"}, "type": {"literal": "string"}}},
                                                                                                                                                                      "argument": {"variable": "nameAndStmt"}}}}},
                                                                                                                                                              "typeScheme": {"variables": [], "body": {"literal": "string"}, "constraints": []}}],
                                                                                                                                                          "body": {
                                                                                                                                                            "let": {
                                                                                                                                                              "bindings": [
                                                                                                                                                                {
                                                                                                                                                                  "name": "stmt",
                                                                                                                                                                  "term": {
                                                                                                                                                                    "application": {
                                                                                                                                                                      "function": {"application": {"function": {"variable": "hydra.core.lib.strings.join"}, "argument": {"literal": {"string": ": "}}}},
                                                                                                                                                                      "argument": {
                                                                                                                                                                        "application": {
                                                                                                                                                                          "function": {
                                                                                                                                                                            "application": {
                                                                                                                                                                              "function": {"typeApplication": {"body": {"variable": "hydra.core.lib.lists.drop"}, "type": {"literal": "string"}}},
                                                                                                                                                                              "argument": {"literal": {"integer": {"int32": 1}}}}},
                                                                                                                                                                          "argument": {"variable": "nameAndStmt"}}}}},
                                                                                                                                                                  "typeScheme": {"variables": [], "body": {"literal": "string"}, "constraints": []}}],
                                                                                                                                                              "body": {
                                                                                                                                                                "application": {
                                                                                                                                                                  "function": {
                                                                                                                                                                    "application": {
                                                                                                                                                                      "function": {
                                                                                                                                                                        "application": {
                                                                                                                                                                          "function": {
                                                                                                                                                                            "typeApplication": {
                                                                                                                                                                              "body": {"variable": "hydra.core.lib.logic.ifElse"},
                                                                                                                                                                              "type": {"optional": {"variable": "hydra.core.packaging.Provision"}}}},
                                                                                                                                                                          "argument": {
                                                                                                                                                                            "application": {
                                                                                                                                                                              "function": {
                                                                                                                                                                                "application": {
                                                                                                                                                                                  "function": {"typeApplication": {"body": {"variable": "hydra.core.lib.equality.equal"}, "type": {"literal": "string"}}},
                                                                                                                                                                                  "argument": {"variable": "tag"}}},
                                                                                                                                                                              "argument": {"literal": {"string": "@requirement"}}}}}},
                                                                                                                                                                      "argument": {
                                                                                                                                                                        "optional": {
                                                                                                                                                                          "record": {
                                                                                                                                                                            "typeName": "hydra.core.packaging.Provision",
                                                                                                                                                                            "fields": [
                                                                                                                                                                              {
                                                                                                                                                                                "name": "name",
                                                                                                                                                                                "term": {
                                                                                                                                                                                  "application": {
                                                                                                                                                                                    "function": {
                                                                                                                                                                                      "application": {"function": {"variable": "hydra.core.parse.packaging.qualifyLocalName"}, "argument": {"variable": "modName"}}},
                                                                                                                                                                                    "argument": {"variable": "localName"}}}},
                                                                                                                                                                              {
                                                                                                                                                                                "name": "kind",
                                                                                                                                                                                "term": {"inject": {"typeName": "hydra.core.packaging.ProvisionKind", "field": {"name": "requirement", "term": "unit"}}}},
                                                                                                                                                                              {"name": "statement", "term": {"variable": "stmt"}}]}}}}},
                                                                                                                                                                  "argument": {
                                                                                                                                                                    "application": {
                                                                                                                                                                      "function": {
                                                                                                                                                                        "application": {
                                                                                                                                                                          "function": {
                                                                                                                                                                            "application": {
                                                                                                                                                                              "function": {
                                                                                                                                                                                "typeApplication": {
                                                                                                                                                                                  "body": {"variable": "hydra.core.lib.logic.ifElse"},
                                                                                                                                                                                  "type": {"optional": {"variable": "hydra.core.packaging.Provision"}}}},
                                                                                                                                                                              "argument": {
                                                                                                                                                                                "application": {
                                                                                                                                                                                  "function": {
                                                                                                                                                                                    "application": {
                                                                                                                                                                                      "function": {"typeApplication": {"body": {"variable": "hydra.core.lib.equality.equal"}, "type": {"literal": "string"}}},
                                                                                                                                                                                      "argument": {"variable": "tag"}}},
                                                                                                                                                                                  "argument": {"literal": {"string": "@recommendation"}}}}}},
                                                                                                                                                                          "argument": {
                                                                                                                                                                            "optional": {
                                                                                                                                                                              "record": {
                                                                                                                                                                                "typeName": "hydra.core.packaging.Provision",
                                                                                                                                                                                "fields": [
                                                                                                                                                                                  {
                                                                                                                                                                                    "name": "name",
                                                                                                                                                                                    "term": {
                                                                                                                                                                                      "application": {
                                                                                                                                                                                        "function": {
                                                                                                                                                                                          "application": {"function": {"variable": "hydra.core.parse.packaging.qualifyLocalName"}, "argument": {"variable": "modName"}}},
                                                                                                                                                                                        "argument": {"variable": "localName"}}}},
                                                                                                                                                                                  {
                                                                                                                                                                                    "name": "kind",
                                                                                                                                                                                    "term": {"inject": {"typeName": "hydra.core.packaging.ProvisionKind", "field": {"name": "recommendation", "term": "unit"}}}},
                                                                                                                                                                                  {"name": "statement", "term": {"variable": "stmt"}}]}}}}},
                                                                                                                                                                      "argument": {"typeApplication": {"body": {"optional": null}, "type": {"variable": "hydra.core.packaging.Provision"}}}}}}}}}}}}}}}}}}}}},
                                                                                                                                  "argument": {"variable": "modName"}}}}},
                                                                                                                          "argument": {"variable": "keyLines"}}}}},
                                                                                                                  "typeScheme": {"variables": [], "body": {"list": {"variable": "hydra.core.packaging.Provision"}}, "constraints": []}}],
                                                                                                              "body": {
                                                                                                                "let": {
                                                                                                                  "bindings": [
                                                                                                                    {
                                                                                                                      "name": "mlifecycle",
                                                                                                                      "term": {
                                                                                                                        "application": {
                                                                                                                          "function": {
                                                                                                                            "application": {
                                                                                                                              "function": {
                                                                                                                                "application": {
                                                                                                                                  "function": {
                                                                                                                                    "typeApplication": {
                                                                                                                                      "body": {"variable": "hydra.core.lib.logic.ifElse"},
                                                                                                                                      "type": {"optional": {"variable": "hydra.core.packaging.LifecycleInfo"}}}},
                                                                                                                                  "argument": {
                                                                                                                                    "application": {
                                                                                                                                      "function": {
                                                                                                                                        "application": {
                                                                                                                                          "function": {"variable": "hydra.core.lib.logic.and"},
                                                                                                                                          "argument": {
                                                                                                                                            "application": {
                                                                                                                                              "function": {
                                                                                                                                                "typeApplication": {"body": {"variable": "hydra.core.lib.lists.isEmpty"}, "type": {"variable": "hydra.core.packaging.Version"}}},
                                                                                                                                              "argument": {"variable": "avail"}}}}},
                                                                                                                                      "argument": {
                                                                                                                                        "application": {
                                                                                                                                          "function": {
                                                                                                                                            "typeApplication": {"body": {"variable": "hydra.core.lib.lists.isEmpty"}, "type": {"variable": "hydra.core.packaging.Version"}}},
                                                                                                                                          "argument": {"variable": "depr"}}}}}}},
                                                                                                                              "argument": {"typeApplication": {"body": {"optional": null}, "type": {"variable": "hydra.core.packaging.LifecycleInfo"}}}}},
                                                                                                                          "argument": {
                                                                                                                            "optional": {
                                                                                                                              "record": {
                                                                                                                                "typeName": "hydra.core.packaging.LifecycleInfo",
                                                                                                                                "fields": [
                                                                                                                                  {
                                                                                                                                    "name": "availableSince",
                                                                                                                                    "term": {
                                                                                                                                      "application": {
                                                                                                                                        "function": {
                                                                                                                                          "typeApplication": {"body": {"variable": "hydra.core.lib.lists.head"}, "type": {"variable": "hydra.core.packaging.Version"}}},
                                                                                                                                        "argument": {"variable": "avail"}}}},
                                                                                                                                  {
                                                                                                                                    "name": "deprecatedSince",
                                                                                                                                    "term": {
                                                                                                                                      "application": {
                                                                                                                                        "function": {
                                                                                                                                          "typeApplication": {"body": {"variable": "hydra.core.lib.lists.head"}, "type": {"variable": "hydra.core.packaging.Version"}}},
                                                                                                                                        "argument": {"variable": "depr"}}}}]}}}}},
                                                                                                                      "typeScheme": {"variables": [], "body": {"optional": {"variable": "hydra.core.packaging.LifecycleInfo"}}, "constraints": []}}],
                                                                                                                  "body": {
                                                                                                                    "record": {
                                                                                                                      "typeName": "hydra.core.packaging.EntityMetadata",
                                                                                                                      "fields": [
                                                                                                                        {"name": "description", "term": {"variable": "mdesc"}},
                                                                                                                        {"name": "comments", "term": {"variable": "comments"}},
                                                                                                                        {"name": "seeAlso", "term": {"variable": "seeAlso"}},
                                                                                                                        {"name": "lifecycle", "term": {"variable": "mlifecycle"}},
                                                                                                                        {"name": "provisions", "term": {"variable": "provisions"}}]}}}}}}}}}}}}}}}}}}}}}}}}}}}},
                                                              "argument": {"variable": "modName"}}},
                                                          "argument": {"variable": "lns"}}}}}},
                                                "typeScheme": {"variables": [], "body": {"optional": {"variable": "hydra.core.packaging.EntityMetadata"}}, "constraints": []}}],
                                            "body": {
                                              "application": {
                                                "function": {
                                                  "application": {
                                                    "function": {
                                                      "typeApplication": {
                                                        "body": {
                                                          "typeApplication": {"body": {"variable": "hydra.core.parsers.map"}, "type": {"list": {"variable": "hydra.core.packaging.Definition"}}}},
                                                        "type": {"variable": "hydra.core.packaging.Module"}}},
                                                    "argument": {
                                                      "lambda": {
                                                        "parameter": "defs",
                                                        "domain": {"list": {"variable": "hydra.core.packaging.Definition"}},
                                                        "body": {
                                                          "let": {
                                                            "bindings": [
                                                              {
                                                                "name": "ownNames",
                                                                "term": {
                                                                  "application": {
                                                                    "function": {"typeApplication": {"body": {"variable": "hydra.core.lib.sets.fromList"}, "type": {"literal": "string"}}},
                                                                    "argument": {
                                                                      "application": {
                                                                        "function": {
                                                                          "application": {
                                                                            "function": {
                                                                              "typeApplication": {
                                                                                "body": {
                                                                                  "typeApplication": {"body": {"variable": "hydra.core.lib.lists.map"}, "type": {"variable": "hydra.core.packaging.Definition"}}},
                                                                                "type": {"literal": "string"}}},
                                                                            "argument": {
                                                                              "lambda": {
                                                                                "parameter": "def",
                                                                                "domain": {"variable": "hydra.core.packaging.Definition"},
                                                                                "body": {
                                                                                  "application": {
                                                                                    "function": {"variable": "hydra.core.names.localNameOf"},
                                                                                    "argument": {
                                                                                      "application": {
                                                                                        "function": {
                                                                                          "cases": {
                                                                                            "typeName": "hydra.core.packaging.Definition",
                                                                                            "cases": [
                                                                                              {
                                                                                                "name": "type",
                                                                                                "handler": {
                                                                                                  "lambda": {
                                                                                                    "parameter": "td",
                                                                                                    "domain": {"variable": "hydra.core.packaging.TypeDefinition"},
                                                                                                    "body": {
                                                                                                      "application": {
                                                                                                        "function": {"project": {"typeName": "hydra.core.packaging.TypeDefinition", "fieldName": "name"}},
                                                                                                        "argument": {"variable": "td"}}}}}},
                                                                                              {
                                                                                                "name": "term",
                                                                                                "handler": {
                                                                                                  "lambda": {
                                                                                                    "parameter": "td",
                                                                                                    "domain": {"variable": "hydra.core.packaging.TermDefinition"},
                                                                                                    "body": {
                                                                                                      "application": {
                                                                                                        "function": {"project": {"typeName": "hydra.core.packaging.TermDefinition", "fieldName": "name"}},
                                                                                                        "argument": {"variable": "td"}}}}}},
                                                                                              {
                                                                                                "name": "primitive",
                                                                                                "handler": {
                                                                                                  "lambda": {
                                                                                                    "parameter": "pd",
                                                                                                    "domain": {"variable": "hydra.core.packaging.PrimitiveDefinition"},
                                                                                                    "body": {
                                                                                                      "application": {
                                                                                                        "function": {"project": {"typeName": "hydra.core.packaging.PrimitiveDefinition", "fieldName": "name"}},
                                                                                                        "argument": {"variable": "pd"}}}}}}]}},
                                                                                        "argument": {"variable": "def"}}}}}}}}},
                                                                        "argument": {"variable": "defs"}}}}},
                                                                "typeScheme": {"variables": [], "body": {"set": {"literal": "string"}}, "constraints": []}}],
                                                            "body": {
                                                              "let": {
                                                                "bindings": [
                                                                  {
                                                                    "name": "expanded",
                                                                    "term": {
                                                                      "application": {
                                                                        "function": {
                                                                          "application": {
                                                                            "function": {
                                                                              "typeApplication": {
                                                                                "body": {
                                                                                  "typeApplication": {"body": {"variable": "hydra.core.lib.lists.map"}, "type": {"variable": "hydra.core.packaging.Definition"}}},
                                                                                "type": {"variable": "hydra.core.packaging.Definition"}}},
                                                                            "argument": {
                                                                              "application": {
                                                                                "function": {
                                                                                  "application": {
                                                                                    "function": {
                                                                                      "application": {"function": {"variable": "hydra.core.parse.packaging.expandAliasesInDefinition"}, "argument": {"variable": "modName"}}},
                                                                                    "argument": {"variable": "ownNames"}}},
                                                                                "argument": {"variable": "aliases"}}}}},
                                                                        "argument": {"variable": "defs"}}},
                                                                    "typeScheme": {"variables": [], "body": {"list": {"variable": "hydra.core.packaging.Definition"}}, "constraints": []}}],
                                                                "body": {
                                                                  "let": {
                                                                    "bindings": [
                                                                      {
                                                                        "name": "env",
                                                                        "term": {
                                                                          "application": {"function": {"variable": "hydra.core.parse.packaging.typeEnvFromDefinitions"}, "argument": {"variable": "expanded"}}},
                                                                        "typeScheme": {
                                                                          "variables": [],
                                                                          "body": {"map": {"keys": {"variable": "hydra.core.model.Name"}, "values": {"variable": "hydra.core.model.Type"}}},
                                                                          "constraints": []}}],
                                                                    "body": {
                                                                      "record": {
                                                                        "typeName": "hydra.core.packaging.Module",
                                                                        "fields": [
                                                                          {"name": "name", "term": {"variable": "modName"}},
                                                                          {"name": "metadata", "term": {"variable": "mmeta"}},
                                                                          {
                                                                            "name": "dependencies",
                                                                            "term": {
                                                                              "application": {
                                                                                "function": {
                                                                                  "application": {
                                                                                    "function": {
                                                                                      "typeApplication": {
                                                                                        "body": {
                                                                                          "typeApplication": {
                                                                                            "body": {"variable": "hydra.core.lib.lists.map"},
                                                                                            "type": {
                                                                                              "pair": {"first": {"variable": "hydra.core.packaging.ModuleDependency"}, "second": {"optional": {"literal": "string"}}}}}},
                                                                                        "type": {"variable": "hydra.core.packaging.ModuleDependency"}}},
                                                                                    "argument": {
                                                                                      "lambda": {
                                                                                        "parameter": "p",
                                                                                        "domain": {
                                                                                          "pair": {"first": {"variable": "hydra.core.packaging.ModuleDependency"}, "second": {"optional": {"literal": "string"}}}},
                                                                                        "body": {
                                                                                          "application": {
                                                                                            "function": {
                                                                                              "typeApplication": {
                                                                                                "body": {
                                                                                                  "typeApplication": {"body": {"variable": "hydra.core.lib.pairs.first"}, "type": {"variable": "hydra.core.packaging.ModuleDependency"}}},
                                                                                                "type": {"optional": {"literal": "string"}}}},
                                                                                            "argument": {"variable": "p"}}}}}}},
                                                                                "argument": {"variable": "imports"}}}},
                                                                          {
                                                                            "name": "definitions",
                                                                            "term": {
                                                                              "application": {
                                                                                "function": {
                                                                                  "application": {
                                                                                    "function": {
                                                                                      "typeApplication": {
                                                                                        "body": {
                                                                                          "typeApplication": {"body": {"variable": "hydra.core.lib.lists.map"}, "type": {"variable": "hydra.core.packaging.Definition"}}},
                                                                                        "type": {"variable": "hydra.core.packaging.Definition"}}},
                                                                                    "argument": {
                                                                                      "application": {"function": {"variable": "hydra.core.parse.packaging.correctInjectionsInDefinition"}, "argument": {"variable": "env"}}}}},
                                                                                "argument": {"variable": "expanded"}}}}]}}}}}}}}}}}},
                                                "argument": {
                                                  "application": {
                                                    "function": {
                                                      "typeApplication": {"body": {"variable": "hydra.core.parsers.many"}, "type": {"variable": "hydra.core.packaging.Definition"}}},
                                                    "argument": {
                                                      "application": {"function": {"variable": "hydra.core.parse.packaging.definitionParser"}, "argument": {"variable": "modName"}}}}}}}}}}}}}}}}}}}}}}},
            "annotation": {
              "map": [
                {
                  "key": {"variable": "description"},
                  "value": {
                    "literal": {
                      "string": "Parse a complete module: ['##' doc comment] header, imports, then definitions. Aliased name references inside definition bodies (per syntax.md #6.3's 'import X as alias' convenience) are expanded to their fully-qualified form after parsing, using the alias table built from this module's own import declarations -- see 'expandAliasesInDefinition'. The module's own leading doc comment is captured as plain lines (via 'docCommentLines') BEFORE 'moduleHeader' runs -- unlike a definition's doc comment ('docCommentBlock'), which already has its enclosing module's name in scope to qualify provision names with, the module-level comment precedes the very 'module ...' line that introduces that name; the lines are captured first and only turned into an 'EntityMetadata' (via 'docCommentLinesToMetadata') once 'modName' is available. After alias expansion, the record/injection sugar ambiguity (#809) is corrected against a type env built from the (now fully-qualified) type definitions."}}}]}}}}},
    {
      "term": {
        "name": "hydra.core.parse.packaging.parseModule",
        "signature": {
          "typeParameters": [],
          "parameters": [{"name": "arg0", "type": {"literal": "string"}, "isLazy": false}],
          "result": {"type": {"either": {"left": {"literal": "string"}, "right": {"variable": "hydra.core.packaging.Module"}}}}},
        "body": {
          "annotated": {
            "body": {
              "lambda": {
                "parameter": "input",
                "domain": {"literal": "string"},
                "body": {
                  "application": {
                    "function": {
                      "typeApplication": {
                        "body": {
                          "cases": {
                            "typeName": "hydra.core.parsing.ParseResult",
                            "cases": [
                              {
                                "name": "success",
                                "handler": {
                                  "lambda": {
                                    "parameter": "s",
                                    "domain": {
                                      "application": {"function": {"variable": "hydra.core.parsing.ParseSuccess"}, "argument": {"variable": "hydra.core.packaging.Module"}}},
                                    "body": {
                                      "let": {
                                        "bindings": [
                                          {
                                            "name": "remainder",
                                            "term": {
                                              "application": {
                                                "function": {
                                                  "typeApplication": {
                                                    "body": {"project": {"typeName": "hydra.core.parsing.ParseSuccess", "fieldName": "remainder"}},
                                                    "type": {"variable": "hydra.core.packaging.Module"}}},
                                                "argument": {"variable": "s"}}},
                                            "typeScheme": {"variables": [], "body": {"variable": "hydra.core.parsing.ParseInput"}, "constraints": []}}],
                                        "body": {
                                          "application": {
                                            "function": {
                                              "application": {
                                                "function": {
                                                  "application": {
                                                    "function": {
                                                      "typeApplication": {
                                                        "body": {"variable": "hydra.core.lib.logic.ifElse"},
                                                        "type": {"either": {"left": {"literal": "string"}, "right": {"variable": "hydra.core.packaging.Module"}}}}},
                                                    "argument": {
                                                      "application": {
                                                        "function": {"typeApplication": {"body": {"variable": "hydra.core.lib.lists.isEmpty"}, "type": {"literal": {"integer": "int32"}}}},
                                                        "argument": {
                                                          "application": {
                                                            "function": {"project": {"typeName": "hydra.core.parsing.ParseInput", "fieldName": "codepoints"}},
                                                            "argument": {"variable": "remainder"}}}}}}},
                                                "argument": {
                                                  "typeApplication": {
                                                    "body": {
                                                      "typeApplication": {
                                                        "body": {
                                                          "either": {
                                                            "right": {
                                                              "application": {
                                                                "function": {
                                                                  "typeApplication": {
                                                                    "body": {"project": {"typeName": "hydra.core.parsing.ParseSuccess", "fieldName": "value"}},
                                                                    "type": {"variable": "hydra.core.packaging.Module"}}},
                                                                "argument": {"variable": "s"}}}}},
                                                        "type": {"literal": "string"}}},
                                                    "type": {"variable": "hydra.core.packaging.Module"}}}}},
                                            "argument": {
                                              "typeApplication": {
                                                "body": {
                                                  "typeApplication": {
                                                    "body": {
                                                      "either": {
                                                        "left": {
                                                          "application": {
                                                            "function": {
                                                              "application": {
                                                                "function": {
                                                                  "application": {"function": {"variable": "hydra.core.positions.formatParseFailure"}, "argument": {"variable": "input"}}},
                                                                "argument": {
                                                                  "application": {
                                                                    "function": {"project": {"typeName": "hydra.core.parsing.ParseInput", "fieldName": "offset"}},
                                                                    "argument": {"variable": "remainder"}}}}},
                                                            "argument": {"literal": {"string": "trailing input after module"}}}}}},
                                                    "type": {"literal": "string"}}},
                                                "type": {"variable": "hydra.core.packaging.Module"}}}}}}}}}},
                              {
                                "name": "failure",
                                "handler": {
                                  "lambda": {
                                    "parameter": "e",
                                    "domain": {"variable": "hydra.core.parsing.ParseError"},
                                    "body": {
                                      "typeApplication": {
                                        "body": {
                                          "typeApplication": {
                                            "body": {
                                              "either": {
                                                "left": {
                                                  "application": {
                                                    "function": {
                                                      "application": {
                                                        "function": {
                                                          "application": {"function": {"variable": "hydra.core.positions.formatParseFailure"}, "argument": {"variable": "input"}}},
                                                        "argument": {
                                                          "application": {
                                                            "function": {"project": {"typeName": "hydra.core.parsing.ParseInput", "fieldName": "offset"}},
                                                            "argument": {
                                                              "application": {
                                                                "function": {"project": {"typeName": "hydra.core.parsing.ParseError", "fieldName": "remainder"}},
                                                                "argument": {"variable": "e"}}}}}}},
                                                    "argument": {
                                                      "application": {
                                                        "function": {"project": {"typeName": "hydra.core.parsing.ParseError", "fieldName": "message"}},
                                                        "argument": {"variable": "e"}}}}}}},
                                            "type": {"literal": "string"}}},
                                        "type": {"variable": "hydra.core.packaging.Module"}}}}}}]}},
                        "type": {"variable": "hydra.core.packaging.Module"}}},
                    "argument": {
                      "application": {
                        "function": {
                          "application": {
                            "function": {
                              "typeApplication": {"body": {"variable": "hydra.core.parsers.runParser"}, "type": {"variable": "hydra.core.packaging.Module"}}},
                            "argument": {
                              "application": {
                                "function": {
                                  "application": {
                                    "function": {
                                      "typeApplication": {
                                        "body": {"typeApplication": {"body": {"variable": "hydra.core.parsers.bind"}, "type": "unit"}},
                                        "type": {"variable": "hydra.core.packaging.Module"}}},
                                    "argument": {"variable": "hydra.core.parse.packaging.whitespace"}}},
                                "argument": {"lambda": {"parameter": "_", "domain": "unit", "body": {"variable": "hydra.core.parse.packaging.moduleParser"}}}}}}},
                        "argument": {"variable": "input"}}}}}}},
            "annotation": {
              "map": [
                {
                  "key": {"variable": "description"},
                  "value": {"literal": {"string": "Parse a complete module from a string, requiring the parse to consume all input"}}}]}}}}},
    {
      "term": {
        "name": "hydra.core.parse.packaging.parseModuleWith",
        "signature": {
          "typeParameters": [],
          "parameters": [
            {
              "name": "arg0",
              "type": {
                "map": {"keys": {"variable": "hydra.core.packaging.ModuleName"}, "values": {"set": {"variable": "hydra.core.model.Name"}}}},
              "isLazy": false},
            {"name": "arg1", "type": {"set": {"variable": "hydra.core.model.Name"}}, "isLazy": false},
            {"name": "arg2", "type": {"literal": "string"}, "isLazy": false}],
          "result": {"type": {"either": {"left": {"literal": "string"}, "right": {"variable": "hydra.core.packaging.Module"}}}}},
        "body": {
          "annotated": {
            "body": {
              "lambda": {
                "parameter": "universe",
                "domain": {
                  "map": {"keys": {"variable": "hydra.core.packaging.ModuleName"}, "values": {"set": {"variable": "hydra.core.model.Name"}}}},
                "body": {
                  "lambda": {
                    "parameter": "unionTypeNames",
                    "domain": {"set": {"variable": "hydra.core.model.Name"}},
                    "body": {
                      "lambda": {
                        "parameter": "input",
                        "domain": {"literal": "string"},
                        "body": {
                          "application": {
                            "function": {
                              "application": {
                                "function": {
                                  "typeApplication": {
                                    "body": {
                                      "typeApplication": {
                                        "body": {"typeApplication": {"body": {"variable": "hydra.core.lib.eithers.bind"}, "type": {"literal": "string"}}},
                                        "type": {"variable": "hydra.core.packaging.Module"}}},
                                    "type": {"variable": "hydra.core.packaging.Module"}}},
                                "argument": {"application": {"function": {"variable": "hydra.core.parse.packaging.parseModule"}, "argument": {"variable": "input"}}}}},
                            "argument": {
                              "lambda": {
                                "parameter": "parsed",
                                "domain": {"variable": "hydra.core.packaging.Module"},
                                "body": {
                                  "let": {
                                    "bindings": [
                                      {
                                        "name": "modName",
                                        "term": {
                                          "application": {
                                            "function": {"project": {"typeName": "hydra.core.packaging.Module", "fieldName": "name"}},
                                            "argument": {"variable": "parsed"}}},
                                        "typeScheme": {"variables": [], "body": {"variable": "hydra.core.packaging.ModuleName"}, "constraints": []}}],
                                    "body": {
                                      "let": {
                                        "bindings": [
                                          {
                                            "name": "ownNames",
                                            "term": {
                                              "application": {
                                                "function": {"typeApplication": {"body": {"variable": "hydra.core.lib.sets.fromList"}, "type": {"literal": "string"}}},
                                                "argument": {
                                                  "application": {
                                                    "function": {
                                                      "application": {
                                                        "function": {
                                                          "typeApplication": {
                                                            "body": {
                                                              "typeApplication": {"body": {"variable": "hydra.core.lib.lists.map"}, "type": {"variable": "hydra.core.packaging.Definition"}}},
                                                            "type": {"literal": "string"}}},
                                                        "argument": {
                                                          "lambda": {
                                                            "parameter": "def",
                                                            "domain": {"variable": "hydra.core.packaging.Definition"},
                                                            "body": {
                                                              "application": {
                                                                "function": {"variable": "hydra.core.names.localNameOf"},
                                                                "argument": {
                                                                  "application": {
                                                                    "function": {
                                                                      "cases": {
                                                                        "typeName": "hydra.core.packaging.Definition",
                                                                        "cases": [
                                                                          {
                                                                            "name": "type",
                                                                            "handler": {
                                                                              "lambda": {
                                                                                "parameter": "td",
                                                                                "domain": {"variable": "hydra.core.packaging.TypeDefinition"},
                                                                                "body": {
                                                                                  "application": {
                                                                                    "function": {"project": {"typeName": "hydra.core.packaging.TypeDefinition", "fieldName": "name"}},
                                                                                    "argument": {"variable": "td"}}}}}},
                                                                          {
                                                                            "name": "term",
                                                                            "handler": {
                                                                              "lambda": {
                                                                                "parameter": "td",
                                                                                "domain": {"variable": "hydra.core.packaging.TermDefinition"},
                                                                                "body": {
                                                                                  "application": {
                                                                                    "function": {"project": {"typeName": "hydra.core.packaging.TermDefinition", "fieldName": "name"}},
                                                                                    "argument": {"variable": "td"}}}}}},
                                                                          {
                                                                            "name": "primitive",
                                                                            "handler": {
                                                                              "lambda": {
                                                                                "parameter": "pd",
                                                                                "domain": {"variable": "hydra.core.packaging.PrimitiveDefinition"},
                                                                                "body": {
                                                                                  "application": {
                                                                                    "function": {"project": {"typeName": "hydra.core.packaging.PrimitiveDefinition", "fieldName": "name"}},
                                                                                    "argument": {"variable": "pd"}}}}}}]}},
                                                                    "argument": {"variable": "def"}}}}}}}}},
                                                    "argument": {
                                                      "application": {
                                                        "function": {"project": {"typeName": "hydra.core.packaging.Module", "fieldName": "definitions"}},
                                                        "argument": {"variable": "parsed"}}}}}}},
                                            "typeScheme": {"variables": [], "body": {"set": {"literal": "string"}}, "constraints": []}}],
                                        "body": {
                                          "let": {
                                            "bindings": [
                                              {
                                                "name": "declaredImportModNames",
                                                "term": {
                                                  "application": {
                                                    "function": {
                                                      "application": {
                                                        "function": {
                                                          "typeApplication": {
                                                            "body": {
                                                              "typeApplication": {"body": {"variable": "hydra.core.lib.lists.map"}, "type": {"variable": "hydra.core.packaging.ModuleDependency"}}},
                                                            "type": {"variable": "hydra.core.packaging.ModuleName"}}},
                                                        "argument": {
                                                          "lambda": {
                                                            "parameter": "d",
                                                            "domain": {"variable": "hydra.core.packaging.ModuleDependency"},
                                                            "body": {
                                                              "application": {
                                                                "function": {"project": {"typeName": "hydra.core.packaging.ModuleDependency", "fieldName": "module"}},
                                                                "argument": {"variable": "d"}}}}}}},
                                                    "argument": {
                                                      "application": {
                                                        "function": {"project": {"typeName": "hydra.core.packaging.Module", "fieldName": "dependencies"}},
                                                        "argument": {"variable": "parsed"}}}}},
                                                "typeScheme": {"variables": [], "body": {"list": {"variable": "hydra.core.packaging.ModuleName"}}, "constraints": []}}],
                                            "body": {
                                              "let": {
                                                "bindings": [
                                                  {
                                                    "name": "scopedUniverse",
                                                    "term": {
                                                      "application": {
                                                        "function": {
                                                          "typeApplication": {
                                                            "body": {
                                                              "typeApplication": {"body": {"variable": "hydra.core.lib.maps.fromList"}, "type": {"variable": "hydra.core.packaging.ModuleName"}}},
                                                            "type": {"set": {"variable": "hydra.core.model.Name"}}}},
                                                        "argument": {
                                                          "application": {
                                                            "function": {
                                                              "typeApplication": {
                                                                "body": {"variable": "hydra.core.lib.optionals.givens"},
                                                                "type": {
                                                                  "pair": {"first": {"variable": "hydra.core.packaging.ModuleName"}, "second": {"set": {"variable": "hydra.core.model.Name"}}}}}},
                                                            "argument": {
                                                              "application": {
                                                                "function": {
                                                                  "application": {
                                                                    "function": {
                                                                      "typeApplication": {
                                                                        "body": {
                                                                          "typeApplication": {"body": {"variable": "hydra.core.lib.lists.map"}, "type": {"variable": "hydra.core.packaging.ModuleName"}}},
                                                                        "type": {
                                                                          "optional": {
                                                                            "pair": {"first": {"variable": "hydra.core.packaging.ModuleName"}, "second": {"set": {"variable": "hydra.core.model.Name"}}}}}}},
                                                                    "argument": {
                                                                      "lambda": {
                                                                        "parameter": "nm",
                                                                        "domain": {"variable": "hydra.core.packaging.ModuleName"},
                                                                        "body": {
                                                                          "application": {
                                                                            "function": {
                                                                              "application": {
                                                                                "function": {
                                                                                  "typeApplication": {
                                                                                    "body": {
                                                                                      "typeApplication": {"body": {"variable": "hydra.core.lib.optionals.map"}, "type": {"set": {"variable": "hydra.core.model.Name"}}}},
                                                                                    "type": {
                                                                                      "pair": {"first": {"variable": "hydra.core.packaging.ModuleName"}, "second": {"set": {"variable": "hydra.core.model.Name"}}}}}},
                                                                                "argument": {
                                                                                  "lambda": {
                                                                                    "parameter": "declared",
                                                                                    "domain": {"set": {"variable": "hydra.core.model.Name"}},
                                                                                    "body": {
                                                                                      "typeApplication": {
                                                                                        "body": {
                                                                                          "typeApplication": {
                                                                                            "body": {"pair": {"first": {"variable": "nm"}, "second": {"variable": "declared"}}},
                                                                                            "type": {"variable": "hydra.core.packaging.ModuleName"}}},
                                                                                        "type": {"set": {"variable": "hydra.core.model.Name"}}}}}}}},
                                                                            "argument": {
                                                                              "application": {
                                                                                "function": {
                                                                                  "application": {
                                                                                    "function": {
                                                                                      "typeApplication": {
                                                                                        "body": {
                                                                                          "typeApplication": {"body": {"variable": "hydra.core.lib.maps.lookup"}, "type": {"variable": "hydra.core.packaging.ModuleName"}}},
                                                                                        "type": {"set": {"variable": "hydra.core.model.Name"}}}},
                                                                                    "argument": {"variable": "nm"}}},
                                                                                "argument": {"variable": "universe"}}}}}}}}},
                                                                "argument": {"variable": "declaredImportModNames"}}}}}}},
                                                    "typeScheme": {
                                                      "variables": [],
                                                      "body": {
                                                        "map": {"keys": {"variable": "hydra.core.packaging.ModuleName"}, "values": {"set": {"variable": "hydra.core.model.Name"}}}},
                                                      "constraints": []}}],
                                                "body": {
                                                  "application": {
                                                    "function": {
                                                      "application": {
                                                        "function": {
                                                          "typeApplication": {
                                                            "body": {
                                                              "typeApplication": {
                                                                "body": {"typeApplication": {"body": {"variable": "hydra.core.lib.eithers.bind"}, "type": {"literal": "string"}}},
                                                                "type": {"list": {"variable": "hydra.core.packaging.Definition"}}}},
                                                            "type": {"variable": "hydra.core.packaging.Module"}}},
                                                        "argument": {
                                                          "application": {
                                                            "function": {
                                                              "application": {
                                                                "function": {
                                                                  "typeApplication": {
                                                                    "body": {
                                                                      "typeApplication": {
                                                                        "body": {
                                                                          "typeApplication": {"body": {"variable": "hydra.core.lib.eithers.mapList"}, "type": {"variable": "hydra.core.packaging.Definition"}}},
                                                                        "type": {"variable": "hydra.core.packaging.Definition"}}},
                                                                    "type": {"literal": "string"}}},
                                                                "argument": {
                                                                  "application": {
                                                                    "function": {
                                                                      "application": {
                                                                        "function": {
                                                                          "application": {
                                                                            "function": {"variable": "hydra.core.parse.packaging.resolveNameRefsInDefinitionWith"},
                                                                            "argument": {"variable": "modName"}}},
                                                                        "argument": {"variable": "ownNames"}}},
                                                                    "argument": {"variable": "scopedUniverse"}}}}},
                                                            "argument": {
                                                              "application": {
                                                                "function": {"project": {"typeName": "hydra.core.packaging.Module", "fieldName": "definitions"}},
                                                                "argument": {"variable": "parsed"}}}}}}},
                                                    "argument": {
                                                      "lambda": {
                                                        "parameter": "rdefs",
                                                        "domain": {"list": {"variable": "hydra.core.packaging.Definition"}},
                                                        "body": {
                                                          "let": {
                                                            "bindings": [
                                                              {
                                                                "name": "cdefs",
                                                                "term": {
                                                                  "application": {
                                                                    "function": {
                                                                      "application": {
                                                                        "function": {
                                                                          "typeApplication": {
                                                                            "body": {
                                                                              "typeApplication": {"body": {"variable": "hydra.core.lib.lists.map"}, "type": {"variable": "hydra.core.packaging.Definition"}}},
                                                                            "type": {"variable": "hydra.core.packaging.Definition"}}},
                                                                        "argument": {
                                                                          "application": {
                                                                            "function": {"variable": "hydra.core.parse.packaging.correctCrossModuleInjectionsInDefinition"},
                                                                            "argument": {"variable": "unionTypeNames"}}}}},
                                                                    "argument": {"variable": "rdefs"}}},
                                                                "typeScheme": {"variables": [], "body": {"list": {"variable": "hydra.core.packaging.Definition"}}, "constraints": []}}],
                                                            "body": {
                                                              "typeApplication": {
                                                                "body": {
                                                                  "typeApplication": {
                                                                    "body": {
                                                                      "either": {
                                                                        "right": {
                                                                          "record": {
                                                                            "typeName": "hydra.core.packaging.Module",
                                                                            "fields": [
                                                                              {"name": "name", "term": {"variable": "modName"}},
                                                                              {
                                                                                "name": "metadata",
                                                                                "term": {
                                                                                  "application": {
                                                                                    "function": {"project": {"typeName": "hydra.core.packaging.Module", "fieldName": "metadata"}},
                                                                                    "argument": {"variable": "parsed"}}}},
                                                                              {
                                                                                "name": "dependencies",
                                                                                "term": {
                                                                                  "application": {
                                                                                    "function": {"project": {"typeName": "hydra.core.packaging.Module", "fieldName": "dependencies"}},
                                                                                    "argument": {"variable": "parsed"}}}},
                                                                              {"name": "definitions", "term": {"variable": "cdefs"}}]}}}},
                                                                    "type": {"literal": "string"}}},
                                                                "type": {"variable": "hydra.core.packaging.Module"}}}}}}}}}}}}}}}}}}}}}}}}}}},
            "annotation": {
              "map": [
                {
                  "key": {"variable": "description"},
                  "value": {
                    "literal": {
                      "string": "Parse a complete module from a string, resolving bare name references and cross-module union injections against the universe (#5/#711/#837)"}}}]}}}}},
    {
      "term": {
        "name": "hydra.core.parse.packaging.parseModules",
        "signature": {
          "typeParameters": [],
          "parameters": [
            {"name": "arg0", "type": {"list": {"variable": "hydra.core.packaging.Module"}}, "isLazy": false},
            {
              "name": "arg1",
              "type": {"list": {"pair": {"first": {"literal": "string"}, "second": {"literal": "string"}}}},
              "isLazy": false}],
          "result": {"type": {"either": {"left": {"literal": "string"}, "right": {"list": {"variable": "hydra.core.packaging.Module"}}}}}},
        "body": {
          "annotated": {
            "body": {
              "lambda": {
                "parameter": "depModules",
                "domain": {"list": {"variable": "hydra.core.packaging.Module"}},
                "body": {
                  "lambda": {
                    "parameter": "sources",
                    "domain": {"list": {"pair": {"first": {"literal": "string"}, "second": {"literal": "string"}}}},
                    "body": {
                      "let": {
                        "bindings": [
                          {
                            "name": "parseOne",
                            "term": {
                              "lambda": {
                                "parameter": "pathText",
                                "domain": {"pair": {"first": {"literal": "string"}, "second": {"literal": "string"}}},
                                "body": {
                                  "let": {
                                    "bindings": [
                                      {
                                        "name": "path",
                                        "term": {
                                          "application": {
                                            "function": {
                                              "typeApplication": {
                                                "body": {"typeApplication": {"body": {"variable": "hydra.core.lib.pairs.first"}, "type": {"literal": "string"}}},
                                                "type": {"literal": "string"}}},
                                            "argument": {"variable": "pathText"}}},
                                        "typeScheme": {"variables": [], "body": {"literal": "string"}, "constraints": []}}],
                                    "body": {
                                      "let": {
                                        "bindings": [
                                          {
                                            "name": "text",
                                            "term": {
                                              "application": {
                                                "function": {
                                                  "typeApplication": {
                                                    "body": {"typeApplication": {"body": {"variable": "hydra.core.lib.pairs.second"}, "type": {"literal": "string"}}},
                                                    "type": {"literal": "string"}}},
                                                "argument": {"variable": "pathText"}}},
                                            "typeScheme": {"variables": [], "body": {"literal": "string"}, "constraints": []}}],
                                        "body": {
                                          "application": {
                                            "function": {
                                              "application": {
                                                "function": {
                                                  "application": {
                                                    "function": {
                                                      "typeApplication": {
                                                        "body": {
                                                          "typeApplication": {
                                                            "body": {
                                                              "typeApplication": {
                                                                "body": {"typeApplication": {"body": {"variable": "hydra.core.lib.eithers.bimap"}, "type": {"literal": "string"}}},
                                                                "type": {"variable": "hydra.core.packaging.Module"}}},
                                                            "type": {"literal": "string"}}},
                                                        "type": {"variable": "hydra.core.packaging.Module"}}},
                                                    "argument": {
                                                      "lambda": {
                                                        "parameter": "e",
                                                        "domain": {"literal": "string"},
                                                        "body": {
                                                          "application": {
                                                            "function": {"variable": "hydra.core.lib.strings.concat"},
                                                            "argument": {"list": [{"variable": "path"}, {"literal": {"string": ": "}}, {"variable": "e"}]}}}}}}},
                                                "argument": {"lambda": {"parameter": "m", "domain": {"variable": "hydra.core.packaging.Module"}, "body": {"variable": "m"}}}}},
                                            "argument": {"application": {"function": {"variable": "hydra.core.parse.packaging.parseModule"}, "argument": {"variable": "text"}}}}}}}}}}},
                            "typeScheme": {
                              "variables": [],
                              "body": {
                                "function": {
                                  "domain": {"pair": {"first": {"literal": "string"}, "second": {"literal": "string"}}},
                                  "codomain": {"either": {"left": {"literal": "string"}, "right": {"variable": "hydra.core.packaging.Module"}}}}},
                              "constraints": []}}],
                        "body": {
                          "application": {
                            "function": {
                              "application": {
                                "function": {
                                  "typeApplication": {
                                    "body": {
                                      "typeApplication": {
                                        "body": {"typeApplication": {"body": {"variable": "hydra.core.lib.eithers.bind"}, "type": {"literal": "string"}}},
                                        "type": {"list": {"variable": "hydra.core.packaging.Module"}}}},
                                    "type": {"list": {"variable": "hydra.core.packaging.Module"}}}},
                                "argument": {
                                  "application": {
                                    "function": {
                                      "application": {
                                        "function": {
                                          "typeApplication": {
                                            "body": {
                                              "typeApplication": {
                                                "body": {
                                                  "typeApplication": {
                                                    "body": {"variable": "hydra.core.lib.eithers.mapList"},
                                                    "type": {"pair": {"first": {"literal": "string"}, "second": {"literal": "string"}}}}},
                                                "type": {"variable": "hydra.core.packaging.Module"}}},
                                            "type": {"literal": "string"}}},
                                        "argument": {"variable": "parseOne"}}},
                                    "argument": {"variable": "sources"}}}}},
                            "argument": {
                              "lambda": {
                                "parameter": "pass1",
                                "domain": {"list": {"variable": "hydra.core.packaging.Module"}},
                                "body": {
                                  "let": {
                                    "bindings": [
                                      {
                                        "name": "pathsAndMods",
                                        "term": {
                                          "application": {
                                            "function": {
                                              "application": {
                                                "function": {
                                                  "typeApplication": {
                                                    "body": {"typeApplication": {"body": {"variable": "hydra.core.lib.lists.zip"}, "type": {"literal": "string"}}},
                                                    "type": {"variable": "hydra.core.packaging.Module"}}},
                                                "argument": {
                                                  "application": {
                                                    "function": {
                                                      "application": {
                                                        "function": {
                                                          "typeApplication": {
                                                            "body": {
                                                              "typeApplication": {
                                                                "body": {"variable": "hydra.core.lib.lists.map"},
                                                                "type": {"pair": {"first": {"literal": "string"}, "second": {"literal": "string"}}}}},
                                                            "type": {"literal": "string"}}},
                                                        "argument": {
                                                          "lambda": {
                                                            "parameter": "p",
                                                            "domain": {"pair": {"first": {"literal": "string"}, "second": {"literal": "string"}}},
                                                            "body": {
                                                              "application": {
                                                                "function": {
                                                                  "typeApplication": {
                                                                    "body": {"typeApplication": {"body": {"variable": "hydra.core.lib.pairs.first"}, "type": {"literal": "string"}}},
                                                                    "type": {"literal": "string"}}},
                                                                "argument": {"variable": "p"}}}}}}},
                                                    "argument": {"variable": "sources"}}}}},
                                            "argument": {"variable": "pass1"}}},
                                        "typeScheme": {
                                          "variables": [],
                                          "body": {"list": {"pair": {"first": {"literal": "string"}, "second": {"variable": "hydra.core.packaging.Module"}}}},
                                          "constraints": []}}],
                                    "body": {
                                      "let": {
                                        "bindings": [
                                          {
                                            "name": "depNames",
                                            "term": {
                                              "application": {
                                                "function": {
                                                  "typeApplication": {"body": {"variable": "hydra.core.lib.sets.fromList"}, "type": {"variable": "hydra.core.packaging.ModuleName"}}},
                                                "argument": {
                                                  "application": {
                                                    "function": {
                                                      "application": {
                                                        "function": {
                                                          "typeApplication": {
                                                            "body": {
                                                              "typeApplication": {"body": {"variable": "hydra.core.lib.lists.map"}, "type": {"variable": "hydra.core.packaging.Module"}}},
                                                            "type": {"variable": "hydra.core.packaging.ModuleName"}}},
                                                        "argument": {
                                                          "lambda": {
                                                            "parameter": "mod",
                                                            "domain": {"variable": "hydra.core.packaging.Module"},
                                                            "body": {
                                                              "application": {
                                                                "function": {"project": {"typeName": "hydra.core.packaging.Module", "fieldName": "name"}},
                                                                "argument": {"variable": "mod"}}}}}}},
                                                    "argument": {"variable": "depModules"}}}}},
                                            "typeScheme": {"variables": [], "body": {"set": {"variable": "hydra.core.packaging.ModuleName"}}, "constraints": []}}],
                                        "body": {
                                          "let": {
                                            "bindings": [
                                              {
                                                "name": "dupError",
                                                "term": {
                                                  "application": {
                                                    "function": {
                                                      "typeApplication": {
                                                        "body": {
                                                          "typeApplication": {"body": {"variable": "hydra.core.lib.pairs.second"}, "type": {"set": {"variable": "hydra.core.packaging.ModuleName"}}}},
                                                        "type": {"optional": {"literal": "string"}}}},
                                                    "argument": {
                                                      "application": {
                                                        "function": {
                                                          "application": {
                                                            "function": {
                                                              "application": {
                                                                "function": {
                                                                  "typeApplication": {
                                                                    "body": {
                                                                      "typeApplication": {
                                                                        "body": {"variable": "hydra.core.lib.lists.foldl"},
                                                                        "type": {
                                                                          "pair": {"first": {"set": {"variable": "hydra.core.packaging.ModuleName"}}, "second": {"optional": {"literal": "string"}}}}}},
                                                                    "type": {"pair": {"first": {"literal": "string"}, "second": {"variable": "hydra.core.packaging.Module"}}}}},
                                                                "argument": {
                                                                  "lambda": {
                                                                    "parameter": "acc",
                                                                    "domain": {
                                                                      "pair": {"first": {"set": {"variable": "hydra.core.packaging.ModuleName"}}, "second": {"optional": {"literal": "string"}}}},
                                                                    "body": {
                                                                      "lambda": {
                                                                        "parameter": "pathMod",
                                                                        "domain": {"pair": {"first": {"literal": "string"}, "second": {"variable": "hydra.core.packaging.Module"}}},
                                                                        "body": {
                                                                          "application": {
                                                                            "function": {
                                                                              "application": {
                                                                                "function": {
                                                                                  "application": {
                                                                                    "function": {
                                                                                      "typeApplication": {
                                                                                        "body": {"typeApplication": {"body": {"variable": "hydra.core.lib.optionals.match"}, "type": {"literal": "string"}}},
                                                                                        "type": {
                                                                                          "pair": {"first": {"set": {"variable": "hydra.core.packaging.ModuleName"}}, "second": {"optional": {"literal": "string"}}}}}},
                                                                                    "argument": {
                                                                                      "application": {
                                                                                        "function": {
                                                                                          "typeApplication": {
                                                                                            "body": {
                                                                                              "typeApplication": {"body": {"variable": "hydra.core.lib.pairs.second"}, "type": {"set": {"variable": "hydra.core.packaging.ModuleName"}}}},
                                                                                            "type": {"optional": {"literal": "string"}}}},
                                                                                        "argument": {"variable": "acc"}}}}},
                                                                                "argument": {
                                                                                  "let": {
                                                                                    "bindings": [
                                                                                      {
                                                                                        "name": "seen",
                                                                                        "term": {
                                                                                          "application": {
                                                                                            "function": {
                                                                                              "typeApplication": {
                                                                                                "body": {
                                                                                                  "typeApplication": {"body": {"variable": "hydra.core.lib.pairs.first"}, "type": {"set": {"variable": "hydra.core.packaging.ModuleName"}}}},
                                                                                                "type": {"optional": {"literal": "string"}}}},
                                                                                            "argument": {"variable": "acc"}}},
                                                                                        "typeScheme": {"variables": [], "body": {"set": {"variable": "hydra.core.packaging.ModuleName"}}, "constraints": []}}],
                                                                                    "body": {
                                                                                      "let": {
                                                                                        "bindings": [
                                                                                          {
                                                                                            "name": "path",
                                                                                            "term": {
                                                                                              "application": {
                                                                                                "function": {
                                                                                                  "typeApplication": {
                                                                                                    "body": {"typeApplication": {"body": {"variable": "hydra.core.lib.pairs.first"}, "type": {"literal": "string"}}},
                                                                                                    "type": {"variable": "hydra.core.packaging.Module"}}},
                                                                                                "argument": {"variable": "pathMod"}}},
                                                                                            "typeScheme": {"variables": [], "body": {"literal": "string"}, "constraints": []}}],
                                                                                        "body": {
                                                                                          "let": {
                                                                                            "bindings": [
                                                                                              {
                                                                                                "name": "nm",
                                                                                                "term": {
                                                                                                  "application": {
                                                                                                    "function": {"project": {"typeName": "hydra.core.packaging.Module", "fieldName": "name"}},
                                                                                                    "argument": {
                                                                                                      "application": {
                                                                                                        "function": {
                                                                                                          "typeApplication": {
                                                                                                            "body": {"typeApplication": {"body": {"variable": "hydra.core.lib.pairs.second"}, "type": {"literal": "string"}}},
                                                                                                            "type": {"variable": "hydra.core.packaging.Module"}}},
                                                                                                        "argument": {"variable": "pathMod"}}}}},
                                                                                                "typeScheme": {"variables": [], "body": {"variable": "hydra.core.packaging.ModuleName"}, "constraints": []}}],
                                                                                            "body": {
                                                                                              "application": {
                                                                                                "function": {
                                                                                                  "application": {
                                                                                                    "function": {
                                                                                                      "application": {
                                                                                                        "function": {
                                                                                                          "typeApplication": {
                                                                                                            "body": {"variable": "hydra.core.lib.logic.ifElse"},
                                                                                                            "type": {
                                                                                                              "pair": {"first": {"set": {"variable": "hydra.core.packaging.ModuleName"}}, "second": {"optional": {"literal": "string"}}}}}},
                                                                                                        "argument": {
                                                                                                          "application": {
                                                                                                            "function": {
                                                                                                              "application": {
                                                                                                                "function": {"variable": "hydra.core.lib.logic.or"},
                                                                                                                "argument": {
                                                                                                                  "application": {
                                                                                                                    "function": {
                                                                                                                      "application": {
                                                                                                                        "function": {
                                                                                                                          "typeApplication": {"body": {"variable": "hydra.core.lib.sets.member"}, "type": {"variable": "hydra.core.packaging.ModuleName"}}},
                                                                                                                        "argument": {"variable": "nm"}}},
                                                                                                                    "argument": {"variable": "depNames"}}}}},
                                                                                                            "argument": {
                                                                                                              "application": {
                                                                                                                "function": {
                                                                                                                  "application": {
                                                                                                                    "function": {
                                                                                                                      "typeApplication": {"body": {"variable": "hydra.core.lib.sets.member"}, "type": {"variable": "hydra.core.packaging.ModuleName"}}},
                                                                                                                    "argument": {"variable": "nm"}}},
                                                                                                                "argument": {"variable": "seen"}}}}}}},
                                                                                                    "argument": {
                                                                                                      "typeApplication": {
                                                                                                        "body": {
                                                                                                          "typeApplication": {
                                                                                                            "body": {
                                                                                                              "pair": {
                                                                                                                "first": {"variable": "seen"},
                                                                                                                "second": {
                                                                                                                  "optional": {
                                                                                                                    "application": {
                                                                                                                      "function": {"variable": "hydra.core.lib.strings.concat"},
                                                                                                                      "argument": {
                                                                                                                        "list": [
                                                                                                                          {"variable": "path"},
                                                                                                                          {"literal": {"string": ": duplicate module name across inputs (or clashing with a dependency module): "}},
                                                                                                                          {"application": {"function": {"unwrap": "hydra.core.packaging.ModuleName"}, "argument": {"variable": "nm"}}}]}}}}}},
                                                                                                            "type": {"set": {"variable": "hydra.core.packaging.ModuleName"}}}},
                                                                                                        "type": {"optional": {"literal": "string"}}}}}},
                                                                                                "argument": {
                                                                                                  "typeApplication": {
                                                                                                    "body": {
                                                                                                      "typeApplication": {
                                                                                                        "body": {
                                                                                                          "pair": {
                                                                                                            "first": {
                                                                                                              "application": {
                                                                                                                "function": {
                                                                                                                  "application": {
                                                                                                                    "function": {
                                                                                                                      "typeApplication": {"body": {"variable": "hydra.core.lib.sets.insert"}, "type": {"variable": "hydra.core.packaging.ModuleName"}}},
                                                                                                                    "argument": {"variable": "nm"}}},
                                                                                                                "argument": {"variable": "seen"}}},
                                                                                                            "second": {"typeApplication": {"body": {"optional": null}, "type": {"literal": "string"}}}}},
                                                                                                        "type": {"set": {"variable": "hydra.core.packaging.ModuleName"}}}},
                                                                                                    "type": {"optional": {"literal": "string"}}}}}}}}}}}}}},
                                                                            "argument": {"lambda": {"parameter": "_", "domain": {"literal": "string"}, "body": {"variable": "acc"}}}}}}}}}}},
                                                            "argument": {
                                                              "typeApplication": {
                                                                "body": {
                                                                  "typeApplication": {
                                                                    "body": {
                                                                      "pair": {
                                                                        "first": {
                                                                          "typeApplication": {"body": {"variable": "hydra.core.lib.sets.empty"}, "type": {"variable": "hydra.core.packaging.ModuleName"}}},
                                                                        "second": {"typeApplication": {"body": {"optional": null}, "type": {"literal": "string"}}}}},
                                                                    "type": {"set": {"variable": "hydra.core.packaging.ModuleName"}}}},
                                                                "type": {"optional": {"literal": "string"}}}}}},
                                                        "argument": {"variable": "pathsAndMods"}}}}},
                                                "typeScheme": {"variables": [], "body": {"optional": {"literal": "string"}}, "constraints": []}}],
                                            "body": {
                                              "application": {
                                                "function": {
                                                  "application": {
                                                    "function": {
                                                      "application": {
                                                        "function": {
                                                          "typeApplication": {
                                                            "body": {"typeApplication": {"body": {"variable": "hydra.core.lib.optionals.match"}, "type": {"literal": "string"}}},
                                                            "type": {"either": {"left": {"literal": "string"}, "right": {"list": {"variable": "hydra.core.packaging.Module"}}}}}},
                                                        "argument": {"variable": "dupError"}}},
                                                    "argument": {
                                                      "let": {
                                                        "bindings": [
                                                          {
                                                            "name": "allMods",
                                                            "term": {
                                                              "application": {
                                                                "function": {
                                                                  "application": {
                                                                    "function": {
                                                                      "typeApplication": {"body": {"variable": "hydra.core.lib.lists.concat2"}, "type": {"variable": "hydra.core.packaging.Module"}}},
                                                                    "argument": {"variable": "depModules"}}},
                                                                "argument": {"variable": "pass1"}}},
                                                            "typeScheme": {"variables": [], "body": {"list": {"variable": "hydra.core.packaging.Module"}}, "constraints": []}}],
                                                        "body": {
                                                          "let": {
                                                            "bindings": [
                                                              {
                                                                "name": "universe",
                                                                "term": {
                                                                  "application": {"function": {"variable": "hydra.core.parse.packaging.universeNamesOf"}, "argument": {"variable": "allMods"}}},
                                                                "typeScheme": {
                                                                  "variables": [],
                                                                  "body": {
                                                                    "map": {"keys": {"variable": "hydra.core.packaging.ModuleName"}, "values": {"set": {"variable": "hydra.core.model.Name"}}}},
                                                                  "constraints": []}}],
                                                            "body": {
                                                              "let": {
                                                                "bindings": [
                                                                  {
                                                                    "name": "unionNames",
                                                                    "term": {
                                                                      "application": {"function": {"variable": "hydra.core.parse.packaging.unionTypeNamesOf"}, "argument": {"variable": "allMods"}}},
                                                                    "typeScheme": {"variables": [], "body": {"set": {"variable": "hydra.core.model.Name"}}, "constraints": []}}],
                                                                "body": {
                                                                  "application": {
                                                                    "function": {
                                                                      "application": {
                                                                        "function": {
                                                                          "typeApplication": {
                                                                            "body": {
                                                                              "typeApplication": {
                                                                                "body": {
                                                                                  "typeApplication": {
                                                                                    "body": {"variable": "hydra.core.lib.eithers.mapList"},
                                                                                    "type": {"pair": {"first": {"literal": "string"}, "second": {"literal": "string"}}}}},
                                                                                "type": {"variable": "hydra.core.packaging.Module"}}},
                                                                            "type": {"literal": "string"}}},
                                                                        "argument": {
                                                                          "lambda": {
                                                                            "parameter": "pathText",
                                                                            "domain": {"pair": {"first": {"literal": "string"}, "second": {"literal": "string"}}},
                                                                            "body": {
                                                                              "application": {
                                                                                "function": {
                                                                                  "application": {
                                                                                    "function": {
                                                                                      "application": {
                                                                                        "function": {
                                                                                          "typeApplication": {
                                                                                            "body": {
                                                                                              "typeApplication": {
                                                                                                "body": {
                                                                                                  "typeApplication": {
                                                                                                    "body": {"typeApplication": {"body": {"variable": "hydra.core.lib.eithers.bimap"}, "type": {"literal": "string"}}},
                                                                                                    "type": {"variable": "hydra.core.packaging.Module"}}},
                                                                                                "type": {"literal": "string"}}},
                                                                                            "type": {"variable": "hydra.core.packaging.Module"}}},
                                                                                        "argument": {
                                                                                          "lambda": {
                                                                                            "parameter": "e",
                                                                                            "domain": {"literal": "string"},
                                                                                            "body": {
                                                                                              "application": {
                                                                                                "function": {"variable": "hydra.core.lib.strings.concat"},
                                                                                                "argument": {
                                                                                                  "list": [
                                                                                                    {
                                                                                                      "application": {
                                                                                                        "function": {
                                                                                                          "typeApplication": {
                                                                                                            "body": {"typeApplication": {"body": {"variable": "hydra.core.lib.pairs.first"}, "type": {"literal": "string"}}},
                                                                                                            "type": {"literal": "string"}}},
                                                                                                        "argument": {"variable": "pathText"}}},
                                                                                                    {"literal": {"string": ": "}},
                                                                                                    {"variable": "e"}]}}}}}}},
                                                                                    "argument": {"lambda": {"parameter": "m", "domain": {"variable": "hydra.core.packaging.Module"}, "body": {"variable": "m"}}}}},
                                                                                "argument": {
                                                                                  "application": {
                                                                                    "function": {
                                                                                      "application": {
                                                                                        "function": {
                                                                                          "application": {"function": {"variable": "hydra.core.parse.packaging.parseModuleWith"}, "argument": {"variable": "universe"}}},
                                                                                        "argument": {"variable": "unionNames"}}},
                                                                                    "argument": {
                                                                                      "application": {
                                                                                        "function": {
                                                                                          "typeApplication": {
                                                                                            "body": {"typeApplication": {"body": {"variable": "hydra.core.lib.pairs.second"}, "type": {"literal": "string"}}},
                                                                                            "type": {"literal": "string"}}},
                                                                                        "argument": {"variable": "pathText"}}}}}}}}}}},
                                                                    "argument": {"variable": "sources"}}}}}}}}}}},
                                                "argument": {
                                                  "lambda": {
                                                    "parameter": "err",
                                                    "domain": {"literal": "string"},
                                                    "body": {
                                                      "typeApplication": {
                                                        "body": {"typeApplication": {"body": {"either": {"left": {"variable": "err"}}}, "type": {"literal": "string"}}},
                                                        "type": {"list": {"variable": "hydra.core.packaging.Module"}}}}}}}}}}}}}}}}}}}}}}}},
            "annotation": {
              "map": [
                {
                  "key": {"variable": "description"},
                  "value": {
                    "literal": {
                      "string": "Parse several '.hydra' sources (path, text) that may reference each other and the given dependency modules (#842)"}}}]}}}}},
    {
      "term": {
        "name": "hydra.core.parse.packaging.parseParamLine",
        "signature": {
          "typeParameters": [],
          "parameters": [{"name": "arg0", "type": {"literal": "string"}, "isLazy": false}],
          "result": {"type": {"optional": {"pair": {"first": {"variable": "hydra.core.model.Name"}, "second": {"literal": "string"}}}}}},
        "body": {
          "annotated": {
            "body": {
              "lambda": {
                "parameter": "ln",
                "domain": {"literal": "string"},
                "body": {
                  "let": {
                    "bindings": [
                      {
                        "name": "parts",
                        "term": {
                          "application": {
                            "function": {"application": {"function": {"variable": "hydra.core.lib.strings.splitOn"}, "argument": {"literal": {"string": " "}}}},
                            "argument": {"variable": "ln"}}},
                        "typeScheme": {"variables": [], "body": {"list": {"literal": "string"}}, "constraints": []}}],
                    "body": {
                      "let": {
                        "bindings": [
                          {
                            "name": "tag",
                            "term": {
                              "application": {
                                "function": {
                                  "application": {
                                    "function": {"typeApplication": {"body": {"variable": "hydra.core.lib.optionals.withDefault"}, "type": {"literal": "string"}}},
                                    "argument": {"literal": {"string": ""}}}},
                                "argument": {
                                  "application": {
                                    "function": {"typeApplication": {"body": {"variable": "hydra.core.lib.lists.head"}, "type": {"literal": "string"}}},
                                    "argument": {"variable": "parts"}}}}},
                            "typeScheme": {"variables": [], "body": {"literal": "string"}, "constraints": []}}],
                        "body": {
                          "application": {
                            "function": {
                              "application": {
                                "function": {
                                  "application": {
                                    "function": {
                                      "typeApplication": {
                                        "body": {"variable": "hydra.core.lib.logic.ifElse"},
                                        "type": {"optional": {"pair": {"first": {"variable": "hydra.core.model.Name"}, "second": {"literal": "string"}}}}}},
                                    "argument": {
                                      "application": {
                                        "function": {
                                          "application": {
                                            "function": {"typeApplication": {"body": {"variable": "hydra.core.lib.equality.equal"}, "type": {"literal": "string"}}},
                                            "argument": {"variable": "tag"}}},
                                        "argument": {"literal": {"string": "@param"}}}}}},
                                "argument": {
                                  "let": {
                                    "bindings": [
                                      {
                                        "name": "afterTag",
                                        "term": {
                                          "application": {
                                            "function": {"application": {"function": {"variable": "hydra.core.lib.strings.join"}, "argument": {"literal": {"string": " "}}}},
                                            "argument": {
                                              "application": {
                                                "function": {
                                                  "application": {
                                                    "function": {"typeApplication": {"body": {"variable": "hydra.core.lib.lists.drop"}, "type": {"literal": "string"}}},
                                                    "argument": {"literal": {"integer": {"int32": 1}}}}},
                                                "argument": {"variable": "parts"}}}}},
                                        "typeScheme": {"variables": [], "body": {"literal": "string"}, "constraints": []}}],
                                    "body": {
                                      "let": {
                                        "bindings": [
                                          {
                                            "name": "nameAndDesc",
                                            "term": {
                                              "application": {
                                                "function": {"application": {"function": {"variable": "hydra.core.lib.strings.splitOn"}, "argument": {"literal": {"string": ": "}}}},
                                                "argument": {"variable": "afterTag"}}},
                                            "typeScheme": {"variables": [], "body": {"list": {"literal": "string"}}, "constraints": []}}],
                                        "body": {
                                          "let": {
                                            "bindings": [
                                              {
                                                "name": "pname",
                                                "term": {
                                                  "application": {
                                                    "function": {
                                                      "application": {
                                                        "function": {"typeApplication": {"body": {"variable": "hydra.core.lib.optionals.withDefault"}, "type": {"literal": "string"}}},
                                                        "argument": {"literal": {"string": ""}}}},
                                                    "argument": {
                                                      "application": {
                                                        "function": {"typeApplication": {"body": {"variable": "hydra.core.lib.lists.head"}, "type": {"literal": "string"}}},
                                                        "argument": {"variable": "nameAndDesc"}}}}},
                                                "typeScheme": {"variables": [], "body": {"literal": "string"}, "constraints": []}}],
                                            "body": {
                                              "let": {
                                                "bindings": [
                                                  {
                                                    "name": "pdesc",
                                                    "term": {
                                                      "application": {
                                                        "function": {"application": {"function": {"variable": "hydra.core.lib.strings.join"}, "argument": {"literal": {"string": ": "}}}},
                                                        "argument": {
                                                          "application": {
                                                            "function": {
                                                              "application": {
                                                                "function": {"typeApplication": {"body": {"variable": "hydra.core.lib.lists.drop"}, "type": {"literal": "string"}}},
                                                                "argument": {"literal": {"integer": {"int32": 1}}}}},
                                                            "argument": {"variable": "nameAndDesc"}}}}},
                                                    "typeScheme": {"variables": [], "body": {"literal": "string"}, "constraints": []}}],
                                                "body": {
                                                  "optional": {
                                                    "typeApplication": {
                                                      "body": {
                                                        "typeApplication": {
                                                          "body": {
                                                            "pair": {
                                                              "first": {"wrap": {"typeName": "hydra.core.model.Name", "body": {"variable": "pname"}}},
                                                              "second": {"variable": "pdesc"}}},
                                                          "type": {"variable": "hydra.core.model.Name"}}},
                                                      "type": {"literal": "string"}}}}}}}}}}}}}},
                            "argument": {
                              "typeApplication": {
                                "body": {"optional": null},
                                "type": {"pair": {"first": {"variable": "hydra.core.model.Name"}, "second": {"literal": "string"}}}}}}}}}}}}},
            "annotation": {
              "map": [
                {
                  "key": {"variable": "description"},
                  "value": {"literal": {"string": "Parse a single '@param <name>: <description>' key line into a (name, description) pair (#837)"}}}]}}}}},
    {
      "term": {
        "name": "hydra.core.parse.packaging.parseReturnLine",
        "signature": {
          "typeParameters": [],
          "parameters": [{"name": "arg0", "type": {"literal": "string"}, "isLazy": false}],
          "result": {"type": {"optional": {"literal": "string"}}}},
        "body": {
          "annotated": {
            "body": {
              "lambda": {
                "parameter": "ln",
                "domain": {"literal": "string"},
                "body": {
                  "let": {
                    "bindings": [
                      {
                        "name": "parts",
                        "term": {
                          "application": {
                            "function": {"application": {"function": {"variable": "hydra.core.lib.strings.splitOn"}, "argument": {"literal": {"string": " "}}}},
                            "argument": {"variable": "ln"}}},
                        "typeScheme": {"variables": [], "body": {"list": {"literal": "string"}}, "constraints": []}}],
                    "body": {
                      "application": {
                        "function": {
                          "application": {
                            "function": {
                              "application": {
                                "function": {"typeApplication": {"body": {"variable": "hydra.core.lib.logic.ifElse"}, "type": {"optional": {"literal": "string"}}}},
                                "argument": {
                                  "application": {
                                    "function": {
                                      "application": {
                                        "function": {"typeApplication": {"body": {"variable": "hydra.core.lib.equality.equal"}, "type": {"literal": "string"}}},
                                        "argument": {
                                          "application": {
                                            "function": {
                                              "application": {
                                                "function": {"typeApplication": {"body": {"variable": "hydra.core.lib.optionals.withDefault"}, "type": {"literal": "string"}}},
                                                "argument": {"literal": {"string": ""}}}},
                                            "argument": {
                                              "application": {
                                                "function": {"typeApplication": {"body": {"variable": "hydra.core.lib.lists.head"}, "type": {"literal": "string"}}},
                                                "argument": {"variable": "parts"}}}}}}},
                                    "argument": {"literal": {"string": "@return"}}}}}},
                            "argument": {
                              "optional": {
                                "application": {
                                  "function": {"application": {"function": {"variable": "hydra.core.lib.strings.join"}, "argument": {"literal": {"string": " "}}}},
                                  "argument": {
                                    "application": {
                                      "function": {
                                        "application": {
                                          "function": {"typeApplication": {"body": {"variable": "hydra.core.lib.lists.drop"}, "type": {"literal": "string"}}},
                                          "argument": {"literal": {"integer": {"int32": 1}}}}},
                                      "argument": {"variable": "parts"}}}}}}}},
                        "argument": {"typeApplication": {"body": {"optional": null}, "type": {"literal": "string"}}}}}}}}},
            "annotation": {
              "map": [
                {
                  "key": {"variable": "description"},
                  "value": {"literal": {"string": "Parse a single '@return <description>' key line into its description (#837)"}}}]}}}}},
    {
      "term": {
        "name": "hydra.core.parse.packaging.primitiveDefinitionParser",
        "signature": {
          "typeParameters": [],
          "parameters": [{"name": "arg0", "type": {"variable": "hydra.core.packaging.ModuleName"}, "isLazy": false}],
          "result": {
            "type": {
              "application": {"function": {"variable": "hydra.core.parsing.Parser"}, "argument": {"variable": "hydra.core.packaging.Definition"}}}}},
        "body": {
          "annotated": {
            "body": {
              "lambda": {
                "parameter": "modName",
                "domain": {"variable": "hydra.core.packaging.ModuleName"},
                "body": {
                  "application": {
                    "function": {
                      "application": {
                        "function": {
                          "typeApplication": {
                            "body": {"typeApplication": {"body": {"variable": "hydra.core.parsers.bind"}, "type": {"list": {"literal": "string"}}}},
                            "type": {"variable": "hydra.core.packaging.Definition"}}},
                        "argument": {
                          "application": {
                            "function": {"typeApplication": {"body": {"variable": "hydra.core.parsers.many"}, "type": {"literal": "string"}}},
                            "argument": {
                              "application": {
                                "function": {
                                  "application": {
                                    "function": {
                                      "typeApplication": {
                                        "body": {"typeApplication": {"body": {"variable": "hydra.core.parsers.bind"}, "type": {"literal": {"integer": "int32"}}}},
                                        "type": {"literal": "string"}}},
                                    "argument": {
                                      "application": {"function": {"variable": "hydra.core.parsers.char"}, "argument": {"literal": {"integer": {"int32": 35}}}}}}},
                                "argument": {
                                  "lambda": {
                                    "parameter": "_",
                                    "domain": {"literal": {"integer": "int32"}},
                                    "body": {
                                      "application": {
                                        "function": {
                                          "application": {
                                            "function": {
                                              "typeApplication": {
                                                "body": {"typeApplication": {"body": {"variable": "hydra.core.parsers.bind"}, "type": {"literal": {"integer": "int32"}}}},
                                                "type": {"literal": "string"}}},
                                            "argument": {
                                              "application": {"function": {"variable": "hydra.core.parsers.char"}, "argument": {"literal": {"integer": {"int32": 35}}}}}}},
                                        "argument": {
                                          "lambda": {
                                            "parameter": "_",
                                            "domain": {"literal": {"integer": "int32"}},
                                            "body": {
                                              "application": {
                                                "function": {
                                                  "application": {
                                                    "function": {
                                                      "typeApplication": {
                                                        "body": {
                                                          "typeApplication": {"body": {"variable": "hydra.core.parsers.bind"}, "type": {"optional": {"literal": {"integer": "int32"}}}}},
                                                        "type": {"literal": "string"}}},
                                                    "argument": {
                                                      "application": {
                                                        "function": {"typeApplication": {"body": {"variable": "hydra.core.parsers.optional"}, "type": {"literal": {"integer": "int32"}}}},
                                                        "argument": {
                                                          "application": {"function": {"variable": "hydra.core.parsers.char"}, "argument": {"literal": {"integer": {"int32": 32}}}}}}}}},
                                                "argument": {
                                                  "lambda": {
                                                    "parameter": "_",
                                                    "domain": {"optional": {"literal": {"integer": "int32"}}},
                                                    "body": {
                                                      "application": {
                                                        "function": {
                                                          "application": {
                                                            "function": {
                                                              "typeApplication": {
                                                                "body": {"typeApplication": {"body": {"variable": "hydra.core.parsers.bind"}, "type": {"literal": "string"}}},
                                                                "type": {"literal": "string"}}},
                                                            "argument": {
                                                              "application": {
                                                                "function": {
                                                                  "application": {
                                                                    "function": {
                                                                      "typeApplication": {
                                                                        "body": {
                                                                          "typeApplication": {"body": {"variable": "hydra.core.parsers.map"}, "type": {"list": {"literal": {"integer": "int32"}}}}},
                                                                        "type": {"literal": "string"}}},
                                                                    "argument": {
                                                                      "lambda": {
                                                                        "parameter": "cs",
                                                                        "domain": {"list": {"literal": {"integer": "int32"}}},
                                                                        "body": {"application": {"function": {"variable": "hydra.core.lib.strings.fromList"}, "argument": {"variable": "cs"}}}}}}},
                                                                "argument": {
                                                                  "application": {
                                                                    "function": {"typeApplication": {"body": {"variable": "hydra.core.parsers.many"}, "type": {"literal": {"integer": "int32"}}}},
                                                                    "argument": {
                                                                      "application": {
                                                                        "function": {"variable": "hydra.core.parsers.satisfy"},
                                                                        "argument": {
                                                                          "lambda": {
                                                                            "parameter": "c",
                                                                            "domain": {"literal": {"integer": "int32"}},
                                                                            "body": {
                                                                              "application": {
                                                                                "function": {"variable": "hydra.core.lib.logic.not"},
                                                                                "argument": {
                                                                                  "application": {
                                                                                    "function": {
                                                                                      "application": {
                                                                                        "function": {"typeApplication": {"body": {"variable": "hydra.core.lib.equality.equal"}, "type": {"literal": {"integer": "int32"}}}},
                                                                                        "argument": {"variable": "c"}}},
                                                                                    "argument": {"literal": {"integer": {"int32": 10}}}}}}}}}}}}}}}}},
                                                        "argument": {
                                                          "lambda": {
                                                            "parameter": "s",
                                                            "domain": {"literal": "string"},
                                                            "body": {
                                                              "application": {
                                                                "function": {
                                                                  "application": {
                                                                    "function": {
                                                                      "typeApplication": {
                                                                        "body": {"typeApplication": {"body": {"variable": "hydra.core.parsers.bind"}, "type": "unit"}},
                                                                        "type": {"literal": "string"}}},
                                                                    "argument": {
                                                                      "application": {
                                                                        "function": {
                                                                          "application": {
                                                                            "function": {
                                                                              "typeApplication": {
                                                                                "body": {
                                                                                  "typeApplication": {"body": {"variable": "hydra.core.parsers.map"}, "type": {"list": {"literal": {"integer": "int32"}}}}},
                                                                                "type": "unit"}},
                                                                            "argument": {"lambda": {"parameter": "_", "domain": {"list": {"literal": {"integer": "int32"}}}, "body": "unit"}}}},
                                                                        "argument": {
                                                                          "application": {
                                                                            "function": {"typeApplication": {"body": {"variable": "hydra.core.parsers.many"}, "type": {"literal": {"integer": "int32"}}}},
                                                                            "argument": {
                                                                              "application": {
                                                                                "function": {"variable": "hydra.core.parsers.satisfy"},
                                                                                "argument": {
                                                                                  "lambda": {
                                                                                    "parameter": "c",
                                                                                    "domain": {"literal": {"integer": "int32"}},
                                                                                    "body": {"application": {"function": {"variable": "hydra.core.lib.chars.isSpace"}, "argument": {"variable": "c"}}}}}}}}}}}}},
                                                                "argument": {
                                                                  "lambda": {
                                                                    "parameter": "_",
                                                                    "domain": "unit",
                                                                    "body": {
                                                                      "application": {
                                                                        "function": {"typeApplication": {"body": {"variable": "hydra.core.parsers.pure"}, "type": {"literal": "string"}}},
                                                                        "argument": {"variable": "s"}}}}}}}}}}}}}}}}}}}}}}}}}}},
                    "argument": {
                      "lambda": {
                        "parameter": "lns",
                        "domain": {"list": {"literal": "string"}},
                        "body": {
                          "let": {
                            "bindings": [
                              {
                                "name": "mmeta",
                                "term": {
                                  "application": {
                                    "function": {
                                      "application": {
                                        "function": {
                                          "application": {
                                            "function": {
                                              "typeApplication": {
                                                "body": {"variable": "hydra.core.lib.logic.ifElse"},
                                                "type": {"optional": {"variable": "hydra.core.packaging.EntityMetadata"}}}},
                                            "argument": {
                                              "application": {
                                                "function": {"typeApplication": {"body": {"variable": "hydra.core.lib.lists.isEmpty"}, "type": {"literal": "string"}}},
                                                "argument": {"variable": "lns"}}}}},
                                        "argument": {"typeApplication": {"body": {"optional": null}, "type": {"variable": "hydra.core.packaging.EntityMetadata"}}}}},
                                    "argument": {
                                      "optional": {
                                        "application": {
                                          "function": {
                                            "application": {
                                              "function": {
                                                "lambda": {
                                                  "parameter": "modName",
                                                  "domain": {"variable": "hydra.core.packaging.ModuleName"},
                                                  "body": {
                                                    "lambda": {
                                                      "parameter": "lns",
                                                      "domain": {"list": {"literal": "string"}},
                                                      "body": {
                                                        "let": {
                                                          "bindings": [
                                                            {
                                                              "name": "sections",
                                                              "term": {
                                                                "application": {
                                                                  "function": {
                                                                    "lambda": {
                                                                      "parameter": "lns",
                                                                      "domain": {"list": {"literal": "string"}},
                                                                      "body": {
                                                                        "let": {
                                                                          "bindings": [
                                                                            {
                                                                              "name": "step",
                                                                              "term": {
                                                                                "lambda": {
                                                                                  "parameter": "acc",
                                                                                  "domain": {"list": {"list": {"literal": "string"}}},
                                                                                  "body": {
                                                                                    "lambda": {
                                                                                      "parameter": "ln",
                                                                                      "domain": {"literal": "string"},
                                                                                      "body": {
                                                                                        "application": {
                                                                                          "function": {
                                                                                            "application": {
                                                                                              "function": {
                                                                                                "application": {
                                                                                                  "function": {
                                                                                                    "typeApplication": {"body": {"variable": "hydra.core.lib.logic.ifElse"}, "type": {"list": {"list": {"literal": "string"}}}}},
                                                                                                  "argument": {"application": {"function": {"variable": "hydra.core.lib.strings.isEmpty"}, "argument": {"variable": "ln"}}}}},
                                                                                              "argument": {
                                                                                                "application": {
                                                                                                  "function": {
                                                                                                    "application": {
                                                                                                      "function": {"typeApplication": {"body": {"variable": "hydra.core.lib.lists.concat2"}, "type": {"list": {"literal": "string"}}}},
                                                                                                      "argument": {"variable": "acc"}}},
                                                                                                  "argument": {"list": [{"typeApplication": {"body": {"list": []}, "type": {"literal": "string"}}}]}}}}},
                                                                                          "argument": {
                                                                                            "let": {
                                                                                              "bindings": [
                                                                                                {
                                                                                                  "name": "i",
                                                                                                  "term": {
                                                                                                    "application": {
                                                                                                      "function": {
                                                                                                        "application": {
                                                                                                          "function": {"typeApplication": {"body": {"variable": "hydra.core.lib.math.sub"}, "type": {"literal": {"integer": "int32"}}}},
                                                                                                          "argument": {
                                                                                                            "application": {
                                                                                                              "function": {"typeApplication": {"body": {"variable": "hydra.core.lib.lists.length"}, "type": {"list": {"literal": "string"}}}},
                                                                                                              "argument": {"variable": "acc"}}}}},
                                                                                                      "argument": {"literal": {"integer": {"int32": 1}}}}},
                                                                                                  "typeScheme": {"variables": [], "body": {"literal": {"integer": "int32"}}, "constraints": []}}],
                                                                                              "body": {
                                                                                                "let": {
                                                                                                  "bindings": [
                                                                                                    {
                                                                                                      "name": "cur",
                                                                                                      "term": {
                                                                                                        "application": {
                                                                                                          "function": {
                                                                                                            "application": {
                                                                                                              "function": {
                                                                                                                "typeApplication": {"body": {"variable": "hydra.core.lib.optionals.withDefault"}, "type": {"list": {"literal": "string"}}}},
                                                                                                              "argument": {"typeApplication": {"body": {"list": []}, "type": {"literal": "string"}}}}},
                                                                                                          "argument": {
                                                                                                            "application": {
                                                                                                              "function": {"typeApplication": {"body": {"variable": "hydra.core.lib.lists.head"}, "type": {"list": {"literal": "string"}}}},
                                                                                                              "argument": {
                                                                                                                "application": {
                                                                                                                  "function": {
                                                                                                                    "application": {
                                                                                                                      "function": {"typeApplication": {"body": {"variable": "hydra.core.lib.lists.drop"}, "type": {"list": {"literal": "string"}}}},
                                                                                                                      "argument": {"variable": "i"}}},
                                                                                                                  "argument": {"variable": "acc"}}}}}}},
                                                                                                      "typeScheme": {"variables": [], "body": {"list": {"literal": "string"}}, "constraints": []}}],
                                                                                                  "body": {
                                                                                                    "application": {
                                                                                                      "function": {
                                                                                                        "application": {
                                                                                                          "function": {"typeApplication": {"body": {"variable": "hydra.core.lib.lists.concat2"}, "type": {"list": {"literal": "string"}}}},
                                                                                                          "argument": {
                                                                                                            "application": {
                                                                                                              "function": {
                                                                                                                "application": {
                                                                                                                  "function": {"typeApplication": {"body": {"variable": "hydra.core.lib.lists.take"}, "type": {"list": {"literal": "string"}}}},
                                                                                                                  "argument": {"variable": "i"}}},
                                                                                                              "argument": {"variable": "acc"}}}}},
                                                                                                      "argument": {
                                                                                                        "list": [
                                                                                                          {
                                                                                                            "application": {
                                                                                                              "function": {
                                                                                                                "application": {
                                                                                                                  "function": {"typeApplication": {"body": {"variable": "hydra.core.lib.lists.concat2"}, "type": {"literal": "string"}}},
                                                                                                                  "argument": {"variable": "cur"}}},
                                                                                                              "argument": {"list": [{"variable": "ln"}]}}}]}}}}}}}}}}}}},
                                                                              "typeScheme": {
                                                                                "variables": [],
                                                                                "body": {
                                                                                  "function": {
                                                                                    "domain": {"list": {"list": {"literal": "string"}}},
                                                                                    "codomain": {"function": {"domain": {"literal": "string"}, "codomain": {"list": {"list": {"literal": "string"}}}}}}},
                                                                                "constraints": []}}],
                                                                          "body": {
                                                                            "application": {
                                                                              "function": {
                                                                                "application": {
                                                                                  "function": {"typeApplication": {"body": {"variable": "hydra.core.lib.lists.filter"}, "type": {"list": {"literal": "string"}}}},
                                                                                  "argument": {
                                                                                    "lambda": {
                                                                                      "parameter": "sec",
                                                                                      "domain": {"list": {"literal": "string"}},
                                                                                      "body": {
                                                                                        "application": {
                                                                                          "function": {"variable": "hydra.core.lib.logic.not"},
                                                                                          "argument": {
                                                                                            "application": {
                                                                                              "function": {"typeApplication": {"body": {"variable": "hydra.core.lib.lists.isEmpty"}, "type": {"literal": "string"}}},
                                                                                              "argument": {"variable": "sec"}}}}}}}}},
                                                                              "argument": {
                                                                                "application": {
                                                                                  "function": {
                                                                                    "application": {
                                                                                      "function": {
                                                                                        "application": {
                                                                                          "function": {
                                                                                            "typeApplication": {
                                                                                              "body": {
                                                                                                "typeApplication": {"body": {"variable": "hydra.core.lib.lists.foldl"}, "type": {"list": {"list": {"literal": "string"}}}}},
                                                                                              "type": {"literal": "string"}}},
                                                                                          "argument": {"variable": "step"}}},
                                                                                      "argument": {"list": [{"typeApplication": {"body": {"list": []}, "type": {"literal": "string"}}}]}}},
                                                                                  "argument": {"variable": "lns"}}}}}}}}},
                                                                  "argument": {"variable": "lns"}}},
                                                              "typeScheme": {"variables": [], "body": {"list": {"list": {"literal": "string"}}}, "constraints": []}}],
                                                          "body": {
                                                            "let": {
                                                              "bindings": [
                                                                {
                                                                  "name": "isKeySection",
                                                                  "term": {
                                                                    "lambda": {
                                                                      "parameter": "sec",
                                                                      "domain": {"list": {"literal": "string"}},
                                                                      "body": {
                                                                        "application": {
                                                                          "function": {
                                                                            "application": {
                                                                              "function": {
                                                                                "application": {
                                                                                  "function": {
                                                                                    "typeApplication": {
                                                                                      "body": {"typeApplication": {"body": {"variable": "hydra.core.lib.optionals.match"}, "type": {"literal": "string"}}},
                                                                                      "type": {"literal": "boolean"}}},
                                                                                  "argument": {
                                                                                    "application": {
                                                                                      "function": {"typeApplication": {"body": {"variable": "hydra.core.lib.lists.head"}, "type": {"literal": "string"}}},
                                                                                      "argument": {"variable": "sec"}}}}},
                                                                              "argument": {"literal": {"boolean": false}}}},
                                                                          "argument": {
                                                                            "lambda": {
                                                                              "parameter": "s",
                                                                              "domain": {"literal": "string"},
                                                                              "body": {
                                                                                "application": {
                                                                                  "function": {
                                                                                    "application": {
                                                                                      "function": {
                                                                                        "application": {
                                                                                          "function": {
                                                                                            "typeApplication": {
                                                                                              "body": {"typeApplication": {"body": {"variable": "hydra.core.lib.optionals.match"}, "type": {"literal": {"integer": "int32"}}}},
                                                                                              "type": {"literal": "boolean"}}},
                                                                                          "argument": {
                                                                                            "application": {
                                                                                              "function": {
                                                                                                "application": {"function": {"variable": "hydra.core.lib.strings.charAt"}, "argument": {"literal": {"integer": {"int32": 0}}}}},
                                                                                              "argument": {"variable": "s"}}}}},
                                                                                      "argument": {"literal": {"boolean": false}}}},
                                                                                  "argument": {
                                                                                    "lambda": {
                                                                                      "parameter": "c",
                                                                                      "domain": {"literal": {"integer": "int32"}},
                                                                                      "body": {
                                                                                        "application": {
                                                                                          "function": {
                                                                                            "application": {
                                                                                              "function": {"typeApplication": {"body": {"variable": "hydra.core.lib.equality.equal"}, "type": {"literal": {"integer": "int32"}}}},
                                                                                              "argument": {"variable": "c"}}},
                                                                                          "argument": {"literal": {"integer": {"int32": 64}}}}}}}}}}}}}}},
                                                                  "typeScheme": {
                                                                    "variables": [],
                                                                    "body": {"function": {"domain": {"list": {"literal": "string"}}, "codomain": {"literal": "boolean"}}},
                                                                    "constraints": []}}],
                                                              "body": {
                                                                "let": {
                                                                  "bindings": [
                                                                    {
                                                                      "name": "keyLines",
                                                                      "term": {
                                                                        "application": {
                                                                          "function": {"typeApplication": {"body": {"variable": "hydra.core.lib.lists.concat"}, "type": {"literal": "string"}}},
                                                                          "argument": {
                                                                            "application": {
                                                                              "function": {
                                                                                "application": {
                                                                                  "function": {"typeApplication": {"body": {"variable": "hydra.core.lib.lists.filter"}, "type": {"list": {"literal": "string"}}}},
                                                                                  "argument": {"variable": "isKeySection"}}},
                                                                              "argument": {"variable": "sections"}}}}},
                                                                      "typeScheme": {"variables": [], "body": {"list": {"literal": "string"}}, "constraints": []}}],
                                                                  "body": {
                                                                    "let": {
                                                                      "bindings": [
                                                                        {
                                                                          "name": "nonKeySections",
                                                                          "term": {
                                                                            "application": {
                                                                              "function": {
                                                                                "application": {
                                                                                  "function": {"typeApplication": {"body": {"variable": "hydra.core.lib.lists.filter"}, "type": {"list": {"literal": "string"}}}},
                                                                                  "argument": {
                                                                                    "lambda": {
                                                                                      "parameter": "sec",
                                                                                      "domain": {"list": {"literal": "string"}},
                                                                                      "body": {
                                                                                        "application": {
                                                                                          "function": {"variable": "hydra.core.lib.logic.not"},
                                                                                          "argument": {"application": {"function": {"variable": "isKeySection"}, "argument": {"variable": "sec"}}}}}}}}},
                                                                              "argument": {"variable": "sections"}}},
                                                                          "typeScheme": {"variables": [], "body": {"list": {"list": {"literal": "string"}}}, "constraints": []}}],
                                                                      "body": {
                                                                        "let": {
                                                                          "bindings": [
                                                                            {
                                                                              "name": "mdesc",
                                                                              "term": {
                                                                                "application": {
                                                                                  "function": {
                                                                                    "application": {
                                                                                      "function": {
                                                                                        "typeApplication": {
                                                                                          "body": {"typeApplication": {"body": {"variable": "hydra.core.lib.optionals.map"}, "type": {"list": {"literal": "string"}}}},
                                                                                          "type": {"literal": "string"}}},
                                                                                      "argument": {
                                                                                        "lambda": {
                                                                                          "parameter": "sec",
                                                                                          "domain": {"list": {"literal": "string"}},
                                                                                          "body": {
                                                                                            "application": {
                                                                                              "function": {"application": {"function": {"variable": "hydra.core.lib.strings.join"}, "argument": {"literal": {"string": "\n"}}}},
                                                                                              "argument": {"variable": "sec"}}}}}}},
                                                                                  "argument": {
                                                                                    "application": {
                                                                                      "function": {"typeApplication": {"body": {"variable": "hydra.core.lib.lists.head"}, "type": {"list": {"literal": "string"}}}},
                                                                                      "argument": {"variable": "nonKeySections"}}}}},
                                                                              "typeScheme": {"variables": [], "body": {"optional": {"literal": "string"}}, "constraints": []}}],
                                                                          "body": {
                                                                            "let": {
                                                                              "bindings": [
                                                                                {
                                                                                  "name": "comments",
                                                                                  "term": {
                                                                                    "application": {
                                                                                      "function": {
                                                                                        "application": {
                                                                                          "function": {
                                                                                            "typeApplication": {"body": {"variable": "hydra.core.lib.optionals.withDefault"}, "type": {"list": {"literal": "string"}}}},
                                                                                          "argument": {"typeApplication": {"body": {"list": []}, "type": {"literal": "string"}}}}},
                                                                                      "argument": {
                                                                                        "application": {
                                                                                          "function": {"typeApplication": {"body": {"variable": "hydra.core.lib.lists.head"}, "type": {"list": {"literal": "string"}}}},
                                                                                          "argument": {
                                                                                            "application": {
                                                                                              "function": {
                                                                                                "application": {
                                                                                                  "function": {"typeApplication": {"body": {"variable": "hydra.core.lib.lists.drop"}, "type": {"list": {"literal": "string"}}}},
                                                                                                  "argument": {"literal": {"integer": {"int32": 1}}}}},
                                                                                              "argument": {"variable": "nonKeySections"}}}}}}},
                                                                                  "typeScheme": {"variables": [], "body": {"list": {"literal": "string"}}, "constraints": []}}],
                                                                              "body": {
                                                                                "let": {
                                                                                  "bindings": [
                                                                                    {
                                                                                      "name": "seeAlso",
                                                                                      "term": {
                                                                                        "application": {
                                                                                          "function": {
                                                                                            "typeApplication": {"body": {"variable": "hydra.core.lib.optionals.givens"}, "type": {"variable": "hydra.core.packaging.EntityReference"}}},
                                                                                          "argument": {
                                                                                            "application": {
                                                                                              "function": {
                                                                                                "application": {
                                                                                                  "function": {
                                                                                                    "typeApplication": {
                                                                                                      "body": {"typeApplication": {"body": {"variable": "hydra.core.lib.lists.map"}, "type": {"literal": "string"}}},
                                                                                                      "type": {"optional": {"variable": "hydra.core.packaging.EntityReference"}}}},
                                                                                                  "argument": {
                                                                                                    "lambda": {
                                                                                                      "parameter": "ln",
                                                                                                      "domain": {"literal": "string"},
                                                                                                      "body": {
                                                                                                        "let": {
                                                                                                          "bindings": [
                                                                                                            {
                                                                                                              "name": "parts",
                                                                                                              "term": {
                                                                                                                "application": {
                                                                                                                  "function": {"application": {"function": {"variable": "hydra.core.lib.strings.splitOn"}, "argument": {"literal": {"string": " "}}}},
                                                                                                                  "argument": {"variable": "ln"}}},
                                                                                                              "typeScheme": {"variables": [], "body": {"list": {"literal": "string"}}, "constraints": []}}],
                                                                                                          "body": {
                                                                                                            "application": {
                                                                                                              "function": {
                                                                                                                "application": {
                                                                                                                  "function": {
                                                                                                                    "application": {
                                                                                                                      "function": {
                                                                                                                        "typeApplication": {
                                                                                                                          "body": {"variable": "hydra.core.lib.logic.ifElse"},
                                                                                                                          "type": {"optional": {"variable": "hydra.core.packaging.EntityReference"}}}},
                                                                                                                      "argument": {
                                                                                                                        "application": {
                                                                                                                          "function": {
                                                                                                                            "application": {
                                                                                                                              "function": {"typeApplication": {"body": {"variable": "hydra.core.lib.equality.equal"}, "type": {"literal": "string"}}},
                                                                                                                              "argument": {
                                                                                                                                "application": {
                                                                                                                                  "function": {
                                                                                                                                    "application": {
                                                                                                                                      "function": {"typeApplication": {"body": {"variable": "hydra.core.lib.optionals.withDefault"}, "type": {"literal": "string"}}},
                                                                                                                                      "argument": {"literal": {"string": ""}}}},
                                                                                                                                  "argument": {
                                                                                                                                    "application": {
                                                                                                                                      "function": {"typeApplication": {"body": {"variable": "hydra.core.lib.lists.head"}, "type": {"literal": "string"}}},
                                                                                                                                      "argument": {"variable": "parts"}}}}}}},
                                                                                                                          "argument": {"literal": {"string": "@seeAlso"}}}}}},
                                                                                                                  "argument": {
                                                                                                                    "application": {
                                                                                                                      "function": {"variable": "hydra.core.parse.docs.parseDocAnnotation"},
                                                                                                                      "argument": {
                                                                                                                        "application": {
                                                                                                                          "function": {"application": {"function": {"variable": "hydra.core.lib.strings.join"}, "argument": {"literal": {"string": " "}}}},
                                                                                                                          "argument": {
                                                                                                                            "application": {
                                                                                                                              "function": {
                                                                                                                                "application": {
                                                                                                                                  "function": {"typeApplication": {"body": {"variable": "hydra.core.lib.lists.drop"}, "type": {"literal": "string"}}},
                                                                                                                                  "argument": {"literal": {"integer": {"int32": 1}}}}},
                                                                                                                              "argument": {"variable": "parts"}}}}}}}}},
                                                                                                              "argument": {"typeApplication": {"body": {"optional": null}, "type": {"variable": "hydra.core.packaging.EntityReference"}}}}}}}}}}},
                                                                                              "argument": {"variable": "keyLines"}}}}},
                                                                                      "typeScheme": {"variables": [], "body": {"list": {"variable": "hydra.core.packaging.EntityReference"}}, "constraints": []}}],
                                                                                  "body": {
                                                                                    "let": {
                                                                                      "bindings": [
                                                                                        {
                                                                                          "name": "avail",
                                                                                          "term": {
                                                                                            "application": {
                                                                                              "function": {
                                                                                                "typeApplication": {"body": {"variable": "hydra.core.lib.optionals.givens"}, "type": {"variable": "hydra.core.packaging.Version"}}},
                                                                                              "argument": {
                                                                                                "application": {
                                                                                                  "function": {
                                                                                                    "application": {
                                                                                                      "function": {
                                                                                                        "typeApplication": {
                                                                                                          "body": {"typeApplication": {"body": {"variable": "hydra.core.lib.lists.map"}, "type": {"literal": "string"}}},
                                                                                                          "type": {"optional": {"variable": "hydra.core.packaging.Version"}}}},
                                                                                                      "argument": {
                                                                                                        "application": {
                                                                                                          "function": {
                                                                                                            "lambda": {
                                                                                                              "parameter": "tag",
                                                                                                              "domain": {"literal": "string"},
                                                                                                              "body": {
                                                                                                                "lambda": {
                                                                                                                  "parameter": "ln",
                                                                                                                  "domain": {"literal": "string"},
                                                                                                                  "body": {
                                                                                                                    "let": {
                                                                                                                      "bindings": [
                                                                                                                        {
                                                                                                                          "name": "parts",
                                                                                                                          "term": {
                                                                                                                            "application": {
                                                                                                                              "function": {"application": {"function": {"variable": "hydra.core.lib.strings.splitOn"}, "argument": {"literal": {"string": " "}}}},
                                                                                                                              "argument": {"variable": "ln"}}},
                                                                                                                          "typeScheme": {"variables": [], "body": {"list": {"literal": "string"}}, "constraints": []}}],
                                                                                                                      "body": {
                                                                                                                        "application": {
                                                                                                                          "function": {
                                                                                                                            "application": {
                                                                                                                              "function": {
                                                                                                                                "application": {
                                                                                                                                  "function": {
                                                                                                                                    "typeApplication": {
                                                                                                                                      "body": {"variable": "hydra.core.lib.logic.ifElse"},
                                                                                                                                      "type": {"optional": {"variable": "hydra.core.packaging.Version"}}}},
                                                                                                                                  "argument": {
                                                                                                                                    "application": {
                                                                                                                                      "function": {
                                                                                                                                        "application": {
                                                                                                                                          "function": {"typeApplication": {"body": {"variable": "hydra.core.lib.equality.equal"}, "type": {"literal": "string"}}},
                                                                                                                                          "argument": {
                                                                                                                                            "application": {
                                                                                                                                              "function": {
                                                                                                                                                "application": {
                                                                                                                                                  "function": {"typeApplication": {"body": {"variable": "hydra.core.lib.optionals.withDefault"}, "type": {"literal": "string"}}},
                                                                                                                                                  "argument": {"literal": {"string": ""}}}},
                                                                                                                                              "argument": {
                                                                                                                                                "application": {
                                                                                                                                                  "function": {"typeApplication": {"body": {"variable": "hydra.core.lib.lists.head"}, "type": {"literal": "string"}}},
                                                                                                                                                  "argument": {"variable": "parts"}}}}}}},
                                                                                                                                      "argument": {"variable": "tag"}}}}},
                                                                                                                              "argument": {
                                                                                                                                "optional": {
                                                                                                                                  "wrap": {
                                                                                                                                    "typeName": "hydra.core.packaging.Version",
                                                                                                                                    "body": {
                                                                                                                                      "application": {
                                                                                                                                        "function": {"application": {"function": {"variable": "hydra.core.lib.strings.join"}, "argument": {"literal": {"string": " "}}}},
                                                                                                                                        "argument": {
                                                                                                                                          "application": {
                                                                                                                                            "function": {
                                                                                                                                              "application": {
                                                                                                                                                "function": {"typeApplication": {"body": {"variable": "hydra.core.lib.lists.drop"}, "type": {"literal": "string"}}},
                                                                                                                                                "argument": {"literal": {"integer": {"int32": 1}}}}},
                                                                                                                                            "argument": {"variable": "parts"}}}}}}}}}},
                                                                                                                          "argument": {"typeApplication": {"body": {"optional": null}, "type": {"variable": "hydra.core.packaging.Version"}}}}}}}}}}},
                                                                                                          "argument": {"literal": {"string": "@availableSince"}}}}}},
                                                                                                  "argument": {"variable": "keyLines"}}}}},
                                                                                          "typeScheme": {"variables": [], "body": {"list": {"variable": "hydra.core.packaging.Version"}}, "constraints": []}}],
                                                                                      "body": {
                                                                                        "let": {
                                                                                          "bindings": [
                                                                                            {
                                                                                              "name": "depr",
                                                                                              "term": {
                                                                                                "application": {
                                                                                                  "function": {
                                                                                                    "typeApplication": {"body": {"variable": "hydra.core.lib.optionals.givens"}, "type": {"variable": "hydra.core.packaging.Version"}}},
                                                                                                  "argument": {
                                                                                                    "application": {
                                                                                                      "function": {
                                                                                                        "application": {
                                                                                                          "function": {
                                                                                                            "typeApplication": {
                                                                                                              "body": {"typeApplication": {"body": {"variable": "hydra.core.lib.lists.map"}, "type": {"literal": "string"}}},
                                                                                                              "type": {"optional": {"variable": "hydra.core.packaging.Version"}}}},
                                                                                                          "argument": {
                                                                                                            "application": {
                                                                                                              "function": {
                                                                                                                "lambda": {
                                                                                                                  "parameter": "tag",
                                                                                                                  "domain": {"literal": "string"},
                                                                                                                  "body": {
                                                                                                                    "lambda": {
                                                                                                                      "parameter": "ln",
                                                                                                                      "domain": {"literal": "string"},
                                                                                                                      "body": {
                                                                                                                        "let": {
                                                                                                                          "bindings": [
                                                                                                                            {
                                                                                                                              "name": "parts",
                                                                                                                              "term": {
                                                                                                                                "application": {
                                                                                                                                  "function": {"application": {"function": {"variable": "hydra.core.lib.strings.splitOn"}, "argument": {"literal": {"string": " "}}}},
                                                                                                                                  "argument": {"variable": "ln"}}},
                                                                                                                              "typeScheme": {"variables": [], "body": {"list": {"literal": "string"}}, "constraints": []}}],
                                                                                                                          "body": {
                                                                                                                            "application": {
                                                                                                                              "function": {
                                                                                                                                "application": {
                                                                                                                                  "function": {
                                                                                                                                    "application": {
                                                                                                                                      "function": {
                                                                                                                                        "typeApplication": {
                                                                                                                                          "body": {"variable": "hydra.core.lib.logic.ifElse"},
                                                                                                                                          "type": {"optional": {"variable": "hydra.core.packaging.Version"}}}},
                                                                                                                                      "argument": {
                                                                                                                                        "application": {
                                                                                                                                          "function": {
                                                                                                                                            "application": {
                                                                                                                                              "function": {"typeApplication": {"body": {"variable": "hydra.core.lib.equality.equal"}, "type": {"literal": "string"}}},
                                                                                                                                              "argument": {
                                                                                                                                                "application": {
                                                                                                                                                  "function": {
                                                                                                                                                    "application": {
                                                                                                                                                      "function": {"typeApplication": {"body": {"variable": "hydra.core.lib.optionals.withDefault"}, "type": {"literal": "string"}}},
                                                                                                                                                      "argument": {"literal": {"string": ""}}}},
                                                                                                                                                  "argument": {
                                                                                                                                                    "application": {
                                                                                                                                                      "function": {"typeApplication": {"body": {"variable": "hydra.core.lib.lists.head"}, "type": {"literal": "string"}}},
                                                                                                                                                      "argument": {"variable": "parts"}}}}}}},
                                                                                                                                          "argument": {"variable": "tag"}}}}},
                                                                                                                                  "argument": {
                                                                                                                                    "optional": {
                                                                                                                                      "wrap": {
                                                                                                                                        "typeName": "hydra.core.packaging.Version",
                                                                                                                                        "body": {
                                                                                                                                          "application": {
                                                                                                                                            "function": {"application": {"function": {"variable": "hydra.core.lib.strings.join"}, "argument": {"literal": {"string": " "}}}},
                                                                                                                                            "argument": {
                                                                                                                                              "application": {
                                                                                                                                                "function": {
                                                                                                                                                  "application": {
                                                                                                                                                    "function": {"typeApplication": {"body": {"variable": "hydra.core.lib.lists.drop"}, "type": {"literal": "string"}}},
                                                                                                                                                    "argument": {"literal": {"integer": {"int32": 1}}}}},
                                                                                                                                                "argument": {"variable": "parts"}}}}}}}}}},
                                                                                                                              "argument": {"typeApplication": {"body": {"optional": null}, "type": {"variable": "hydra.core.packaging.Version"}}}}}}}}}}},
                                                                                                              "argument": {"literal": {"string": "@deprecatedSince"}}}}}},
                                                                                                      "argument": {"variable": "keyLines"}}}}},
                                                                                              "typeScheme": {"variables": [], "body": {"list": {"variable": "hydra.core.packaging.Version"}}, "constraints": []}}],
                                                                                          "body": {
                                                                                            "let": {
                                                                                              "bindings": [
                                                                                                {
                                                                                                  "name": "provisions",
                                                                                                  "term": {
                                                                                                    "application": {
                                                                                                      "function": {
                                                                                                        "typeApplication": {"body": {"variable": "hydra.core.lib.optionals.givens"}, "type": {"variable": "hydra.core.packaging.Provision"}}},
                                                                                                      "argument": {
                                                                                                        "application": {
                                                                                                          "function": {
                                                                                                            "application": {
                                                                                                              "function": {
                                                                                                                "typeApplication": {
                                                                                                                  "body": {"typeApplication": {"body": {"variable": "hydra.core.lib.lists.map"}, "type": {"literal": "string"}}},
                                                                                                                  "type": {"optional": {"variable": "hydra.core.packaging.Provision"}}}},
                                                                                                              "argument": {
                                                                                                                "application": {
                                                                                                                  "function": {
                                                                                                                    "lambda": {
                                                                                                                      "parameter": "modName",
                                                                                                                      "domain": {"variable": "hydra.core.packaging.ModuleName"},
                                                                                                                      "body": {
                                                                                                                        "lambda": {
                                                                                                                          "parameter": "ln",
                                                                                                                          "domain": {"literal": "string"},
                                                                                                                          "body": {
                                                                                                                            "let": {
                                                                                                                              "bindings": [
                                                                                                                                {
                                                                                                                                  "name": "tag",
                                                                                                                                  "term": {
                                                                                                                                    "application": {
                                                                                                                                      "function": {
                                                                                                                                        "application": {
                                                                                                                                          "function": {"typeApplication": {"body": {"variable": "hydra.core.lib.optionals.withDefault"}, "type": {"literal": "string"}}},
                                                                                                                                          "argument": {"literal": {"string": ""}}}},
                                                                                                                                      "argument": {
                                                                                                                                        "application": {
                                                                                                                                          "function": {"typeApplication": {"body": {"variable": "hydra.core.lib.lists.head"}, "type": {"literal": "string"}}},
                                                                                                                                          "argument": {
                                                                                                                                            "application": {
                                                                                                                                              "function": {"application": {"function": {"variable": "hydra.core.lib.strings.splitOn"}, "argument": {"literal": {"string": " "}}}},
                                                                                                                                              "argument": {"variable": "ln"}}}}}}},
                                                                                                                                  "typeScheme": {"variables": [], "body": {"literal": "string"}, "constraints": []}}],
                                                                                                                              "body": {
                                                                                                                                "let": {
                                                                                                                                  "bindings": [
                                                                                                                                    {
                                                                                                                                      "name": "afterTag",
                                                                                                                                      "term": {
                                                                                                                                        "application": {
                                                                                                                                          "function": {"application": {"function": {"variable": "hydra.core.lib.strings.join"}, "argument": {"literal": {"string": " "}}}},
                                                                                                                                          "argument": {
                                                                                                                                            "application": {
                                                                                                                                              "function": {
                                                                                                                                                "application": {
                                                                                                                                                  "function": {"typeApplication": {"body": {"variable": "hydra.core.lib.lists.drop"}, "type": {"literal": "string"}}},
                                                                                                                                                  "argument": {"literal": {"integer": {"int32": 1}}}}},
                                                                                                                                              "argument": {
                                                                                                                                                "application": {
                                                                                                                                                  "function": {"application": {"function": {"variable": "hydra.core.lib.strings.splitOn"}, "argument": {"literal": {"string": " "}}}},
                                                                                                                                                  "argument": {"variable": "ln"}}}}}}},
                                                                                                                                      "typeScheme": {"variables": [], "body": {"literal": "string"}, "constraints": []}}],
                                                                                                                                  "body": {
                                                                                                                                    "let": {
                                                                                                                                      "bindings": [
                                                                                                                                        {
                                                                                                                                          "name": "nameAndStmt",
                                                                                                                                          "term": {
                                                                                                                                            "application": {
                                                                                                                                              "function": {"application": {"function": {"variable": "hydra.core.lib.strings.splitOn"}, "argument": {"literal": {"string": ": "}}}},
                                                                                                                                              "argument": {"variable": "afterTag"}}},
                                                                                                                                          "typeScheme": {"variables": [], "body": {"list": {"literal": "string"}}, "constraints": []}}],
                                                                                                                                      "body": {
                                                                                                                                        "let": {
                                                                                                                                          "bindings": [
                                                                                                                                            {
                                                                                                                                              "name": "localName",
                                                                                                                                              "term": {
                                                                                                                                                "application": {
                                                                                                                                                  "function": {
                                                                                                                                                    "application": {
                                                                                                                                                      "function": {"typeApplication": {"body": {"variable": "hydra.core.lib.optionals.withDefault"}, "type": {"literal": "string"}}},
                                                                                                                                                      "argument": {"literal": {"string": ""}}}},
                                                                                                                                                  "argument": {
                                                                                                                                                    "application": {
                                                                                                                                                      "function": {"typeApplication": {"body": {"variable": "hydra.core.lib.lists.head"}, "type": {"literal": "string"}}},
                                                                                                                                                      "argument": {"variable": "nameAndStmt"}}}}},
                                                                                                                                              "typeScheme": {"variables": [], "body": {"literal": "string"}, "constraints": []}}],
                                                                                                                                          "body": {
                                                                                                                                            "let": {
                                                                                                                                              "bindings": [
                                                                                                                                                {
                                                                                                                                                  "name": "stmt",
                                                                                                                                                  "term": {
                                                                                                                                                    "application": {
                                                                                                                                                      "function": {"application": {"function": {"variable": "hydra.core.lib.strings.join"}, "argument": {"literal": {"string": ": "}}}},
                                                                                                                                                      "argument": {
                                                                                                                                                        "application": {
                                                                                                                                                          "function": {
                                                                                                                                                            "application": {
                                                                                                                                                              "function": {"typeApplication": {"body": {"variable": "hydra.core.lib.lists.drop"}, "type": {"literal": "string"}}},
                                                                                                                                                              "argument": {"literal": {"integer": {"int32": 1}}}}},
                                                                                                                                                          "argument": {"variable": "nameAndStmt"}}}}},
                                                                                                                                                  "typeScheme": {"variables": [], "body": {"literal": "string"}, "constraints": []}}],
                                                                                                                                              "body": {
                                                                                                                                                "application": {
                                                                                                                                                  "function": {
                                                                                                                                                    "application": {
                                                                                                                                                      "function": {
                                                                                                                                                        "application": {
                                                                                                                                                          "function": {
                                                                                                                                                            "typeApplication": {
                                                                                                                                                              "body": {"variable": "hydra.core.lib.logic.ifElse"},
                                                                                                                                                              "type": {"optional": {"variable": "hydra.core.packaging.Provision"}}}},
                                                                                                                                                          "argument": {
                                                                                                                                                            "application": {
                                                                                                                                                              "function": {
                                                                                                                                                                "application": {
                                                                                                                                                                  "function": {"typeApplication": {"body": {"variable": "hydra.core.lib.equality.equal"}, "type": {"literal": "string"}}},
                                                                                                                                                                  "argument": {"variable": "tag"}}},
                                                                                                                                                              "argument": {"literal": {"string": "@requirement"}}}}}},
                                                                                                                                                      "argument": {
                                                                                                                                                        "optional": {
                                                                                                                                                          "record": {
                                                                                                                                                            "typeName": "hydra.core.packaging.Provision",
                                                                                                                                                            "fields": [
                                                                                                                                                              {
                                                                                                                                                                "name": "name",
                                                                                                                                                                "term": {
                                                                                                                                                                  "application": {
                                                                                                                                                                    "function": {
                                                                                                                                                                      "application": {"function": {"variable": "hydra.core.parse.packaging.qualifyLocalName"}, "argument": {"variable": "modName"}}},
                                                                                                                                                                    "argument": {"variable": "localName"}}}},
                                                                                                                                                              {
                                                                                                                                                                "name": "kind",
                                                                                                                                                                "term": {"inject": {"typeName": "hydra.core.packaging.ProvisionKind", "field": {"name": "requirement", "term": "unit"}}}},
                                                                                                                                                              {"name": "statement", "term": {"variable": "stmt"}}]}}}}},
                                                                                                                                                  "argument": {
                                                                                                                                                    "application": {
                                                                                                                                                      "function": {
                                                                                                                                                        "application": {
                                                                                                                                                          "function": {
                                                                                                                                                            "application": {
                                                                                                                                                              "function": {
                                                                                                                                                                "typeApplication": {
                                                                                                                                                                  "body": {"variable": "hydra.core.lib.logic.ifElse"},
                                                                                                                                                                  "type": {"optional": {"variable": "hydra.core.packaging.Provision"}}}},
                                                                                                                                                              "argument": {
                                                                                                                                                                "application": {
                                                                                                                                                                  "function": {
                                                                                                                                                                    "application": {
                                                                                                                                                                      "function": {"typeApplication": {"body": {"variable": "hydra.core.lib.equality.equal"}, "type": {"literal": "string"}}},
                                                                                                                                                                      "argument": {"variable": "tag"}}},
                                                                                                                                                                  "argument": {"literal": {"string": "@recommendation"}}}}}},
                                                                                                                                                          "argument": {
                                                                                                                                                            "optional": {
                                                                                                                                                              "record": {
                                                                                                                                                                "typeName": "hydra.core.packaging.Provision",
                                                                                                                                                                "fields": [
                                                                                                                                                                  {
                                                                                                                                                                    "name": "name",
                                                                                                                                                                    "term": {
                                                                                                                                                                      "application": {
                                                                                                                                                                        "function": {
                                                                                                                                                                          "application": {"function": {"variable": "hydra.core.parse.packaging.qualifyLocalName"}, "argument": {"variable": "modName"}}},
                                                                                                                                                                        "argument": {"variable": "localName"}}}},
                                                                                                                                                                  {
                                                                                                                                                                    "name": "kind",
                                                                                                                                                                    "term": {"inject": {"typeName": "hydra.core.packaging.ProvisionKind", "field": {"name": "recommendation", "term": "unit"}}}},
                                                                                                                                                                  {"name": "statement", "term": {"variable": "stmt"}}]}}}}},
                                                                                                                                                      "argument": {"typeApplication": {"body": {"optional": null}, "type": {"variable": "hydra.core.packaging.Provision"}}}}}}}}}}}}}}}}}}}}},
                                                                                                                  "argument": {"variable": "modName"}}}}},
                                                                                                          "argument": {"variable": "keyLines"}}}}},
                                                                                                  "typeScheme": {"variables": [], "body": {"list": {"variable": "hydra.core.packaging.Provision"}}, "constraints": []}}],
                                                                                              "body": {
                                                                                                "let": {
                                                                                                  "bindings": [
                                                                                                    {
                                                                                                      "name": "mlifecycle",
                                                                                                      "term": {
                                                                                                        "application": {
                                                                                                          "function": {
                                                                                                            "application": {
                                                                                                              "function": {
                                                                                                                "application": {
                                                                                                                  "function": {
                                                                                                                    "typeApplication": {
                                                                                                                      "body": {"variable": "hydra.core.lib.logic.ifElse"},
                                                                                                                      "type": {"optional": {"variable": "hydra.core.packaging.LifecycleInfo"}}}},
                                                                                                                  "argument": {
                                                                                                                    "application": {
                                                                                                                      "function": {
                                                                                                                        "application": {
                                                                                                                          "function": {"variable": "hydra.core.lib.logic.and"},
                                                                                                                          "argument": {
                                                                                                                            "application": {
                                                                                                                              "function": {
                                                                                                                                "typeApplication": {"body": {"variable": "hydra.core.lib.lists.isEmpty"}, "type": {"variable": "hydra.core.packaging.Version"}}},
                                                                                                                              "argument": {"variable": "avail"}}}}},
                                                                                                                      "argument": {
                                                                                                                        "application": {
                                                                                                                          "function": {
                                                                                                                            "typeApplication": {"body": {"variable": "hydra.core.lib.lists.isEmpty"}, "type": {"variable": "hydra.core.packaging.Version"}}},
                                                                                                                          "argument": {"variable": "depr"}}}}}}},
                                                                                                              "argument": {"typeApplication": {"body": {"optional": null}, "type": {"variable": "hydra.core.packaging.LifecycleInfo"}}}}},
                                                                                                          "argument": {
                                                                                                            "optional": {
                                                                                                              "record": {
                                                                                                                "typeName": "hydra.core.packaging.LifecycleInfo",
                                                                                                                "fields": [
                                                                                                                  {
                                                                                                                    "name": "availableSince",
                                                                                                                    "term": {
                                                                                                                      "application": {
                                                                                                                        "function": {
                                                                                                                          "typeApplication": {"body": {"variable": "hydra.core.lib.lists.head"}, "type": {"variable": "hydra.core.packaging.Version"}}},
                                                                                                                        "argument": {"variable": "avail"}}}},
                                                                                                                  {
                                                                                                                    "name": "deprecatedSince",
                                                                                                                    "term": {
                                                                                                                      "application": {
                                                                                                                        "function": {
                                                                                                                          "typeApplication": {"body": {"variable": "hydra.core.lib.lists.head"}, "type": {"variable": "hydra.core.packaging.Version"}}},
                                                                                                                        "argument": {"variable": "depr"}}}}]}}}}},
                                                                                                      "typeScheme": {"variables": [], "body": {"optional": {"variable": "hydra.core.packaging.LifecycleInfo"}}, "constraints": []}}],
                                                                                                  "body": {
                                                                                                    "record": {
                                                                                                      "typeName": "hydra.core.packaging.EntityMetadata",
                                                                                                      "fields": [
                                                                                                        {"name": "description", "term": {"variable": "mdesc"}},
                                                                                                        {"name": "comments", "term": {"variable": "comments"}},
                                                                                                        {"name": "seeAlso", "term": {"variable": "seeAlso"}},
                                                                                                        {"name": "lifecycle", "term": {"variable": "mlifecycle"}},
                                                                                                        {"name": "provisions", "term": {"variable": "provisions"}}]}}}}}}}}}}}}}}}}}}}}}}}}}}}},
                                              "argument": {"variable": "modName"}}},
                                          "argument": {"variable": "lns"}}}}}},
                                "typeScheme": {"variables": [], "body": {"optional": {"variable": "hydra.core.packaging.EntityMetadata"}}, "constraints": []}}],
                            "body": {
                              "let": {
                                "bindings": [
                                  {
                                    "name": "sigDocs",
                                    "term": {
                                      "application": {"function": {"variable": "hydra.core.parse.packaging.primitiveDocLines"}, "argument": {"variable": "lns"}}},
                                    "typeScheme": {
                                      "variables": [],
                                      "body": {
                                        "pair": {
                                          "first": {"map": {"keys": {"variable": "hydra.core.model.Name"}, "values": {"literal": "string"}}},
                                          "second": {"optional": {"literal": "string"}}}},
                                      "constraints": []}}],
                                "body": {
                                  "application": {
                                    "function": {
                                      "application": {
                                        "function": {
                                          "typeApplication": {
                                            "body": {
                                              "typeApplication": {
                                                "body": {"variable": "hydra.core.parsers.bind"},
                                                "type": {"pair": {"first": {"literal": "boolean"}, "second": {"literal": "boolean"}}}}},
                                            "type": {"variable": "hydra.core.packaging.Definition"}}},
                                        "argument": {"variable": "hydra.core.parse.packaging.primitiveModifiers"}}},
                                    "argument": {
                                      "lambda": {
                                        "parameter": "mods",
                                        "domain": {"pair": {"first": {"literal": "boolean"}, "second": {"literal": "boolean"}}},
                                        "body": {
                                          "let": {
                                            "bindings": [
                                              {
                                                "name": "isPure",
                                                "term": {
                                                  "application": {
                                                    "function": {
                                                      "typeApplication": {
                                                        "body": {"typeApplication": {"body": {"variable": "hydra.core.lib.pairs.first"}, "type": {"literal": "boolean"}}},
                                                        "type": {"literal": "boolean"}}},
                                                    "argument": {"variable": "mods"}}},
                                                "typeScheme": {"variables": [], "body": {"literal": "boolean"}, "constraints": []}}],
                                            "body": {
                                              "let": {
                                                "bindings": [
                                                  {
                                                    "name": "isTotal",
                                                    "term": {
                                                      "application": {
                                                        "function": {
                                                          "typeApplication": {
                                                            "body": {"typeApplication": {"body": {"variable": "hydra.core.lib.pairs.second"}, "type": {"literal": "boolean"}}},
                                                            "type": {"literal": "boolean"}}},
                                                        "argument": {"variable": "mods"}}},
                                                    "typeScheme": {"variables": [], "body": {"literal": "boolean"}, "constraints": []}}],
                                                "body": {
                                                  "application": {
                                                    "function": {
                                                      "application": {
                                                        "function": {
                                                          "typeApplication": {
                                                            "body": {"typeApplication": {"body": {"variable": "hydra.core.parsers.bind"}, "type": {"literal": "string"}}},
                                                            "type": {"variable": "hydra.core.packaging.Definition"}}},
                                                        "argument": {
                                                          "application": {"function": {"variable": "hydra.core.parse.packaging.keyword"}, "argument": {"literal": {"string": "primitive"}}}}}},
                                                    "argument": {
                                                      "lambda": {
                                                        "parameter": "_",
                                                        "domain": {"literal": "string"},
                                                        "body": {
                                                          "application": {
                                                            "function": {
                                                              "application": {
                                                                "function": {
                                                                  "typeApplication": {
                                                                    "body": {"typeApplication": {"body": {"variable": "hydra.core.parsers.bind"}, "type": {"literal": "string"}}},
                                                                    "type": {"variable": "hydra.core.packaging.Definition"}}},
                                                                "argument": {"variable": "hydra.core.parse.packaging.identifier"}}},
                                                            "argument": {
                                                              "lambda": {
                                                                "parameter": "local",
                                                                "domain": {"literal": "string"},
                                                                "body": {
                                                                  "application": {
                                                                    "function": {
                                                                      "application": {
                                                                        "function": {
                                                                          "typeApplication": {
                                                                            "body": {
                                                                              "typeApplication": {"body": {"variable": "hydra.core.parsers.bind"}, "type": {"variable": "hydra.core.typing.TermSignature"}}},
                                                                            "type": {"variable": "hydra.core.packaging.Definition"}}},
                                                                        "argument": {"variable": "hydra.core.parse.core.primitiveSignature"}}},
                                                                    "argument": {
                                                                      "lambda": {
                                                                        "parameter": "sig0",
                                                                        "domain": {"variable": "hydra.core.typing.TermSignature"},
                                                                        "body": {
                                                                          "let": {
                                                                            "bindings": [
                                                                              {
                                                                                "name": "sig",
                                                                                "term": {
                                                                                  "application": {
                                                                                    "function": {
                                                                                      "application": {
                                                                                        "function": {"variable": "hydra.core.parse.packaging.attachPrimitiveSignatureDocs"},
                                                                                        "argument": {"variable": "sigDocs"}}},
                                                                                    "argument": {"variable": "sig0"}}},
                                                                                "typeScheme": {"variables": [], "body": {"variable": "hydra.core.typing.TermSignature"}, "constraints": []}}],
                                                                            "body": {
                                                                              "application": {
                                                                                "function": {
                                                                                  "application": {
                                                                                    "function": {
                                                                                      "typeApplication": {
                                                                                        "body": {
                                                                                          "typeApplication": {"body": {"variable": "hydra.core.parsers.map"}, "type": {"optional": {"variable": "hydra.core.model.Term"}}}},
                                                                                        "type": {"variable": "hydra.core.packaging.Definition"}}},
                                                                                    "argument": {
                                                                                      "lambda": {
                                                                                        "parameter": "mimpl",
                                                                                        "domain": {"optional": {"variable": "hydra.core.model.Term"}},
                                                                                        "body": {
                                                                                          "inject": {
                                                                                            "typeName": "hydra.core.packaging.Definition",
                                                                                            "field": {
                                                                                              "name": "primitive",
                                                                                              "term": {
                                                                                                "record": {
                                                                                                  "typeName": "hydra.core.packaging.PrimitiveDefinition",
                                                                                                  "fields": [
                                                                                                    {
                                                                                                      "name": "name",
                                                                                                      "term": {
                                                                                                        "application": {
                                                                                                          "function": {
                                                                                                            "application": {"function": {"variable": "hydra.core.parse.packaging.qualifyLocalName"}, "argument": {"variable": "modName"}}},
                                                                                                          "argument": {"variable": "local"}}}},
                                                                                                    {
                                                                                                      "name": "metadata",
                                                                                                      "term": {
                                                                                                        "application": {
                                                                                                          "function": {
                                                                                                            "application": {
                                                                                                              "function": {
                                                                                                                "application": {
                                                                                                                  "function": {"variable": "hydra.core.parse.packaging.requalifyProvisionNamesForPrimitive"},
                                                                                                                  "argument": {"variable": "modName"}}},
                                                                                                              "argument": {"variable": "local"}}},
                                                                                                          "argument": {"variable": "mmeta"}}}},
                                                                                                    {"name": "signature", "term": {"variable": "sig"}},
                                                                                                    {"name": "isPure", "term": {"variable": "isPure"}},
                                                                                                    {"name": "isTotal", "term": {"variable": "isTotal"}},
                                                                                                    {"name": "defaultImplementation", "term": {"variable": "mimpl"}}]}}}}}}}}},
                                                                                "argument": {
                                                                                  "application": {
                                                                                    "function": {
                                                                                      "typeApplication": {"body": {"variable": "hydra.core.parsers.optional"}, "type": {"variable": "hydra.core.model.Term"}}},
                                                                                    "argument": {
                                                                                      "application": {
                                                                                        "function": {
                                                                                          "application": {
                                                                                            "function": {
                                                                                              "typeApplication": {
                                                                                                "body": {"typeApplication": {"body": {"variable": "hydra.core.parsers.bind"}, "type": {"literal": "string"}}},
                                                                                                "type": {"variable": "hydra.core.model.Term"}}},
                                                                                            "argument": {
                                                                                              "application": {"function": {"variable": "hydra.core.parse.packaging.keyword"}, "argument": {"literal": {"string": "="}}}}}},
                                                                                        "argument": {
                                                                                          "lambda": {
                                                                                            "parameter": "_",
                                                                                            "domain": {"literal": "string"},
                                                                                            "body": {
                                                                                              "application": {
                                                                                                "function": {
                                                                                                  "typeApplication": {"body": {"variable": "hydra.core.parse.packaging.token"}, "type": {"variable": "hydra.core.model.Term"}}},
                                                                                                "argument": {
                                                                                                  "application": {
                                                                                                    "function": {
                                                                                                      "application": {
                                                                                                        "function": {
                                                                                                          "typeApplication": {
                                                                                                            "body": {"typeApplication": {"body": {"variable": "hydra.core.parsers.map"}, "type": {"variable": "hydra.core.model.Term"}}},
                                                                                                            "type": {"variable": "hydra.core.model.Term"}}},
                                                                                                        "argument": {"variable": "hydra.core.positions.stripSpans"}}},
                                                                                                    "argument": {"variable": "hydra.core.parse.core.term"}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}},
            "annotation": {
              "map": [
                {
                  "key": {"variable": "description"},
                  "value": {
                    "literal": {
                      "string": "Parse a primitive definition: ['##' doc comment, incl. '@param'/'@return'] '[impure] [partial] primitive name (param: type, ...) : resultType [= term]'"}}}]}}}}},
    {
      "term": {
        "name": "hydra.core.parse.packaging.primitiveDocLines",
        "signature": {
          "typeParameters": [],
          "parameters": [{"name": "arg0", "type": {"list": {"literal": "string"}}, "isLazy": false}],
          "result": {
            "type": {
              "pair": {
                "first": {"map": {"keys": {"variable": "hydra.core.model.Name"}, "values": {"literal": "string"}}},
                "second": {"optional": {"literal": "string"}}}}}},
        "body": {
          "annotated": {
            "body": {
              "lambda": {
                "parameter": "lns",
                "domain": {"list": {"literal": "string"}},
                "body": {
                  "let": {
                    "bindings": [
                      {
                        "name": "sections",
                        "term": {
                          "application": {
                            "function": {
                              "lambda": {
                                "parameter": "lns",
                                "domain": {"list": {"literal": "string"}},
                                "body": {
                                  "let": {
                                    "bindings": [
                                      {
                                        "name": "step",
                                        "term": {
                                          "lambda": {
                                            "parameter": "acc",
                                            "domain": {"list": {"list": {"literal": "string"}}},
                                            "body": {
                                              "lambda": {
                                                "parameter": "ln",
                                                "domain": {"literal": "string"},
                                                "body": {
                                                  "application": {
                                                    "function": {
                                                      "application": {
                                                        "function": {
                                                          "application": {
                                                            "function": {
                                                              "typeApplication": {"body": {"variable": "hydra.core.lib.logic.ifElse"}, "type": {"list": {"list": {"literal": "string"}}}}},
                                                            "argument": {"application": {"function": {"variable": "hydra.core.lib.strings.isEmpty"}, "argument": {"variable": "ln"}}}}},
                                                        "argument": {
                                                          "application": {
                                                            "function": {
                                                              "application": {
                                                                "function": {"typeApplication": {"body": {"variable": "hydra.core.lib.lists.concat2"}, "type": {"list": {"literal": "string"}}}},
                                                                "argument": {"variable": "acc"}}},
                                                            "argument": {"list": [{"typeApplication": {"body": {"list": []}, "type": {"literal": "string"}}}]}}}}},
                                                    "argument": {
                                                      "let": {
                                                        "bindings": [
                                                          {
                                                            "name": "i",
                                                            "term": {
                                                              "application": {
                                                                "function": {
                                                                  "application": {
                                                                    "function": {"typeApplication": {"body": {"variable": "hydra.core.lib.math.sub"}, "type": {"literal": {"integer": "int32"}}}},
                                                                    "argument": {
                                                                      "application": {
                                                                        "function": {"typeApplication": {"body": {"variable": "hydra.core.lib.lists.length"}, "type": {"list": {"literal": "string"}}}},
                                                                        "argument": {"variable": "acc"}}}}},
                                                                "argument": {"literal": {"integer": {"int32": 1}}}}},
                                                            "typeScheme": {"variables": [], "body": {"literal": {"integer": "int32"}}, "constraints": []}}],
                                                        "body": {
                                                          "let": {
                                                            "bindings": [
                                                              {
                                                                "name": "cur",
                                                                "term": {
                                                                  "application": {
                                                                    "function": {
                                                                      "application": {
                                                                        "function": {
                                                                          "typeApplication": {"body": {"variable": "hydra.core.lib.optionals.withDefault"}, "type": {"list": {"literal": "string"}}}},
                                                                        "argument": {"typeApplication": {"body": {"list": []}, "type": {"literal": "string"}}}}},
                                                                    "argument": {
                                                                      "application": {
                                                                        "function": {"typeApplication": {"body": {"variable": "hydra.core.lib.lists.head"}, "type": {"list": {"literal": "string"}}}},
                                                                        "argument": {
                                                                          "application": {
                                                                            "function": {
                                                                              "application": {
                                                                                "function": {"typeApplication": {"body": {"variable": "hydra.core.lib.lists.drop"}, "type": {"list": {"literal": "string"}}}},
                                                                                "argument": {"variable": "i"}}},
                                                                            "argument": {"variable": "acc"}}}}}}},
                                                                "typeScheme": {"variables": [], "body": {"list": {"literal": "string"}}, "constraints": []}}],
                                                            "body": {
                                                              "application": {
                                                                "function": {
                                                                  "application": {
                                                                    "function": {"typeApplication": {"body": {"variable": "hydra.core.lib.lists.concat2"}, "type": {"list": {"literal": "string"}}}},
                                                                    "argument": {
                                                                      "application": {
                                                                        "function": {
                                                                          "application": {
                                                                            "function": {"typeApplication": {"body": {"variable": "hydra.core.lib.lists.take"}, "type": {"list": {"literal": "string"}}}},
                                                                            "argument": {"variable": "i"}}},
                                                                        "argument": {"variable": "acc"}}}}},
                                                                "argument": {
                                                                  "list": [
                                                                    {
                                                                      "application": {
                                                                        "function": {
                                                                          "application": {
                                                                            "function": {"typeApplication": {"body": {"variable": "hydra.core.lib.lists.concat2"}, "type": {"literal": "string"}}},
                                                                            "argument": {"variable": "cur"}}},
                                                                        "argument": {"list": [{"variable": "ln"}]}}}]}}}}}}}}}}}}},
                                        "typeScheme": {
                                          "variables": [],
                                          "body": {
                                            "function": {
                                              "domain": {"list": {"list": {"literal": "string"}}},
                                              "codomain": {"function": {"domain": {"literal": "string"}, "codomain": {"list": {"list": {"literal": "string"}}}}}}},
                                          "constraints": []}}],
                                    "body": {
                                      "application": {
                                        "function": {
                                          "application": {
                                            "function": {"typeApplication": {"body": {"variable": "hydra.core.lib.lists.filter"}, "type": {"list": {"literal": "string"}}}},
                                            "argument": {
                                              "lambda": {
                                                "parameter": "sec",
                                                "domain": {"list": {"literal": "string"}},
                                                "body": {
                                                  "application": {
                                                    "function": {"variable": "hydra.core.lib.logic.not"},
                                                    "argument": {
                                                      "application": {
                                                        "function": {"typeApplication": {"body": {"variable": "hydra.core.lib.lists.isEmpty"}, "type": {"literal": "string"}}},
                                                        "argument": {"variable": "sec"}}}}}}}}},
                                        "argument": {
                                          "application": {
                                            "function": {
                                              "application": {
                                                "function": {
                                                  "application": {
                                                    "function": {
                                                      "typeApplication": {
                                                        "body": {
                                                          "typeApplication": {"body": {"variable": "hydra.core.lib.lists.foldl"}, "type": {"list": {"list": {"literal": "string"}}}}},
                                                        "type": {"literal": "string"}}},
                                                    "argument": {"variable": "step"}}},
                                                "argument": {"list": [{"typeApplication": {"body": {"list": []}, "type": {"literal": "string"}}}]}}},
                                            "argument": {"variable": "lns"}}}}}}}}},
                            "argument": {"variable": "lns"}}},
                        "typeScheme": {"variables": [], "body": {"list": {"list": {"literal": "string"}}}, "constraints": []}}],
                    "body": {
                      "let": {
                        "bindings": [
                          {
                            "name": "isKeySection",
                            "term": {
                              "lambda": {
                                "parameter": "sec",
                                "domain": {"list": {"literal": "string"}},
                                "body": {
                                  "application": {
                                    "function": {
                                      "application": {
                                        "function": {
                                          "application": {
                                            "function": {
                                              "typeApplication": {
                                                "body": {"typeApplication": {"body": {"variable": "hydra.core.lib.optionals.match"}, "type": {"literal": "string"}}},
                                                "type": {"literal": "boolean"}}},
                                            "argument": {
                                              "application": {
                                                "function": {"typeApplication": {"body": {"variable": "hydra.core.lib.lists.head"}, "type": {"literal": "string"}}},
                                                "argument": {"variable": "sec"}}}}},
                                        "argument": {"literal": {"boolean": false}}}},
                                    "argument": {
                                      "lambda": {
                                        "parameter": "s",
                                        "domain": {"literal": "string"},
                                        "body": {
                                          "application": {
                                            "function": {
                                              "application": {
                                                "function": {
                                                  "application": {
                                                    "function": {
                                                      "typeApplication": {
                                                        "body": {"typeApplication": {"body": {"variable": "hydra.core.lib.optionals.match"}, "type": {"literal": {"integer": "int32"}}}},
                                                        "type": {"literal": "boolean"}}},
                                                    "argument": {
                                                      "application": {
                                                        "function": {
                                                          "application": {"function": {"variable": "hydra.core.lib.strings.charAt"}, "argument": {"literal": {"integer": {"int32": 0}}}}},
                                                        "argument": {"variable": "s"}}}}},
                                                "argument": {"literal": {"boolean": false}}}},
                                            "argument": {
                                              "lambda": {
                                                "parameter": "c",
                                                "domain": {"literal": {"integer": "int32"}},
                                                "body": {
                                                  "application": {
                                                    "function": {
                                                      "application": {
                                                        "function": {"typeApplication": {"body": {"variable": "hydra.core.lib.equality.equal"}, "type": {"literal": {"integer": "int32"}}}},
                                                        "argument": {"variable": "c"}}},
                                                    "argument": {"literal": {"integer": {"int32": 64}}}}}}}}}}}}}}},
                            "typeScheme": {
                              "variables": [],
                              "body": {"function": {"domain": {"list": {"literal": "string"}}, "codomain": {"literal": "boolean"}}},
                              "constraints": []}}],
                        "body": {
                          "let": {
                            "bindings": [
                              {
                                "name": "keyLines",
                                "term": {
                                  "application": {
                                    "function": {"typeApplication": {"body": {"variable": "hydra.core.lib.lists.concat"}, "type": {"literal": "string"}}},
                                    "argument": {
                                      "application": {
                                        "function": {
                                          "application": {
                                            "function": {"typeApplication": {"body": {"variable": "hydra.core.lib.lists.filter"}, "type": {"list": {"literal": "string"}}}},
                                            "argument": {"variable": "isKeySection"}}},
                                        "argument": {"variable": "sections"}}}}},
                                "typeScheme": {"variables": [], "body": {"list": {"literal": "string"}}, "constraints": []}}],
                            "body": {
                              "let": {
                                "bindings": [
                                  {
                                    "name": "paramPairs",
                                    "term": {
                                      "application": {
                                        "function": {
                                          "typeApplication": {
                                            "body": {"variable": "hydra.core.lib.optionals.givens"},
                                            "type": {"pair": {"first": {"variable": "hydra.core.model.Name"}, "second": {"literal": "string"}}}}},
                                        "argument": {
                                          "application": {
                                            "function": {
                                              "application": {
                                                "function": {
                                                  "typeApplication": {
                                                    "body": {"typeApplication": {"body": {"variable": "hydra.core.lib.lists.map"}, "type": {"literal": "string"}}},
                                                    "type": {"optional": {"pair": {"first": {"variable": "hydra.core.model.Name"}, "second": {"literal": "string"}}}}}},
                                                "argument": {"variable": "hydra.core.parse.packaging.parseParamLine"}}},
                                            "argument": {"variable": "keyLines"}}}}},
                                    "typeScheme": {
                                      "variables": [],
                                      "body": {"list": {"pair": {"first": {"variable": "hydra.core.model.Name"}, "second": {"literal": "string"}}}},
                                      "constraints": []}}],
                                "body": {
                                  "let": {
                                    "bindings": [
                                      {
                                        "name": "returnLines",
                                        "term": {
                                          "application": {
                                            "function": {"typeApplication": {"body": {"variable": "hydra.core.lib.optionals.givens"}, "type": {"literal": "string"}}},
                                            "argument": {
                                              "application": {
                                                "function": {
                                                  "application": {
                                                    "function": {
                                                      "typeApplication": {
                                                        "body": {"typeApplication": {"body": {"variable": "hydra.core.lib.lists.map"}, "type": {"literal": "string"}}},
                                                        "type": {"optional": {"literal": "string"}}}},
                                                    "argument": {"variable": "hydra.core.parse.packaging.parseReturnLine"}}},
                                                "argument": {"variable": "keyLines"}}}}},
                                        "typeScheme": {"variables": [], "body": {"list": {"literal": "string"}}, "constraints": []}}],
                                    "body": {
                                      "typeApplication": {
                                        "body": {
                                          "typeApplication": {
                                            "body": {
                                              "pair": {
                                                "first": {
                                                  "application": {
                                                    "function": {
                                                      "typeApplication": {
                                                        "body": {
                                                          "typeApplication": {"body": {"variable": "hydra.core.lib.maps.fromList"}, "type": {"variable": "hydra.core.model.Name"}}},
                                                        "type": {"literal": "string"}}},
                                                    "argument": {"variable": "paramPairs"}}},
                                                "second": {
                                                  "application": {
                                                    "function": {"typeApplication": {"body": {"variable": "hydra.core.lib.lists.head"}, "type": {"literal": "string"}}},
                                                    "argument": {"variable": "returnLines"}}}}},
                                            "type": {"map": {"keys": {"variable": "hydra.core.model.Name"}, "values": {"literal": "string"}}}}},
                                        "type": {"optional": {"literal": "string"}}}}}}}}}}}}}}}},
            "annotation": {
              "map": [
                {
                  "key": {"variable": "description"},
                  "value": {"literal": {"string": "Extract '@param'/'@return' key lines from a doc-comment block's raw lines (#837)"}}}]}}}}},
    {
      "term": {
        "name": "hydra.core.parse.packaging.primitiveModifiers",
        "signature": {
          "typeParameters": [],
          "parameters": [],
          "result": {
            "type": {
              "application": {
                "function": {"variable": "hydra.core.parsing.Parser"},
                "argument": {"pair": {"first": {"literal": "boolean"}, "second": {"literal": "boolean"}}}}}}},
        "body": {
          "annotated": {
            "body": {
              "application": {
                "function": {
                  "application": {
                    "function": {
                      "typeApplication": {
                        "body": {"typeApplication": {"body": {"variable": "hydra.core.parsers.bind"}, "type": {"optional": {"literal": "string"}}}},
                        "type": {"pair": {"first": {"literal": "boolean"}, "second": {"literal": "boolean"}}}}},
                    "argument": {
                      "application": {
                        "function": {"typeApplication": {"body": {"variable": "hydra.core.parsers.optional"}, "type": {"literal": "string"}}},
                        "argument": {
                          "application": {"function": {"variable": "hydra.core.parse.packaging.keyword"}, "argument": {"literal": {"string": "impure"}}}}}}}},
                "argument": {
                  "lambda": {
                    "parameter": "mimp",
                    "domain": {"optional": {"literal": "string"}},
                    "body": {
                      "application": {
                        "function": {
                          "application": {
                            "function": {
                              "typeApplication": {
                                "body": {"typeApplication": {"body": {"variable": "hydra.core.parsers.bind"}, "type": {"optional": {"literal": "string"}}}},
                                "type": {"pair": {"first": {"literal": "boolean"}, "second": {"literal": "boolean"}}}}},
                            "argument": {
                              "application": {
                                "function": {"typeApplication": {"body": {"variable": "hydra.core.parsers.optional"}, "type": {"literal": "string"}}},
                                "argument": {
                                  "application": {"function": {"variable": "hydra.core.parse.packaging.keyword"}, "argument": {"literal": {"string": "partial"}}}}}}}},
                        "argument": {
                          "lambda": {
                            "parameter": "mpar",
                            "domain": {"optional": {"literal": "string"}},
                            "body": {
                              "application": {
                                "function": {
                                  "typeApplication": {
                                    "body": {"variable": "hydra.core.parsers.pure"},
                                    "type": {"pair": {"first": {"literal": "boolean"}, "second": {"literal": "boolean"}}}}},
                                "argument": {
                                  "typeApplication": {
                                    "body": {
                                      "typeApplication": {
                                        "body": {
                                          "pair": {
                                            "first": {
                                              "application": {
                                                "function": {"variable": "hydra.core.lib.logic.not"},
                                                "argument": {
                                                  "application": {
                                                    "function": {"typeApplication": {"body": {"variable": "hydra.core.lib.optionals.isGiven"}, "type": {"literal": "string"}}},
                                                    "argument": {"variable": "mimp"}}}}},
                                            "second": {
                                              "application": {
                                                "function": {"variable": "hydra.core.lib.logic.not"},
                                                "argument": {
                                                  "application": {
                                                    "function": {"typeApplication": {"body": {"variable": "hydra.core.lib.optionals.isGiven"}, "type": {"literal": "string"}}},
                                                    "argument": {"variable": "mpar"}}}}}}},
                                        "type": {"literal": "boolean"}}},
                                    "type": {"literal": "boolean"}}}}}}}}}}}}},
            "annotation": {
              "map": [
                {
                  "key": {"variable": "description"},
                  "value": {"literal": {"string": "Parse the optional 'impure'/'partial' primitive-definition modifier keywords"}}}]}}}}},
    {
      "term": {
        "name": "hydra.core.parse.packaging.qualifyLocalName",
        "signature": {
          "typeParameters": [],
          "parameters": [
            {"name": "arg0", "type": {"variable": "hydra.core.packaging.ModuleName"}, "isLazy": false},
            {"name": "arg1", "type": {"literal": "string"}, "isLazy": false}],
          "result": {"type": {"variable": "hydra.core.model.Name"}}},
        "body": {
          "annotated": {
            "body": {
              "lambda": {
                "parameter": "modName",
                "domain": {"variable": "hydra.core.packaging.ModuleName"},
                "body": {
                  "lambda": {
                    "parameter": "local",
                    "domain": {"literal": "string"},
                    "body": {
                      "application": {
                        "function": {"variable": "hydra.core.names.unqualifyName"},
                        "argument": {
                          "record": {
                            "typeName": "hydra.core.util.QualifiedName",
                            "fields": [
                              {"name": "moduleName", "term": {"optional": {"variable": "modName"}}},
                              {"name": "local", "term": {"variable": "local"}}]}}}}}}}},
            "annotation": {
              "map": [
                {
                  "key": {"variable": "description"},
                  "value": {"literal": {"string": "Qualify a bare local identifier into a full Name under the given module"}}}]}}}}},
    {
      "term": {
        "name": "hydra.core.parse.packaging.reattachTermDescriptionToBody",
        "signature": {
          "typeParameters": [],
          "parameters": [
            {"name": "arg0", "type": {"optional": {"variable": "hydra.core.packaging.EntityMetadata"}}, "isLazy": false},
            {"name": "arg1", "type": {"variable": "hydra.core.model.Term"}, "isLazy": false}],
          "result": {
            "type": {
              "pair": {
                "first": {"optional": {"variable": "hydra.core.packaging.EntityMetadata"}},
                "second": {"variable": "hydra.core.model.Term"}}}}},
        "body": {
          "annotated": {
            "body": {
              "lambda": {
                "parameter": "mmeta",
                "domain": {"optional": {"variable": "hydra.core.packaging.EntityMetadata"}},
                "body": {
                  "lambda": {
                    "parameter": "t",
                    "domain": {"variable": "hydra.core.model.Term"},
                    "body": {
                      "application": {
                        "function": {
                          "application": {
                            "function": {
                              "application": {
                                "function": {
                                  "typeApplication": {
                                    "body": {
                                      "typeApplication": {"body": {"variable": "hydra.core.lib.optionals.match"}, "type": {"variable": "hydra.core.packaging.EntityMetadata"}}},
                                    "type": {
                                      "pair": {
                                        "first": {"optional": {"variable": "hydra.core.packaging.EntityMetadata"}},
                                        "second": {"variable": "hydra.core.model.Term"}}}}},
                                "argument": {"variable": "mmeta"}}},
                            "argument": {
                              "typeApplication": {
                                "body": {
                                  "typeApplication": {
                                    "body": {"pair": {"first": {"variable": "mmeta"}, "second": {"variable": "t"}}},
                                    "type": {"optional": {"variable": "hydra.core.packaging.EntityMetadata"}}}},
                                "type": {"variable": "hydra.core.model.Term"}}}}},
                        "argument": {
                          "lambda": {
                            "parameter": "em",
                            "domain": {"variable": "hydra.core.packaging.EntityMetadata"},
                            "body": {
                              "let": {
                                "bindings": [
                                  {
                                    "name": "mdesc",
                                    "term": {
                                      "application": {
                                        "function": {"project": {"typeName": "hydra.core.packaging.EntityMetadata", "fieldName": "description"}},
                                        "argument": {"variable": "em"}}},
                                    "typeScheme": {"variables": [], "body": {"optional": {"literal": "string"}}, "constraints": []}}],
                                "body": {
                                  "application": {
                                    "function": {
                                      "application": {
                                        "function": {
                                          "application": {
                                            "function": {
                                              "typeApplication": {
                                                "body": {"typeApplication": {"body": {"variable": "hydra.core.lib.optionals.match"}, "type": {"literal": "string"}}},
                                                "type": {
                                                  "pair": {
                                                    "first": {"optional": {"variable": "hydra.core.packaging.EntityMetadata"}},
                                                    "second": {"variable": "hydra.core.model.Term"}}}}},
                                            "argument": {"variable": "mdesc"}}},
                                        "argument": {
                                          "typeApplication": {
                                            "body": {
                                              "typeApplication": {
                                                "body": {"pair": {"first": {"variable": "mmeta"}, "second": {"variable": "t"}}},
                                                "type": {"optional": {"variable": "hydra.core.packaging.EntityMetadata"}}}},
                                            "type": {"variable": "hydra.core.model.Term"}}}}},
                                    "argument": {
                                      "lambda": {
                                        "parameter": "d",
                                        "domain": {"literal": "string"},
                                        "body": {
                                          "let": {
                                            "bindings": [
                                              {
                                                "name": "newT",
                                                "term": {
                                                  "application": {
                                                    "function": {
                                                      "application": {"function": {"variable": "hydra.core.annotations.setTermDescription"}, "argument": {"optional": {"variable": "d"}}}},
                                                    "argument": {"variable": "t"}}},
                                                "typeScheme": {"variables": [], "body": {"variable": "hydra.core.model.Term"}, "constraints": []}}],
                                            "body": {
                                              "let": {
                                                "bindings": [
                                                  {
                                                    "name": "restComments",
                                                    "term": {
                                                      "application": {
                                                        "function": {"project": {"typeName": "hydra.core.packaging.EntityMetadata", "fieldName": "comments"}},
                                                        "argument": {"variable": "em"}}},
                                                    "typeScheme": {"variables": [], "body": {"list": {"literal": "string"}}, "constraints": []}}],
                                                "body": {
                                                  "let": {
                                                    "bindings": [
                                                      {
                                                        "name": "restSeeAlso",
                                                        "term": {
                                                          "application": {
                                                            "function": {"project": {"typeName": "hydra.core.packaging.EntityMetadata", "fieldName": "seeAlso"}},
                                                            "argument": {"variable": "em"}}},
                                                        "typeScheme": {"variables": [], "body": {"list": {"variable": "hydra.core.packaging.EntityReference"}}, "constraints": []}}],
                                                    "body": {
                                                      "let": {
                                                        "bindings": [
                                                          {
                                                            "name": "restLifecycle",
                                                            "term": {
                                                              "application": {
                                                                "function": {"project": {"typeName": "hydra.core.packaging.EntityMetadata", "fieldName": "lifecycle"}},
                                                                "argument": {"variable": "em"}}},
                                                            "typeScheme": {"variables": [], "body": {"optional": {"variable": "hydra.core.packaging.LifecycleInfo"}}, "constraints": []}}],
                                                        "body": {
                                                          "let": {
                                                            "bindings": [
                                                              {
                                                                "name": "restProvisions",
                                                                "term": {
                                                                  "application": {
                                                                    "function": {"project": {"typeName": "hydra.core.packaging.EntityMetadata", "fieldName": "provisions"}},
                                                                    "argument": {"variable": "em"}}},
                                                                "typeScheme": {"variables": [], "body": {"list": {"variable": "hydra.core.packaging.Provision"}}, "constraints": []}}],
                                                            "body": {
                                                              "let": {
                                                                "bindings": [
                                                                  {
                                                                    "name": "hasOtherFields",
                                                                    "term": {
                                                                      "application": {
                                                                        "function": {
                                                                          "application": {
                                                                            "function": {"variable": "hydra.core.lib.logic.or"},
                                                                            "argument": {
                                                                              "application": {
                                                                                "function": {"variable": "hydra.core.lib.logic.not"},
                                                                                "argument": {
                                                                                  "application": {
                                                                                    "function": {"typeApplication": {"body": {"variable": "hydra.core.lib.lists.isEmpty"}, "type": {"literal": "string"}}},
                                                                                    "argument": {"variable": "restComments"}}}}}}},
                                                                        "argument": {
                                                                          "application": {
                                                                            "function": {
                                                                              "application": {
                                                                                "function": {"variable": "hydra.core.lib.logic.or"},
                                                                                "argument": {
                                                                                  "application": {
                                                                                    "function": {"variable": "hydra.core.lib.logic.not"},
                                                                                    "argument": {
                                                                                      "application": {
                                                                                        "function": {
                                                                                          "typeApplication": {"body": {"variable": "hydra.core.lib.lists.isEmpty"}, "type": {"variable": "hydra.core.packaging.EntityReference"}}},
                                                                                        "argument": {"variable": "restSeeAlso"}}}}}}},
                                                                            "argument": {
                                                                              "application": {
                                                                                "function": {
                                                                                  "application": {
                                                                                    "function": {"variable": "hydra.core.lib.logic.or"},
                                                                                    "argument": {
                                                                                      "application": {
                                                                                        "function": {
                                                                                          "typeApplication": {"body": {"variable": "hydra.core.lib.optionals.isGiven"}, "type": {"variable": "hydra.core.packaging.LifecycleInfo"}}},
                                                                                        "argument": {"variable": "restLifecycle"}}}}},
                                                                                "argument": {
                                                                                  "application": {
                                                                                    "function": {"variable": "hydra.core.lib.logic.not"},
                                                                                    "argument": {
                                                                                      "application": {
                                                                                        "function": {
                                                                                          "typeApplication": {"body": {"variable": "hydra.core.lib.lists.isEmpty"}, "type": {"variable": "hydra.core.packaging.Provision"}}},
                                                                                        "argument": {"variable": "restProvisions"}}}}}}}}}}},
                                                                    "typeScheme": {"variables": [], "body": {"literal": "boolean"}, "constraints": []}}],
                                                                "body": {
                                                                  "let": {
                                                                    "bindings": [
                                                                      {
                                                                        "name": "newMmeta",
                                                                        "term": {
                                                                          "application": {
                                                                            "function": {
                                                                              "application": {
                                                                                "function": {
                                                                                  "application": {
                                                                                    "function": {
                                                                                      "typeApplication": {
                                                                                        "body": {"variable": "hydra.core.lib.logic.ifElse"},
                                                                                        "type": {"optional": {"variable": "hydra.core.packaging.EntityMetadata"}}}},
                                                                                    "argument": {"variable": "hasOtherFields"}}},
                                                                                "argument": {
                                                                                  "optional": {
                                                                                    "record": {
                                                                                      "typeName": "hydra.core.packaging.EntityMetadata",
                                                                                      "fields": [
                                                                                        {"name": "description", "term": {"typeApplication": {"body": {"optional": null}, "type": {"literal": "string"}}}},
                                                                                        {"name": "comments", "term": {"variable": "restComments"}},
                                                                                        {"name": "seeAlso", "term": {"variable": "restSeeAlso"}},
                                                                                        {"name": "lifecycle", "term": {"variable": "restLifecycle"}},
                                                                                        {"name": "provisions", "term": {"variable": "restProvisions"}}]}}}}},
                                                                            "argument": {"typeApplication": {"body": {"optional": null}, "type": {"variable": "hydra.core.packaging.EntityMetadata"}}}}},
                                                                        "typeScheme": {"variables": [], "body": {"optional": {"variable": "hydra.core.packaging.EntityMetadata"}}, "constraints": []}}],
                                                                    "body": {
                                                                      "typeApplication": {
                                                                        "body": {
                                                                          "typeApplication": {
                                                                            "body": {"pair": {"first": {"variable": "newMmeta"}, "second": {"variable": "newT"}}},
                                                                            "type": {"optional": {"variable": "hydra.core.packaging.EntityMetadata"}}}},
                                                                        "type": {"variable": "hydra.core.model.Term"}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}},
            "annotation": {
              "map": [
                {
                  "key": {"variable": "description"},
                  "value": {
                    "literal": {
                      "string": "Move a term's doc-comment description from EntityMetadata to a body-level '@{description=...}' annotation, matching the DSL-authoring convention (#837 flip byte-identity)"}}}]}}}}},
    {
      "term": {
        "name": "hydra.core.parse.packaging.reattachTypeDescriptionToBody",
        "signature": {
          "typeParameters": [],
          "parameters": [
            {"name": "arg0", "type": {"optional": {"variable": "hydra.core.packaging.EntityMetadata"}}, "isLazy": false},
            {"name": "arg1", "type": {"variable": "hydra.core.model.Type"}, "isLazy": false}],
          "result": {
            "type": {
              "pair": {
                "first": {"optional": {"variable": "hydra.core.packaging.EntityMetadata"}},
                "second": {"variable": "hydra.core.model.Type"}}}}},
        "body": {
          "annotated": {
            "body": {
              "lambda": {
                "parameter": "mmeta",
                "domain": {"optional": {"variable": "hydra.core.packaging.EntityMetadata"}},
                "body": {
                  "lambda": {
                    "parameter": "t",
                    "domain": {"variable": "hydra.core.model.Type"},
                    "body": {
                      "application": {
                        "function": {
                          "application": {
                            "function": {
                              "application": {
                                "function": {
                                  "typeApplication": {
                                    "body": {
                                      "typeApplication": {"body": {"variable": "hydra.core.lib.optionals.match"}, "type": {"variable": "hydra.core.packaging.EntityMetadata"}}},
                                    "type": {
                                      "pair": {
                                        "first": {"optional": {"variable": "hydra.core.packaging.EntityMetadata"}},
                                        "second": {"variable": "hydra.core.model.Type"}}}}},
                                "argument": {"variable": "mmeta"}}},
                            "argument": {
                              "typeApplication": {
                                "body": {
                                  "typeApplication": {
                                    "body": {"pair": {"first": {"variable": "mmeta"}, "second": {"variable": "t"}}},
                                    "type": {"optional": {"variable": "hydra.core.packaging.EntityMetadata"}}}},
                                "type": {"variable": "hydra.core.model.Type"}}}}},
                        "argument": {
                          "lambda": {
                            "parameter": "em",
                            "domain": {"variable": "hydra.core.packaging.EntityMetadata"},
                            "body": {
                              "let": {
                                "bindings": [
                                  {
                                    "name": "mdesc",
                                    "term": {
                                      "application": {
                                        "function": {"project": {"typeName": "hydra.core.packaging.EntityMetadata", "fieldName": "description"}},
                                        "argument": {"variable": "em"}}},
                                    "typeScheme": {"variables": [], "body": {"optional": {"literal": "string"}}, "constraints": []}}],
                                "body": {
                                  "application": {
                                    "function": {
                                      "application": {
                                        "function": {
                                          "application": {
                                            "function": {
                                              "typeApplication": {
                                                "body": {"typeApplication": {"body": {"variable": "hydra.core.lib.optionals.match"}, "type": {"literal": "string"}}},
                                                "type": {
                                                  "pair": {
                                                    "first": {"optional": {"variable": "hydra.core.packaging.EntityMetadata"}},
                                                    "second": {"variable": "hydra.core.model.Type"}}}}},
                                            "argument": {"variable": "mdesc"}}},
                                        "argument": {
                                          "typeApplication": {
                                            "body": {
                                              "typeApplication": {
                                                "body": {"pair": {"first": {"variable": "mmeta"}, "second": {"variable": "t"}}},
                                                "type": {"optional": {"variable": "hydra.core.packaging.EntityMetadata"}}}},
                                            "type": {"variable": "hydra.core.model.Type"}}}}},
                                    "argument": {
                                      "lambda": {
                                        "parameter": "d",
                                        "domain": {"literal": "string"},
                                        "body": {
                                          "let": {
                                            "bindings": [
                                              {
                                                "name": "newT",
                                                "term": {
                                                  "application": {
                                                    "function": {
                                                      "application": {"function": {"variable": "hydra.core.annotations.setTypeDescription"}, "argument": {"optional": {"variable": "d"}}}},
                                                    "argument": {"variable": "t"}}},
                                                "typeScheme": {"variables": [], "body": {"variable": "hydra.core.model.Type"}, "constraints": []}}],
                                            "body": {
                                              "let": {
                                                "bindings": [
                                                  {
                                                    "name": "restComments",
                                                    "term": {
                                                      "application": {
                                                        "function": {"project": {"typeName": "hydra.core.packaging.EntityMetadata", "fieldName": "comments"}},
                                                        "argument": {"variable": "em"}}},
                                                    "typeScheme": {"variables": [], "body": {"list": {"literal": "string"}}, "constraints": []}}],
                                                "body": {
                                                  "let": {
                                                    "bindings": [
                                                      {
                                                        "name": "restSeeAlso",
                                                        "term": {
                                                          "application": {
                                                            "function": {"project": {"typeName": "hydra.core.packaging.EntityMetadata", "fieldName": "seeAlso"}},
                                                            "argument": {"variable": "em"}}},
                                                        "typeScheme": {"variables": [], "body": {"list": {"variable": "hydra.core.packaging.EntityReference"}}, "constraints": []}}],
                                                    "body": {
                                                      "let": {
                                                        "bindings": [
                                                          {
                                                            "name": "restLifecycle",
                                                            "term": {
                                                              "application": {
                                                                "function": {"project": {"typeName": "hydra.core.packaging.EntityMetadata", "fieldName": "lifecycle"}},
                                                                "argument": {"variable": "em"}}},
                                                            "typeScheme": {"variables": [], "body": {"optional": {"variable": "hydra.core.packaging.LifecycleInfo"}}, "constraints": []}}],
                                                        "body": {
                                                          "let": {
                                                            "bindings": [
                                                              {
                                                                "name": "restProvisions",
                                                                "term": {
                                                                  "application": {
                                                                    "function": {"project": {"typeName": "hydra.core.packaging.EntityMetadata", "fieldName": "provisions"}},
                                                                    "argument": {"variable": "em"}}},
                                                                "typeScheme": {"variables": [], "body": {"list": {"variable": "hydra.core.packaging.Provision"}}, "constraints": []}}],
                                                            "body": {
                                                              "let": {
                                                                "bindings": [
                                                                  {
                                                                    "name": "hasOtherFields",
                                                                    "term": {
                                                                      "application": {
                                                                        "function": {
                                                                          "application": {
                                                                            "function": {"variable": "hydra.core.lib.logic.or"},
                                                                            "argument": {
                                                                              "application": {
                                                                                "function": {"variable": "hydra.core.lib.logic.not"},
                                                                                "argument": {
                                                                                  "application": {
                                                                                    "function": {"typeApplication": {"body": {"variable": "hydra.core.lib.lists.isEmpty"}, "type": {"literal": "string"}}},
                                                                                    "argument": {"variable": "restComments"}}}}}}},
                                                                        "argument": {
                                                                          "application": {
                                                                            "function": {
                                                                              "application": {
                                                                                "function": {"variable": "hydra.core.lib.logic.or"},
                                                                                "argument": {
                                                                                  "application": {
                                                                                    "function": {"variable": "hydra.core.lib.logic.not"},
                                                                                    "argument": {
                                                                                      "application": {
                                                                                        "function": {
                                                                                          "typeApplication": {"body": {"variable": "hydra.core.lib.lists.isEmpty"}, "type": {"variable": "hydra.core.packaging.EntityReference"}}},
                                                                                        "argument": {"variable": "restSeeAlso"}}}}}}},
                                                                            "argument": {
                                                                              "application": {
                                                                                "function": {
                                                                                  "application": {
                                                                                    "function": {"variable": "hydra.core.lib.logic.or"},
                                                                                    "argument": {
                                                                                      "application": {
                                                                                        "function": {
                                                                                          "typeApplication": {"body": {"variable": "hydra.core.lib.optionals.isGiven"}, "type": {"variable": "hydra.core.packaging.LifecycleInfo"}}},
                                                                                        "argument": {"variable": "restLifecycle"}}}}},
                                                                                "argument": {
                                                                                  "application": {
                                                                                    "function": {"variable": "hydra.core.lib.logic.not"},
                                                                                    "argument": {
                                                                                      "application": {
                                                                                        "function": {
                                                                                          "typeApplication": {"body": {"variable": "hydra.core.lib.lists.isEmpty"}, "type": {"variable": "hydra.core.packaging.Provision"}}},
                                                                                        "argument": {"variable": "restProvisions"}}}}}}}}}}},
                                                                    "typeScheme": {"variables": [], "body": {"literal": "boolean"}, "constraints": []}}],
                                                                "body": {
                                                                  "let": {
                                                                    "bindings": [
                                                                      {
                                                                        "name": "newMmeta",
                                                                        "term": {
                                                                          "application": {
                                                                            "function": {
                                                                              "application": {
                                                                                "function": {
                                                                                  "application": {
                                                                                    "function": {
                                                                                      "typeApplication": {
                                                                                        "body": {"variable": "hydra.core.lib.logic.ifElse"},
                                                                                        "type": {"optional": {"variable": "hydra.core.packaging.EntityMetadata"}}}},
                                                                                    "argument": {"variable": "hasOtherFields"}}},
                                                                                "argument": {
                                                                                  "optional": {
                                                                                    "record": {
                                                                                      "typeName": "hydra.core.packaging.EntityMetadata",
                                                                                      "fields": [
                                                                                        {"name": "description", "term": {"typeApplication": {"body": {"optional": null}, "type": {"literal": "string"}}}},
                                                                                        {"name": "comments", "term": {"variable": "restComments"}},
                                                                                        {"name": "seeAlso", "term": {"variable": "restSeeAlso"}},
                                                                                        {"name": "lifecycle", "term": {"variable": "restLifecycle"}},
                                                                                        {"name": "provisions", "term": {"variable": "restProvisions"}}]}}}}},
                                                                            "argument": {"typeApplication": {"body": {"optional": null}, "type": {"variable": "hydra.core.packaging.EntityMetadata"}}}}},
                                                                        "typeScheme": {"variables": [], "body": {"optional": {"variable": "hydra.core.packaging.EntityMetadata"}}, "constraints": []}}],
                                                                    "body": {
                                                                      "typeApplication": {
                                                                        "body": {
                                                                          "typeApplication": {
                                                                            "body": {"pair": {"first": {"variable": "newMmeta"}, "second": {"variable": "newT"}}},
                                                                            "type": {"optional": {"variable": "hydra.core.packaging.EntityMetadata"}}}},
                                                                        "type": {"variable": "hydra.core.model.Type"}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}},
            "annotation": {
              "map": [
                {
                  "key": {"variable": "description"},
                  "value": {
                    "literal": {
                      "string": "Move a type's doc-comment description from EntityMetadata to a body-level '@{description=...}' annotation, matching the DSL-authoring convention (#837 flip byte-identity)"}}}]}}}}},
    {
      "term": {
        "name": "hydra.core.parse.packaging.requalifyProvisionNamesForPrimitive",
        "signature": {
          "typeParameters": [],
          "parameters": [
            {"name": "arg0", "type": {"variable": "hydra.core.packaging.ModuleName"}, "isLazy": false},
            {"name": "arg1", "type": {"literal": "string"}, "isLazy": false},
            {"name": "arg2", "type": {"optional": {"variable": "hydra.core.packaging.EntityMetadata"}}, "isLazy": false}],
          "result": {"type": {"optional": {"variable": "hydra.core.packaging.EntityMetadata"}}}},
        "body": {
          "annotated": {
            "body": {
              "lambda": {
                "parameter": "modName",
                "domain": {"variable": "hydra.core.packaging.ModuleName"},
                "body": {
                  "lambda": {
                    "parameter": "local",
                    "domain": {"literal": "string"},
                    "body": {
                      "lambda": {
                        "parameter": "mmeta",
                        "domain": {"optional": {"variable": "hydra.core.packaging.EntityMetadata"}},
                        "body": {
                          "application": {
                            "function": {
                              "application": {
                                "function": {
                                  "typeApplication": {
                                    "body": {
                                      "typeApplication": {"body": {"variable": "hydra.core.lib.optionals.map"}, "type": {"variable": "hydra.core.packaging.EntityMetadata"}}},
                                    "type": {"variable": "hydra.core.packaging.EntityMetadata"}}},
                                "argument": {
                                  "lambda": {
                                    "parameter": "em",
                                    "domain": {"variable": "hydra.core.packaging.EntityMetadata"},
                                    "body": {
                                      "let": {
                                        "bindings": [
                                          {
                                            "name": "oldProvisions",
                                            "term": {
                                              "application": {
                                                "function": {"project": {"typeName": "hydra.core.packaging.EntityMetadata", "fieldName": "provisions"}},
                                                "argument": {"variable": "em"}}},
                                            "typeScheme": {"variables": [], "body": {"list": {"variable": "hydra.core.packaging.Provision"}}, "constraints": []}}],
                                        "body": {
                                          "let": {
                                            "bindings": [
                                              {
                                                "name": "requalify",
                                                "term": {
                                                  "lambda": {
                                                    "parameter": "p",
                                                    "domain": {"variable": "hydra.core.packaging.Provision"},
                                                    "body": {
                                                      "let": {
                                                        "bindings": [
                                                          {
                                                            "name": "oldName",
                                                            "term": {
                                                              "application": {
                                                                "function": {"variable": "hydra.core.names.localNameOf"},
                                                                "argument": {
                                                                  "application": {
                                                                    "function": {"project": {"typeName": "hydra.core.packaging.Provision", "fieldName": "name"}},
                                                                    "argument": {"variable": "p"}}}}},
                                                            "typeScheme": {"variables": [], "body": {"literal": "string"}, "constraints": []}}],
                                                        "body": {
                                                          "let": {
                                                            "bindings": [
                                                              {
                                                                "name": "newName",
                                                                "term": {
                                                                  "wrap": {
                                                                    "typeName": "hydra.core.model.Name",
                                                                    "body": {
                                                                      "application": {
                                                                        "function": {"variable": "hydra.core.lib.strings.concat"},
                                                                        "argument": {
                                                                          "list": [
                                                                            {"application": {"function": {"unwrap": "hydra.core.packaging.ModuleName"}, "argument": {"variable": "modName"}}},
                                                                            {"literal": {"string": "."}},
                                                                            {"variable": "local"},
                                                                            {"literal": {"string": "."}},
                                                                            {"variable": "oldName"}]}}}}},
                                                                "typeScheme": {"variables": [], "body": {"variable": "hydra.core.model.Name"}, "constraints": []}}],
                                                            "body": {
                                                              "record": {
                                                                "typeName": "hydra.core.packaging.Provision",
                                                                "fields": [
                                                                  {"name": "name", "term": {"variable": "newName"}},
                                                                  {
                                                                    "name": "kind",
                                                                    "term": {
                                                                      "application": {
                                                                        "function": {"project": {"typeName": "hydra.core.packaging.Provision", "fieldName": "kind"}},
                                                                        "argument": {"variable": "p"}}}},
                                                                  {
                                                                    "name": "statement",
                                                                    "term": {
                                                                      "application": {
                                                                        "function": {"project": {"typeName": "hydra.core.packaging.Provision", "fieldName": "statement"}},
                                                                        "argument": {"variable": "p"}}}}]}}}}}}}},
                                                "typeScheme": {
                                                  "variables": [],
                                                  "body": {
                                                    "function": {"domain": {"variable": "hydra.core.packaging.Provision"}, "codomain": {"variable": "hydra.core.packaging.Provision"}}},
                                                  "constraints": []}}],
                                            "body": {
                                              "record": {
                                                "typeName": "hydra.core.packaging.EntityMetadata",
                                                "fields": [
                                                  {
                                                    "name": "description",
                                                    "term": {
                                                      "application": {
                                                        "function": {"project": {"typeName": "hydra.core.packaging.EntityMetadata", "fieldName": "description"}},
                                                        "argument": {"variable": "em"}}}},
                                                  {
                                                    "name": "comments",
                                                    "term": {
                                                      "application": {
                                                        "function": {"project": {"typeName": "hydra.core.packaging.EntityMetadata", "fieldName": "comments"}},
                                                        "argument": {"variable": "em"}}}},
                                                  {
                                                    "name": "seeAlso",
                                                    "term": {
                                                      "application": {
                                                        "function": {"project": {"typeName": "hydra.core.packaging.EntityMetadata", "fieldName": "seeAlso"}},
                                                        "argument": {"variable": "em"}}}},
                                                  {
                                                    "name": "lifecycle",
                                                    "term": {
                                                      "application": {
                                                        "function": {"project": {"typeName": "hydra.core.packaging.EntityMetadata", "fieldName": "lifecycle"}},
                                                        "argument": {"variable": "em"}}}},
                                                  {
                                                    "name": "provisions",
                                                    "term": {
                                                      "application": {
                                                        "function": {
                                                          "application": {
                                                            "function": {
                                                              "typeApplication": {
                                                                "body": {
                                                                  "typeApplication": {"body": {"variable": "hydra.core.lib.lists.map"}, "type": {"variable": "hydra.core.packaging.Provision"}}},
                                                                "type": {"variable": "hydra.core.packaging.Provision"}}},
                                                            "argument": {"variable": "requalify"}}},
                                                        "argument": {"variable": "oldProvisions"}}}}]}}}}}}}}}},
                            "argument": {"variable": "mmeta"}}}}}}}}},
            "annotation": {
              "map": [
                {
                  "key": {"variable": "description"},
                  "value": {"literal": {"string": "Requalify a primitive's provision names to '<module>.<primitive>.<name>' (#711/#837)"}}}]}}}}},
    {
      "term": {
        "name": "hydra.core.parse.packaging.resolveNameRefWith",
        "signature": {
          "typeParameters": [],
          "parameters": [
            {"name": "arg0", "type": {"variable": "hydra.core.packaging.ModuleName"}, "isLazy": false},
            {"name": "arg1", "type": {"set": {"literal": "string"}}, "isLazy": false},
            {
              "name": "arg2",
              "type": {
                "map": {"keys": {"variable": "hydra.core.packaging.ModuleName"}, "values": {"set": {"variable": "hydra.core.model.Name"}}}},
              "isLazy": false},
            {"name": "arg3", "type": {"variable": "hydra.core.model.Name"}, "isLazy": false}],
          "result": {"type": {"either": {"left": {"literal": "string"}, "right": {"variable": "hydra.core.model.Name"}}}}},
        "body": {
          "annotated": {
            "body": {
              "lambda": {
                "parameter": "modName",
                "domain": {"variable": "hydra.core.packaging.ModuleName"},
                "body": {
                  "lambda": {
                    "parameter": "ownNames",
                    "domain": {"set": {"literal": "string"}},
                    "body": {
                      "lambda": {
                        "parameter": "universe",
                        "domain": {
                          "map": {"keys": {"variable": "hydra.core.packaging.ModuleName"}, "values": {"set": {"variable": "hydra.core.model.Name"}}}},
                        "body": {
                          "lambda": {
                            "parameter": "n",
                            "domain": {"variable": "hydra.core.model.Name"},
                            "body": {
                              "let": {
                                "bindings": [
                                  {
                                    "name": "s",
                                    "term": {"application": {"function": {"unwrap": "hydra.core.model.Name"}, "argument": {"variable": "n"}}},
                                    "typeScheme": {"variables": [], "body": {"literal": "string"}, "constraints": []}}],
                                "body": {
                                  "application": {
                                    "function": {
                                      "application": {
                                        "function": {
                                          "application": {
                                            "function": {
                                              "typeApplication": {
                                                "body": {"variable": "hydra.core.lib.logic.ifElse"},
                                                "type": {"either": {"left": {"literal": "string"}, "right": {"variable": "hydra.core.model.Name"}}}}},
                                            "argument": {
                                              "application": {
                                                "function": {"variable": "hydra.core.lib.logic.not"},
                                                "argument": {
                                                  "application": {
                                                    "function": {
                                                      "application": {
                                                        "function": {"typeApplication": {"body": {"variable": "hydra.core.lib.equality.equal"}, "type": {"literal": {"integer": "int32"}}}},
                                                        "argument": {
                                                          "application": {
                                                            "function": {"typeApplication": {"body": {"variable": "hydra.core.lib.lists.length"}, "type": {"literal": "string"}}},
                                                            "argument": {
                                                              "application": {
                                                                "function": {"application": {"function": {"variable": "hydra.core.lib.strings.splitOn"}, "argument": {"literal": {"string": "."}}}},
                                                                "argument": {"variable": "s"}}}}}}},
                                                    "argument": {"literal": {"integer": {"int32": 1}}}}}}}}},
                                        "argument": {
                                          "typeApplication": {
                                            "body": {"typeApplication": {"body": {"either": {"right": {"variable": "n"}}}, "type": {"literal": "string"}}},
                                            "type": {"variable": "hydra.core.model.Name"}}}}},
                                    "argument": {
                                      "application": {
                                        "function": {
                                          "application": {
                                            "function": {
                                              "application": {
                                                "function": {
                                                  "typeApplication": {
                                                    "body": {"variable": "hydra.core.lib.logic.ifElse"},
                                                    "type": {"either": {"left": {"literal": "string"}, "right": {"variable": "hydra.core.model.Name"}}}}},
                                                "argument": {
                                                  "application": {
                                                    "function": {
                                                      "application": {
                                                        "function": {"typeApplication": {"body": {"variable": "hydra.core.lib.sets.member"}, "type": {"literal": "string"}}},
                                                        "argument": {"variable": "s"}}},
                                                    "argument": {"variable": "ownNames"}}}}},
                                            "argument": {
                                              "typeApplication": {
                                                "body": {
                                                  "typeApplication": {
                                                    "body": {
                                                      "either": {
                                                        "right": {
                                                          "application": {
                                                            "function": {"application": {"function": {"variable": "hydra.core.names.qname"}, "argument": {"variable": "modName"}}},
                                                            "argument": {"variable": "s"}}}}},
                                                    "type": {"literal": "string"}}},
                                                "type": {"variable": "hydra.core.model.Name"}}}}},
                                        "argument": {
                                          "let": {
                                            "bindings": [
                                              {
                                                "name": "owners",
                                                "term": {
                                                  "application": {
                                                    "function": {
                                                      "application": {
                                                        "function": {
                                                          "typeApplication": {
                                                            "body": {"variable": "hydra.core.lib.lists.filter"},
                                                            "type": {
                                                              "pair": {"first": {"variable": "hydra.core.packaging.ModuleName"}, "second": {"set": {"variable": "hydra.core.model.Name"}}}}}},
                                                        "argument": {
                                                          "lambda": {
                                                            "parameter": "entry",
                                                            "domain": {
                                                              "pair": {"first": {"variable": "hydra.core.packaging.ModuleName"}, "second": {"set": {"variable": "hydra.core.model.Name"}}}},
                                                            "body": {
                                                              "application": {
                                                                "function": {
                                                                  "application": {
                                                                    "function": {"variable": "hydra.core.lib.logic.and"},
                                                                    "argument": {
                                                                      "application": {
                                                                        "function": {"variable": "hydra.core.lib.logic.not"},
                                                                        "argument": {
                                                                          "application": {
                                                                            "function": {
                                                                              "application": {
                                                                                "function": {
                                                                                  "typeApplication": {"body": {"variable": "hydra.core.lib.equality.equal"}, "type": {"variable": "hydra.core.packaging.ModuleName"}}},
                                                                                "argument": {
                                                                                  "application": {
                                                                                    "function": {
                                                                                      "typeApplication": {
                                                                                        "body": {
                                                                                          "typeApplication": {"body": {"variable": "hydra.core.lib.pairs.first"}, "type": {"variable": "hydra.core.packaging.ModuleName"}}},
                                                                                        "type": {"set": {"variable": "hydra.core.model.Name"}}}},
                                                                                    "argument": {"variable": "entry"}}}}},
                                                                            "argument": {"variable": "modName"}}}}}}},
                                                                "argument": {
                                                                  "application": {
                                                                    "function": {
                                                                      "application": {
                                                                        "function": {"typeApplication": {"body": {"variable": "hydra.core.lib.sets.member"}, "type": {"literal": "string"}}},
                                                                        "argument": {"variable": "s"}}},
                                                                    "argument": {
                                                                      "application": {
                                                                        "function": {
                                                                          "application": {
                                                                            "function": {
                                                                              "typeApplication": {
                                                                                "body": {"typeApplication": {"body": {"variable": "hydra.core.lib.sets.map"}, "type": {"variable": "hydra.core.model.Name"}}},
                                                                                "type": {"literal": "string"}}},
                                                                            "argument": {"variable": "hydra.core.names.localNameOf"}}},
                                                                        "argument": {
                                                                          "application": {
                                                                            "function": {
                                                                              "typeApplication": {
                                                                                "body": {
                                                                                  "typeApplication": {"body": {"variable": "hydra.core.lib.pairs.second"}, "type": {"variable": "hydra.core.packaging.ModuleName"}}},
                                                                                "type": {"set": {"variable": "hydra.core.model.Name"}}}},
                                                                            "argument": {"variable": "entry"}}}}}}}}}}}}},
                                                    "argument": {
                                                      "application": {
                                                        "function": {
                                                          "typeApplication": {
                                                            "body": {
                                                              "typeApplication": {"body": {"variable": "hydra.core.lib.maps.toList"}, "type": {"variable": "hydra.core.packaging.ModuleName"}}},
                                                            "type": {"set": {"variable": "hydra.core.model.Name"}}}},
                                                        "argument": {"variable": "universe"}}}}},
                                                "typeScheme": {
                                                  "variables": [],
                                                  "body": {
                                                    "list": {
                                                      "pair": {"first": {"variable": "hydra.core.packaging.ModuleName"}, "second": {"set": {"variable": "hydra.core.model.Name"}}}}},
                                                  "constraints": []}}],
                                            "body": {
                                              "application": {
                                                "function": {
                                                  "application": {
                                                    "function": {
                                                      "application": {
                                                        "function": {
                                                          "typeApplication": {
                                                            "body": {"variable": "hydra.core.lib.logic.ifElse"},
                                                            "type": {"either": {"left": {"literal": "string"}, "right": {"variable": "hydra.core.model.Name"}}}}},
                                                        "argument": {
                                                          "application": {
                                                            "function": {
                                                              "application": {
                                                                "function": {"typeApplication": {"body": {"variable": "hydra.core.lib.equality.equal"}, "type": {"literal": {"integer": "int32"}}}},
                                                                "argument": {
                                                                  "application": {
                                                                    "function": {
                                                                      "typeApplication": {
                                                                        "body": {"variable": "hydra.core.lib.lists.length"},
                                                                        "type": {
                                                                          "pair": {"first": {"variable": "hydra.core.packaging.ModuleName"}, "second": {"set": {"variable": "hydra.core.model.Name"}}}}}},
                                                                    "argument": {"variable": "owners"}}}}},
                                                            "argument": {"literal": {"integer": {"int32": 1}}}}}}},
                                                    "argument": {
                                                      "let": {
                                                        "bindings": [
                                                          {
                                                            "name": "owner",
                                                            "term": {
                                                              "application": {
                                                                "function": {
                                                                  "typeApplication": {
                                                                    "body": {
                                                                      "typeApplication": {"body": {"variable": "hydra.core.lib.pairs.first"}, "type": {"variable": "hydra.core.packaging.ModuleName"}}},
                                                                    "type": {"set": {"variable": "hydra.core.model.Name"}}}},
                                                                "argument": {
                                                                  "application": {
                                                                    "function": {
                                                                      "application": {
                                                                        "function": {
                                                                          "typeApplication": {
                                                                            "body": {"variable": "hydra.core.lib.optionals.withDefault"},
                                                                            "type": {
                                                                              "pair": {"first": {"variable": "hydra.core.packaging.ModuleName"}, "second": {"set": {"variable": "hydra.core.model.Name"}}}}}},
                                                                        "argument": {
                                                                          "typeApplication": {
                                                                            "body": {
                                                                              "typeApplication": {
                                                                                "body": {
                                                                                  "pair": {
                                                                                    "first": {"variable": "modName"},
                                                                                    "second": {"typeApplication": {"body": {"variable": "hydra.core.lib.sets.empty"}, "type": {"variable": "hydra.core.model.Name"}}}}},
                                                                                "type": {"variable": "hydra.core.packaging.ModuleName"}}},
                                                                            "type": {"set": {"variable": "hydra.core.model.Name"}}}}}},
                                                                    "argument": {
                                                                      "application": {
                                                                        "function": {
                                                                          "typeApplication": {
                                                                            "body": {"variable": "hydra.core.lib.lists.head"},
                                                                            "type": {
                                                                              "pair": {"first": {"variable": "hydra.core.packaging.ModuleName"}, "second": {"set": {"variable": "hydra.core.model.Name"}}}}}},
                                                                        "argument": {"variable": "owners"}}}}}}},
                                                            "typeScheme": {"variables": [], "body": {"variable": "hydra.core.packaging.ModuleName"}, "constraints": []}}],
                                                        "body": {
                                                          "typeApplication": {
                                                            "body": {
                                                              "typeApplication": {
                                                                "body": {
                                                                  "either": {
                                                                    "right": {
                                                                      "application": {
                                                                        "function": {"application": {"function": {"variable": "hydra.core.names.qname"}, "argument": {"variable": "owner"}}},
                                                                        "argument": {"variable": "s"}}}}},
                                                                "type": {"literal": "string"}}},
                                                            "type": {"variable": "hydra.core.model.Name"}}}}}}},
                                                "argument": {
                                                  "application": {
                                                    "function": {
                                                      "application": {
                                                        "function": {
                                                          "application": {
                                                            "function": {
                                                              "typeApplication": {
                                                                "body": {"variable": "hydra.core.lib.logic.ifElse"},
                                                                "type": {"either": {"left": {"literal": "string"}, "right": {"variable": "hydra.core.model.Name"}}}}},
                                                            "argument": {
                                                              "application": {
                                                                "function": {
                                                                  "application": {
                                                                    "function": {"typeApplication": {"body": {"variable": "hydra.core.lib.equality.equal"}, "type": {"literal": {"integer": "int32"}}}},
                                                                    "argument": {
                                                                      "application": {
                                                                        "function": {
                                                                          "typeApplication": {
                                                                            "body": {"variable": "hydra.core.lib.lists.length"},
                                                                            "type": {
                                                                              "pair": {"first": {"variable": "hydra.core.packaging.ModuleName"}, "second": {"set": {"variable": "hydra.core.model.Name"}}}}}},
                                                                        "argument": {"variable": "owners"}}}}},
                                                                "argument": {"literal": {"integer": {"int32": 0}}}}}}},
                                                        "argument": {
                                                          "typeApplication": {
                                                            "body": {
                                                              "typeApplication": {
                                                                "body": {
                                                                  "either": {
                                                                    "left": {
                                                                      "application": {
                                                                        "function": {"variable": "hydra.core.lib.strings.concat"},
                                                                        "argument": {
                                                                          "list": [
                                                                            {"literal": {"string": "unresolved bare name reference: '"}},
                                                                            {"variable": "s"},
                                                                            {
                                                                              "literal": {"string": "' is not a local binder, not one of the module's own definitions, and not declared by any module in scope"}}]}}}}},
                                                                "type": {"literal": "string"}}},
                                                            "type": {"variable": "hydra.core.model.Name"}}}}},
                                                    "argument": {
                                                      "typeApplication": {
                                                        "body": {
                                                          "typeApplication": {
                                                            "body": {
                                                              "either": {
                                                                "left": {
                                                                  "application": {
                                                                    "function": {"variable": "hydra.core.lib.strings.concat"},
                                                                    "argument": {
                                                                      "list": [
                                                                        {"literal": {"string": "ambiguous bare name reference: '"}},
                                                                        {"variable": "s"},
                                                                        {"literal": {"string": "' is declared by "}},
                                                                        {
                                                                          "application": {
                                                                            "function": {"variable": "hydra.core.lib.literals.printInt32"},
                                                                            "argument": {
                                                                              "application": {
                                                                                "function": {
                                                                                  "typeApplication": {
                                                                                    "body": {"variable": "hydra.core.lib.lists.length"},
                                                                                    "type": {
                                                                                      "pair": {"first": {"variable": "hydra.core.packaging.ModuleName"}, "second": {"set": {"variable": "hydra.core.model.Name"}}}}}},
                                                                                "argument": {"variable": "owners"}}}}},
                                                                        {"literal": {"string": " different imported modules in scope"}}]}}}}},
                                                            "type": {"literal": "string"}}},
                                                        "type": {"variable": "hydra.core.model.Name"}}}}}}}}}}}}}}}}}}}}}}},
            "annotation": {
              "map": [
                {
                  "key": {"variable": "description"},
                  "value": {
                    "literal": {
                      "string": "Resolve a single bare name reference against the printer's universe: own-definitions first (qualified with modName), then the unique owning import, hard error on zero or multiple owners (#5/#711/#837)"}}}]}}}}},
    {
      "term": {
        "name": "hydra.core.parse.packaging.resolveNameRefsInDefinitionWith",
        "signature": {
          "typeParameters": [],
          "parameters": [
            {"name": "arg0", "type": {"variable": "hydra.core.packaging.ModuleName"}, "isLazy": false},
            {"name": "arg1", "type": {"set": {"literal": "string"}}, "isLazy": false},
            {
              "name": "arg2",
              "type": {
                "map": {"keys": {"variable": "hydra.core.packaging.ModuleName"}, "values": {"set": {"variable": "hydra.core.model.Name"}}}},
              "isLazy": false},
            {"name": "arg3", "type": {"variable": "hydra.core.packaging.Definition"}, "isLazy": false}],
          "result": {"type": {"either": {"left": {"literal": "string"}, "right": {"variable": "hydra.core.packaging.Definition"}}}}},
        "body": {
          "annotated": {
            "body": {
              "lambda": {
                "parameter": "modName",
                "domain": {"variable": "hydra.core.packaging.ModuleName"},
                "body": {
                  "lambda": {
                    "parameter": "ownNames",
                    "domain": {"set": {"literal": "string"}},
                    "body": {
                      "lambda": {
                        "parameter": "universe",
                        "domain": {
                          "map": {"keys": {"variable": "hydra.core.packaging.ModuleName"}, "values": {"set": {"variable": "hydra.core.model.Name"}}}},
                        "body": {
                          "lambda": {
                            "parameter": "def",
                            "domain": {"variable": "hydra.core.packaging.Definition"},
                            "body": {
                              "let": {
                                "bindings": [
                                  {
                                    "name": "resolveScheme",
                                    "term": {
                                      "lambda": {
                                        "parameter": "ts",
                                        "domain": {"variable": "hydra.core.model.TypeScheme"},
                                        "body": {
                                          "let": {
                                            "bindings": [
                                              {
                                                "name": "vars",
                                                "term": {
                                                  "application": {
                                                    "function": {"project": {"typeName": "hydra.core.model.TypeScheme", "fieldName": "variables"}},
                                                    "argument": {"variable": "ts"}}},
                                                "typeScheme": {"variables": [], "body": {"list": {"variable": "hydra.core.model.Name"}}, "constraints": []}}],
                                            "body": {
                                              "let": {
                                                "bindings": [
                                                  {
                                                    "name": "boundNames",
                                                    "term": {
                                                      "application": {
                                                        "function": {"typeApplication": {"body": {"variable": "hydra.core.lib.sets.fromList"}, "type": {"literal": "string"}}},
                                                        "argument": {
                                                          "application": {
                                                            "function": {
                                                              "application": {
                                                                "function": {
                                                                  "typeApplication": {
                                                                    "body": {"typeApplication": {"body": {"variable": "hydra.core.lib.lists.map"}, "type": {"variable": "hydra.core.model.Name"}}},
                                                                    "type": {"literal": "string"}}},
                                                                "argument": {
                                                                  "lambda": {
                                                                    "parameter": "v",
                                                                    "domain": {"variable": "hydra.core.model.Name"},
                                                                    "body": {"application": {"function": {"unwrap": "hydra.core.model.Name"}, "argument": {"variable": "v"}}}}}}},
                                                            "argument": {"variable": "vars"}}}}},
                                                    "typeScheme": {"variables": [], "body": {"set": {"literal": "string"}}, "constraints": []}}],
                                                "body": {
                                                  "application": {
                                                    "function": {
                                                      "application": {
                                                        "function": {
                                                          "typeApplication": {
                                                            "body": {
                                                              "typeApplication": {
                                                                "body": {"typeApplication": {"body": {"variable": "hydra.core.lib.eithers.map"}, "type": {"variable": "hydra.core.model.Type"}}},
                                                                "type": {"variable": "hydra.core.model.TypeScheme"}}},
                                                            "type": {"literal": "string"}}},
                                                        "argument": {
                                                          "lambda": {
                                                            "parameter": "b",
                                                            "domain": {"variable": "hydra.core.model.Type"},
                                                            "body": {
                                                              "record": {
                                                                "typeName": "hydra.core.model.TypeScheme",
                                                                "fields": [
                                                                  {"name": "variables", "term": {"variable": "vars"}},
                                                                  {"name": "body", "term": {"variable": "b"}},
                                                                  {
                                                                    "name": "constraints",
                                                                    "term": {
                                                                      "application": {
                                                                        "function": {"project": {"typeName": "hydra.core.model.TypeScheme", "fieldName": "constraints"}},
                                                                        "argument": {"variable": "ts"}}}}]}}}}}},
                                                    "argument": {
                                                      "application": {
                                                        "function": {
                                                          "application": {
                                                            "function": {
                                                              "application": {
                                                                "function": {
                                                                  "application": {
                                                                    "function": {
                                                                      "application": {"function": {"variable": "hydra.core.parse.packaging.resolveNameRefsInTypeWith"}, "argument": {"variable": "modName"}}},
                                                                    "argument": {"variable": "ownNames"}}},
                                                                "argument": {"variable": "universe"}}},
                                                            "argument": {"variable": "boundNames"}}},
                                                        "argument": {
                                                          "application": {
                                                            "function": {"project": {"typeName": "hydra.core.model.TypeScheme", "fieldName": "body"}},
                                                            "argument": {"variable": "ts"}}}}}}}}}}}}},
                                    "typeScheme": {
                                      "variables": [],
                                      "body": {
                                        "function": {
                                          "domain": {"variable": "hydra.core.model.TypeScheme"},
                                          "codomain": {"either": {"left": {"literal": "string"}, "right": {"variable": "hydra.core.model.TypeScheme"}}}}},
                                      "constraints": []}}],
                                "body": {
                                  "application": {
                                    "function": {
                                      "cases": {
                                        "typeName": "hydra.core.packaging.Definition",
                                        "cases": [
                                          {
                                            "name": "type",
                                            "handler": {
                                              "lambda": {
                                                "parameter": "td",
                                                "domain": {"variable": "hydra.core.packaging.TypeDefinition"},
                                                "body": {
                                                  "application": {
                                                    "function": {
                                                      "application": {
                                                        "function": {
                                                          "typeApplication": {
                                                            "body": {
                                                              "typeApplication": {
                                                                "body": {
                                                                  "typeApplication": {"body": {"variable": "hydra.core.lib.eithers.map"}, "type": {"variable": "hydra.core.model.TypeScheme"}}},
                                                                "type": {"variable": "hydra.core.packaging.Definition"}}},
                                                            "type": {"literal": "string"}}},
                                                        "argument": {
                                                          "lambda": {
                                                            "parameter": "ts",
                                                            "domain": {"variable": "hydra.core.model.TypeScheme"},
                                                            "body": {
                                                              "inject": {
                                                                "typeName": "hydra.core.packaging.Definition",
                                                                "field": {
                                                                  "name": "type",
                                                                  "term": {
                                                                    "record": {
                                                                      "typeName": "hydra.core.packaging.TypeDefinition",
                                                                      "fields": [
                                                                        {
                                                                          "name": "name",
                                                                          "term": {
                                                                            "application": {
                                                                              "function": {"project": {"typeName": "hydra.core.packaging.TypeDefinition", "fieldName": "name"}},
                                                                              "argument": {"variable": "td"}}}},
                                                                        {
                                                                          "name": "metadata",
                                                                          "term": {
                                                                            "application": {
                                                                              "function": {"project": {"typeName": "hydra.core.packaging.TypeDefinition", "fieldName": "metadata"}},
                                                                              "argument": {"variable": "td"}}}},
                                                                        {"name": "body", "term": {"variable": "ts"}}]}}}}}}}}},
                                                    "argument": {
                                                      "application": {
                                                        "function": {"variable": "resolveScheme"},
                                                        "argument": {
                                                          "application": {
                                                            "function": {"project": {"typeName": "hydra.core.packaging.TypeDefinition", "fieldName": "body"}},
                                                            "argument": {"variable": "td"}}}}}}}}}},
                                          {
                                            "name": "term",
                                            "handler": {
                                              "lambda": {
                                                "parameter": "td",
                                                "domain": {"variable": "hydra.core.packaging.TermDefinition"},
                                                "body": {
                                                  "application": {
                                                    "function": {
                                                      "application": {
                                                        "function": {
                                                          "typeApplication": {
                                                            "body": {
                                                              "typeApplication": {
                                                                "body": {"typeApplication": {"body": {"variable": "hydra.core.lib.eithers.bind"}, "type": {"literal": "string"}}},
                                                                "type": {"optional": {"variable": "hydra.core.typing.TermSignature"}}}},
                                                            "type": {"variable": "hydra.core.packaging.Definition"}}},
                                                        "argument": {
                                                          "application": {
                                                            "function": {
                                                              "application": {
                                                                "function": {
                                                                  "typeApplication": {
                                                                    "body": {
                                                                      "typeApplication": {
                                                                        "body": {
                                                                          "typeApplication": {"body": {"variable": "hydra.core.lib.eithers.mapOptional"}, "type": {"variable": "hydra.core.typing.TermSignature"}}},
                                                                        "type": {"variable": "hydra.core.typing.TermSignature"}}},
                                                                    "type": {"literal": "string"}}},
                                                                "argument": {
                                                                  "application": {
                                                                    "function": {
                                                                      "application": {
                                                                        "function": {
                                                                          "application": {
                                                                            "function": {"variable": "hydra.core.parse.packaging.resolveNameRefsInTermSignatureWith"},
                                                                            "argument": {"variable": "modName"}}},
                                                                        "argument": {"variable": "ownNames"}}},
                                                                    "argument": {"variable": "universe"}}}}},
                                                            "argument": {
                                                              "application": {
                                                                "function": {"project": {"typeName": "hydra.core.packaging.TermDefinition", "fieldName": "signature"}},
                                                                "argument": {"variable": "td"}}}}}}},
                                                    "argument": {
                                                      "lambda": {
                                                        "parameter": "rsig",
                                                        "domain": {"optional": {"variable": "hydra.core.typing.TermSignature"}},
                                                        "body": {
                                                          "application": {
                                                            "function": {
                                                              "application": {
                                                                "function": {
                                                                  "typeApplication": {
                                                                    "body": {
                                                                      "typeApplication": {
                                                                        "body": {"typeApplication": {"body": {"variable": "hydra.core.lib.eithers.map"}, "type": {"variable": "hydra.core.model.Term"}}},
                                                                        "type": {"variable": "hydra.core.packaging.Definition"}}},
                                                                    "type": {"literal": "string"}}},
                                                                "argument": {
                                                                  "lambda": {
                                                                    "parameter": "rbody",
                                                                    "domain": {"variable": "hydra.core.model.Term"},
                                                                    "body": {
                                                                      "inject": {
                                                                        "typeName": "hydra.core.packaging.Definition",
                                                                        "field": {
                                                                          "name": "term",
                                                                          "term": {
                                                                            "record": {
                                                                              "typeName": "hydra.core.packaging.TermDefinition",
                                                                              "fields": [
                                                                                {
                                                                                  "name": "name",
                                                                                  "term": {
                                                                                    "application": {
                                                                                      "function": {"project": {"typeName": "hydra.core.packaging.TermDefinition", "fieldName": "name"}},
                                                                                      "argument": {"variable": "td"}}}},
                                                                                {
                                                                                  "name": "metadata",
                                                                                  "term": {
                                                                                    "application": {
                                                                                      "function": {"project": {"typeName": "hydra.core.packaging.TermDefinition", "fieldName": "metadata"}},
                                                                                      "argument": {"variable": "td"}}}},
                                                                                {"name": "signature", "term": {"variable": "rsig"}},
                                                                                {"name": "body", "term": {"variable": "rbody"}}]}}}}}}}}},
                                                            "argument": {
                                                              "application": {
                                                                "function": {
                                                                  "application": {
                                                                    "function": {
                                                                      "application": {
                                                                        "function": {
                                                                          "application": {
                                                                            "function": {
                                                                              "application": {"function": {"variable": "hydra.core.parse.packaging.resolveNameRefsInTermWith"}, "argument": {"variable": "modName"}}},
                                                                            "argument": {"variable": "ownNames"}}},
                                                                        "argument": {"variable": "universe"}}},
                                                                    "argument": {"typeApplication": {"body": {"variable": "hydra.core.lib.sets.empty"}, "type": {"literal": "string"}}}}},
                                                                "argument": {
                                                                  "application": {
                                                                    "function": {"project": {"typeName": "hydra.core.packaging.TermDefinition", "fieldName": "body"}},
                                                                    "argument": {"variable": "td"}}}}}}}}}}}}}},
                                          {
                                            "name": "primitive",
                                            "handler": {
                                              "lambda": {
                                                "parameter": "pd",
                                                "domain": {"variable": "hydra.core.packaging.PrimitiveDefinition"},
                                                "body": {
                                                  "application": {
                                                    "function": {
                                                      "application": {
                                                        "function": {
                                                          "typeApplication": {
                                                            "body": {
                                                              "typeApplication": {
                                                                "body": {"typeApplication": {"body": {"variable": "hydra.core.lib.eithers.bind"}, "type": {"literal": "string"}}},
                                                                "type": {"variable": "hydra.core.typing.TermSignature"}}},
                                                            "type": {"variable": "hydra.core.packaging.Definition"}}},
                                                        "argument": {
                                                          "application": {
                                                            "function": {
                                                              "application": {
                                                                "function": {
                                                                  "application": {
                                                                    "function": {
                                                                      "application": {
                                                                        "function": {"variable": "hydra.core.parse.packaging.resolveNameRefsInTermSignatureWith"},
                                                                        "argument": {"variable": "modName"}}},
                                                                    "argument": {"variable": "ownNames"}}},
                                                                "argument": {"variable": "universe"}}},
                                                            "argument": {
                                                              "application": {
                                                                "function": {"project": {"typeName": "hydra.core.packaging.PrimitiveDefinition", "fieldName": "signature"}},
                                                                "argument": {"variable": "pd"}}}}}}},
                                                    "argument": {
                                                      "lambda": {
                                                        "parameter": "rsig",
                                                        "domain": {"variable": "hydra.core.typing.TermSignature"},
                                                        "body": {
                                                          "application": {
                                                            "function": {
                                                              "application": {
                                                                "function": {
                                                                  "typeApplication": {
                                                                    "body": {
                                                                      "typeApplication": {
                                                                        "body": {
                                                                          "typeApplication": {"body": {"variable": "hydra.core.lib.eithers.map"}, "type": {"optional": {"variable": "hydra.core.model.Term"}}}},
                                                                        "type": {"variable": "hydra.core.packaging.Definition"}}},
                                                                    "type": {"literal": "string"}}},
                                                                "argument": {
                                                                  "lambda": {
                                                                    "parameter": "rimpl",
                                                                    "domain": {"optional": {"variable": "hydra.core.model.Term"}},
                                                                    "body": {
                                                                      "inject": {
                                                                        "typeName": "hydra.core.packaging.Definition",
                                                                        "field": {
                                                                          "name": "primitive",
                                                                          "term": {
                                                                            "record": {
                                                                              "typeName": "hydra.core.packaging.PrimitiveDefinition",
                                                                              "fields": [
                                                                                {
                                                                                  "name": "name",
                                                                                  "term": {
                                                                                    "application": {
                                                                                      "function": {"project": {"typeName": "hydra.core.packaging.PrimitiveDefinition", "fieldName": "name"}},
                                                                                      "argument": {"variable": "pd"}}}},
                                                                                {
                                                                                  "name": "metadata",
                                                                                  "term": {
                                                                                    "application": {
                                                                                      "function": {"project": {"typeName": "hydra.core.packaging.PrimitiveDefinition", "fieldName": "metadata"}},
                                                                                      "argument": {"variable": "pd"}}}},
                                                                                {"name": "signature", "term": {"variable": "rsig"}},
                                                                                {
                                                                                  "name": "isPure",
                                                                                  "term": {
                                                                                    "application": {
                                                                                      "function": {"project": {"typeName": "hydra.core.packaging.PrimitiveDefinition", "fieldName": "isPure"}},
                                                                                      "argument": {"variable": "pd"}}}},
                                                                                {
                                                                                  "name": "isTotal",
                                                                                  "term": {
                                                                                    "application": {
                                                                                      "function": {"project": {"typeName": "hydra.core.packaging.PrimitiveDefinition", "fieldName": "isTotal"}},
                                                                                      "argument": {"variable": "pd"}}}},
                                                                                {"name": "defaultImplementation", "term": {"variable": "rimpl"}}]}}}}}}}}},
                                                            "argument": {
                                                              "application": {
                                                                "function": {
                                                                  "application": {
                                                                    "function": {
                                                                      "typeApplication": {
                                                                        "body": {
                                                                          "typeApplication": {
                                                                            "body": {
                                                                              "typeApplication": {"body": {"variable": "hydra.core.lib.eithers.mapOptional"}, "type": {"variable": "hydra.core.model.Term"}}},
                                                                            "type": {"variable": "hydra.core.model.Term"}}},
                                                                        "type": {"literal": "string"}}},
                                                                    "argument": {
                                                                      "application": {
                                                                        "function": {
                                                                          "application": {
                                                                            "function": {
                                                                              "application": {
                                                                                "function": {
                                                                                  "application": {"function": {"variable": "hydra.core.parse.packaging.resolveNameRefsInTermWith"}, "argument": {"variable": "modName"}}},
                                                                                "argument": {"variable": "ownNames"}}},
                                                                            "argument": {"variable": "universe"}}},
                                                                        "argument": {"typeApplication": {"body": {"variable": "hydra.core.lib.sets.empty"}, "type": {"literal": "string"}}}}}}},
                                                                "argument": {
                                                                  "application": {
                                                                    "function": {"project": {"typeName": "hydra.core.packaging.PrimitiveDefinition", "fieldName": "defaultImplementation"}},
                                                                    "argument": {"variable": "pd"}}}}}}}}}}}}}}]}},
                                    "argument": {"variable": "def"}}}}}}}}}}}}},
            "annotation": {
              "map": [
                {
                  "key": {"variable": "description"},
                  "value": {
                    "literal": {
                      "string": "Resolve every remaining bare name reference inside a definition's body/signature against the printer's universe"}}}]}}}}},
    {
      "term": {
        "name": "hydra.core.parse.packaging.resolveNameRefsInTermSignatureWith",
        "signature": {
          "typeParameters": [],
          "parameters": [
            {"name": "arg0", "type": {"variable": "hydra.core.packaging.ModuleName"}, "isLazy": false},
            {"name": "arg1", "type": {"set": {"literal": "string"}}, "isLazy": false},
            {
              "name": "arg2",
              "type": {
                "map": {"keys": {"variable": "hydra.core.packaging.ModuleName"}, "values": {"set": {"variable": "hydra.core.model.Name"}}}},
              "isLazy": false},
            {"name": "arg3", "type": {"variable": "hydra.core.typing.TermSignature"}, "isLazy": false}],
          "result": {"type": {"either": {"left": {"literal": "string"}, "right": {"variable": "hydra.core.typing.TermSignature"}}}}},
        "body": {
          "annotated": {
            "body": {
              "lambda": {
                "parameter": "modName",
                "domain": {"variable": "hydra.core.packaging.ModuleName"},
                "body": {
                  "lambda": {
                    "parameter": "ownNames",
                    "domain": {"set": {"literal": "string"}},
                    "body": {
                      "lambda": {
                        "parameter": "universe",
                        "domain": {
                          "map": {"keys": {"variable": "hydra.core.packaging.ModuleName"}, "values": {"set": {"variable": "hydra.core.model.Name"}}}},
                        "body": {
                          "lambda": {
                            "parameter": "sig",
                            "domain": {"variable": "hydra.core.typing.TermSignature"},
                            "body": {
                              "let": {
                                "bindings": [
                                  {
                                    "name": "boundNames",
                                    "term": {
                                      "application": {
                                        "function": {"typeApplication": {"body": {"variable": "hydra.core.lib.sets.fromList"}, "type": {"literal": "string"}}},
                                        "argument": {
                                          "application": {
                                            "function": {
                                              "application": {
                                                "function": {
                                                  "typeApplication": {
                                                    "body": {
                                                      "typeApplication": {"body": {"variable": "hydra.core.lib.lists.map"}, "type": {"variable": "hydra.core.typing.TypeParameter"}}},
                                                    "type": {"literal": "string"}}},
                                                "argument": {
                                                  "lambda": {
                                                    "parameter": "tp",
                                                    "domain": {"variable": "hydra.core.typing.TypeParameter"},
                                                    "body": {
                                                      "application": {
                                                        "function": {"unwrap": "hydra.core.model.Name"},
                                                        "argument": {
                                                          "application": {
                                                            "function": {"project": {"typeName": "hydra.core.typing.TypeParameter", "fieldName": "name"}},
                                                            "argument": {"variable": "tp"}}}}}}}}},
                                            "argument": {
                                              "application": {
                                                "function": {"project": {"typeName": "hydra.core.typing.TermSignature", "fieldName": "typeParameters"}},
                                                "argument": {"variable": "sig"}}}}}}},
                                    "typeScheme": {"variables": [], "body": {"set": {"literal": "string"}}, "constraints": []}}],
                                "body": {
                                  "let": {
                                    "bindings": [
                                      {
                                        "name": "resolveT",
                                        "term": {
                                          "application": {
                                            "function": {
                                              "application": {
                                                "function": {
                                                  "application": {
                                                    "function": {
                                                      "application": {"function": {"variable": "hydra.core.parse.packaging.resolveNameRefsInTypeWith"}, "argument": {"variable": "modName"}}},
                                                    "argument": {"variable": "ownNames"}}},
                                                "argument": {"variable": "universe"}}},
                                            "argument": {"variable": "boundNames"}}},
                                        "typeScheme": {
                                          "variables": [],
                                          "body": {
                                            "function": {
                                              "domain": {"variable": "hydra.core.model.Type"},
                                              "codomain": {"either": {"left": {"literal": "string"}, "right": {"variable": "hydra.core.model.Type"}}}}},
                                          "constraints": []}}],
                                    "body": {
                                      "let": {
                                        "bindings": [
                                          {
                                            "name": "mapParam",
                                            "term": {
                                              "lambda": {
                                                "parameter": "p",
                                                "domain": {"variable": "hydra.core.typing.Parameter"},
                                                "body": {
                                                  "application": {
                                                    "function": {
                                                      "application": {
                                                        "function": {
                                                          "typeApplication": {
                                                            "body": {
                                                              "typeApplication": {
                                                                "body": {"typeApplication": {"body": {"variable": "hydra.core.lib.eithers.map"}, "type": {"variable": "hydra.core.model.Type"}}},
                                                                "type": {"variable": "hydra.core.typing.Parameter"}}},
                                                            "type": {"literal": "string"}}},
                                                        "argument": {
                                                          "lambda": {
                                                            "parameter": "t",
                                                            "domain": {"variable": "hydra.core.model.Type"},
                                                            "body": {
                                                              "record": {
                                                                "typeName": "hydra.core.typing.Parameter",
                                                                "fields": [
                                                                  {
                                                                    "name": "name",
                                                                    "term": {
                                                                      "application": {
                                                                        "function": {"project": {"typeName": "hydra.core.typing.Parameter", "fieldName": "name"}},
                                                                        "argument": {"variable": "p"}}}},
                                                                  {
                                                                    "name": "description",
                                                                    "term": {
                                                                      "application": {
                                                                        "function": {"project": {"typeName": "hydra.core.typing.Parameter", "fieldName": "description"}},
                                                                        "argument": {"variable": "p"}}}},
                                                                  {"name": "type", "term": {"variable": "t"}},
                                                                  {
                                                                    "name": "isLazy",
                                                                    "term": {
                                                                      "application": {
                                                                        "function": {"project": {"typeName": "hydra.core.typing.Parameter", "fieldName": "isLazy"}},
                                                                        "argument": {"variable": "p"}}}}]}}}}}},
                                                    "argument": {
                                                      "application": {
                                                        "function": {"variable": "resolveT"},
                                                        "argument": {
                                                          "application": {
                                                            "function": {"project": {"typeName": "hydra.core.typing.Parameter", "fieldName": "type"}},
                                                            "argument": {"variable": "p"}}}}}}}}},
                                            "typeScheme": {
                                              "variables": [],
                                              "body": {
                                                "function": {
                                                  "domain": {"variable": "hydra.core.typing.Parameter"},
                                                  "codomain": {"either": {"left": {"literal": "string"}, "right": {"variable": "hydra.core.typing.Parameter"}}}}},
                                              "constraints": []}}],
                                        "body": {
                                          "application": {
                                            "function": {
                                              "application": {
                                                "function": {
                                                  "typeApplication": {
                                                    "body": {
                                                      "typeApplication": {
                                                        "body": {"typeApplication": {"body": {"variable": "hydra.core.lib.eithers.bind"}, "type": {"literal": "string"}}},
                                                        "type": {"list": {"variable": "hydra.core.typing.Parameter"}}}},
                                                    "type": {"variable": "hydra.core.typing.TermSignature"}}},
                                                "argument": {
                                                  "application": {
                                                    "function": {
                                                      "application": {
                                                        "function": {
                                                          "typeApplication": {
                                                            "body": {
                                                              "typeApplication": {
                                                                "body": {
                                                                  "typeApplication": {"body": {"variable": "hydra.core.lib.eithers.mapList"}, "type": {"variable": "hydra.core.typing.Parameter"}}},
                                                                "type": {"variable": "hydra.core.typing.Parameter"}}},
                                                            "type": {"literal": "string"}}},
                                                        "argument": {"variable": "mapParam"}}},
                                                    "argument": {
                                                      "application": {
                                                        "function": {"project": {"typeName": "hydra.core.typing.TermSignature", "fieldName": "parameters"}},
                                                        "argument": {"variable": "sig"}}}}}}},
                                            "argument": {
                                              "lambda": {
                                                "parameter": "rparams",
                                                "domain": {"list": {"variable": "hydra.core.typing.Parameter"}},
                                                "body": {
                                                  "let": {
                                                    "bindings": [
                                                      {
                                                        "name": "r",
                                                        "term": {
                                                          "application": {
                                                            "function": {"project": {"typeName": "hydra.core.typing.TermSignature", "fieldName": "result"}},
                                                            "argument": {"variable": "sig"}}},
                                                        "typeScheme": {"variables": [], "body": {"variable": "hydra.core.typing.Result"}, "constraints": []}}],
                                                    "body": {
                                                      "application": {
                                                        "function": {
                                                          "application": {
                                                            "function": {
                                                              "typeApplication": {
                                                                "body": {
                                                                  "typeApplication": {
                                                                    "body": {"typeApplication": {"body": {"variable": "hydra.core.lib.eithers.map"}, "type": {"variable": "hydra.core.model.Type"}}},
                                                                    "type": {"variable": "hydra.core.typing.TermSignature"}}},
                                                                "type": {"literal": "string"}}},
                                                            "argument": {
                                                              "lambda": {
                                                                "parameter": "rt",
                                                                "domain": {"variable": "hydra.core.model.Type"},
                                                                "body": {
                                                                  "record": {
                                                                    "typeName": "hydra.core.typing.TermSignature",
                                                                    "fields": [
                                                                      {
                                                                        "name": "typeParameters",
                                                                        "term": {
                                                                          "application": {
                                                                            "function": {"project": {"typeName": "hydra.core.typing.TermSignature", "fieldName": "typeParameters"}},
                                                                            "argument": {"variable": "sig"}}}},
                                                                      {"name": "parameters", "term": {"variable": "rparams"}},
                                                                      {
                                                                        "name": "result",
                                                                        "term": {
                                                                          "record": {
                                                                            "typeName": "hydra.core.typing.Result",
                                                                            "fields": [
                                                                              {
                                                                                "name": "description",
                                                                                "term": {
                                                                                  "application": {
                                                                                    "function": {"project": {"typeName": "hydra.core.typing.Result", "fieldName": "description"}},
                                                                                    "argument": {"variable": "r"}}}},
                                                                              {"name": "type", "term": {"variable": "rt"}}]}}}]}}}}}},
                                                        "argument": {
                                                          "application": {
                                                            "function": {"variable": "resolveT"},
                                                            "argument": {
                                                              "application": {"function": {"project": {"typeName": "hydra.core.typing.Result", "fieldName": "type"}}, "argument": {"variable": "r"}}}}}}}}}}}}}}}}}}}}}}}}}}},
            "annotation": {
              "map": [
                {
                  "key": {"variable": "description"},
                  "value": {
                    "literal": {
                      "string": "Resolve bare name references inside a term signature's parameter and result types against the printer's universe"}}}]}}}}},
    {
      "term": {
        "name": "hydra.core.parse.packaging.resolveNameRefsInTermWith",
        "signature": {
          "typeParameters": [],
          "parameters": [
            {"name": "arg0", "type": {"variable": "hydra.core.packaging.ModuleName"}, "isLazy": false},
            {"name": "arg1", "type": {"set": {"literal": "string"}}, "isLazy": false},
            {
              "name": "arg2",
              "type": {
                "map": {"keys": {"variable": "hydra.core.packaging.ModuleName"}, "values": {"set": {"variable": "hydra.core.model.Name"}}}},
              "isLazy": false},
            {"name": "arg3", "type": {"set": {"literal": "string"}}, "isLazy": false},
            {"name": "arg4", "type": {"variable": "hydra.core.model.Term"}, "isLazy": false}],
          "result": {"type": {"either": {"left": {"literal": "string"}, "right": {"variable": "hydra.core.model.Term"}}}}},
        "body": {
          "annotated": {
            "body": {
              "lambda": {
                "parameter": "modName",
                "domain": {"variable": "hydra.core.packaging.ModuleName"},
                "body": {
                  "lambda": {
                    "parameter": "ownNames",
                    "domain": {"set": {"literal": "string"}},
                    "body": {
                      "lambda": {
                        "parameter": "universe",
                        "domain": {
                          "map": {"keys": {"variable": "hydra.core.packaging.ModuleName"}, "values": {"set": {"variable": "hydra.core.model.Name"}}}},
                        "body": {
                          "lambda": {
                            "parameter": "bound",
                            "domain": {"set": {"literal": "string"}},
                            "body": {
                              "lambda": {
                                "parameter": "term",
                                "domain": {"variable": "hydra.core.model.Term"},
                                "body": {
                                  "let": {
                                    "bindings": [
                                      {
                                        "name": "recurse",
                                        "term": {
                                          "application": {
                                            "function": {
                                              "application": {
                                                "function": {
                                                  "application": {"function": {"variable": "hydra.core.parse.packaging.resolveNameRefsInTermWith"}, "argument": {"variable": "modName"}}},
                                                "argument": {"variable": "ownNames"}}},
                                            "argument": {"variable": "universe"}}},
                                        "typeScheme": {
                                          "variables": [],
                                          "body": {
                                            "function": {
                                              "domain": {"set": {"literal": "string"}},
                                              "codomain": {
                                                "function": {
                                                  "domain": {"variable": "hydra.core.model.Term"},
                                                  "codomain": {"either": {"left": {"literal": "string"}, "right": {"variable": "hydra.core.model.Term"}}}}}}},
                                          "constraints": []}}],
                                    "body": {
                                      "let": {
                                        "bindings": [
                                          {
                                            "name": "resolveN",
                                            "term": {
                                              "application": {
                                                "function": {
                                                  "application": {
                                                    "function": {
                                                      "application": {"function": {"variable": "hydra.core.parse.packaging.resolveNameRefWith"}, "argument": {"variable": "modName"}}},
                                                    "argument": {"variable": "ownNames"}}},
                                                "argument": {"variable": "universe"}}},
                                            "typeScheme": {
                                              "variables": [],
                                              "body": {
                                                "function": {
                                                  "domain": {"variable": "hydra.core.model.Name"},
                                                  "codomain": {"either": {"left": {"literal": "string"}, "right": {"variable": "hydra.core.model.Name"}}}}},
                                              "constraints": []}}],
                                        "body": {
                                          "let": {
                                            "bindings": [
                                              {
                                                "name": "forField",
                                                "term": {
                                                  "lambda": {
                                                    "parameter": "boundHere",
                                                    "domain": {"set": {"literal": "string"}},
                                                    "body": {
                                                      "lambda": {
                                                        "parameter": "field",
                                                        "domain": {"variable": "hydra.core.model.Field"},
                                                        "body": {
                                                          "application": {
                                                            "function": {
                                                              "application": {
                                                                "function": {
                                                                  "typeApplication": {
                                                                    "body": {
                                                                      "typeApplication": {
                                                                        "body": {"typeApplication": {"body": {"variable": "hydra.core.lib.eithers.map"}, "type": {"variable": "hydra.core.model.Term"}}},
                                                                        "type": {"variable": "hydra.core.model.Field"}}},
                                                                    "type": {"literal": "string"}}},
                                                                "argument": {
                                                                  "lambda": {
                                                                    "parameter": "t",
                                                                    "domain": {"variable": "hydra.core.model.Term"},
                                                                    "body": {
                                                                      "record": {
                                                                        "typeName": "hydra.core.model.Field",
                                                                        "fields": [
                                                                          {
                                                                            "name": "name",
                                                                            "term": {
                                                                              "application": {
                                                                                "function": {"project": {"typeName": "hydra.core.model.Field", "fieldName": "name"}},
                                                                                "argument": {"variable": "field"}}}},
                                                                          {"name": "term", "term": {"variable": "t"}}]}}}}}},
                                                            "argument": {
                                                              "application": {
                                                                "function": {"application": {"function": {"variable": "recurse"}, "argument": {"variable": "boundHere"}}},
                                                                "argument": {
                                                                  "application": {
                                                                    "function": {"project": {"typeName": "hydra.core.model.Field", "fieldName": "term"}},
                                                                    "argument": {"variable": "field"}}}}}}}}}}},
                                                "typeScheme": {
                                                  "variables": [],
                                                  "body": {
                                                    "function": {
                                                      "domain": {"set": {"literal": "string"}},
                                                      "codomain": {
                                                        "function": {
                                                          "domain": {"variable": "hydra.core.model.Field"},
                                                          "codomain": {"either": {"left": {"literal": "string"}, "right": {"variable": "hydra.core.model.Field"}}}}}}},
                                                  "constraints": []}}],
                                            "body": {
                                              "let": {
                                                "bindings": [
                                                  {
                                                    "name": "forCaseAlternative",
                                                    "term": {
                                                      "lambda": {
                                                        "parameter": "boundHere",
                                                        "domain": {"set": {"literal": "string"}},
                                                        "body": {
                                                          "lambda": {
                                                            "parameter": "alt",
                                                            "domain": {"variable": "hydra.core.model.CaseAlternative"},
                                                            "body": {
                                                              "application": {
                                                                "function": {
                                                                  "application": {
                                                                    "function": {
                                                                      "typeApplication": {
                                                                        "body": {
                                                                          "typeApplication": {
                                                                            "body": {"typeApplication": {"body": {"variable": "hydra.core.lib.eithers.map"}, "type": {"variable": "hydra.core.model.Term"}}},
                                                                            "type": {"variable": "hydra.core.model.CaseAlternative"}}},
                                                                        "type": {"literal": "string"}}},
                                                                    "argument": {
                                                                      "lambda": {
                                                                        "parameter": "h",
                                                                        "domain": {"variable": "hydra.core.model.Term"},
                                                                        "body": {
                                                                          "record": {
                                                                            "typeName": "hydra.core.model.CaseAlternative",
                                                                            "fields": [
                                                                              {
                                                                                "name": "name",
                                                                                "term": {
                                                                                  "application": {
                                                                                    "function": {"project": {"typeName": "hydra.core.model.CaseAlternative", "fieldName": "name"}},
                                                                                    "argument": {"variable": "alt"}}}},
                                                                              {"name": "handler", "term": {"variable": "h"}}]}}}}}},
                                                                "argument": {
                                                                  "application": {
                                                                    "function": {"application": {"function": {"variable": "recurse"}, "argument": {"variable": "boundHere"}}},
                                                                    "argument": {
                                                                      "application": {
                                                                        "function": {"project": {"typeName": "hydra.core.model.CaseAlternative", "fieldName": "handler"}},
                                                                        "argument": {"variable": "alt"}}}}}}}}}}},
                                                    "typeScheme": {
                                                      "variables": [],
                                                      "body": {
                                                        "function": {
                                                          "domain": {"set": {"literal": "string"}},
                                                          "codomain": {
                                                            "function": {
                                                              "domain": {"variable": "hydra.core.model.CaseAlternative"},
                                                              "codomain": {"either": {"left": {"literal": "string"}, "right": {"variable": "hydra.core.model.CaseAlternative"}}}}}}},
                                                      "constraints": []}}],
                                                "body": {
                                                  "application": {
                                                    "function": {
                                                      "cases": {
                                                        "typeName": "hydra.core.model.Term",
                                                        "cases": [
                                                          {
                                                            "name": "annotated",
                                                            "handler": {
                                                              "lambda": {
                                                                "parameter": "at",
                                                                "domain": {"variable": "hydra.core.model.AnnotatedTerm"},
                                                                "body": {
                                                                  "let": {
                                                                    "bindings": [
                                                                      {
                                                                        "name": "ann",
                                                                        "term": {
                                                                          "application": {
                                                                            "function": {"project": {"typeName": "hydra.core.model.AnnotatedTerm", "fieldName": "annotation"}},
                                                                            "argument": {"variable": "at"}}},
                                                                        "typeScheme": {"variables": [], "body": {"variable": "hydra.core.model.Term"}, "constraints": []}}],
                                                                    "body": {
                                                                      "let": {
                                                                        "bindings": [
                                                                          {
                                                                            "name": "forAnn",
                                                                            "term": {
                                                                              "typeLambda": {
                                                                                "parameter": "t0",
                                                                                "body": {
                                                                                  "lambda": {
                                                                                    "parameter": "p",
                                                                                    "domain": {"pair": {"first": {"variable": "t0"}, "second": {"variable": "hydra.core.model.Term"}}},
                                                                                    "body": {
                                                                                      "application": {
                                                                                        "function": {
                                                                                          "application": {
                                                                                            "function": {
                                                                                              "typeApplication": {
                                                                                                "body": {
                                                                                                  "typeApplication": {
                                                                                                    "body": {"typeApplication": {"body": {"variable": "hydra.core.lib.eithers.map"}, "type": {"variable": "hydra.core.model.Term"}}},
                                                                                                    "type": {"pair": {"first": {"variable": "t0"}, "second": {"variable": "hydra.core.model.Term"}}}}},
                                                                                                "type": {"literal": "string"}}},
                                                                                            "argument": {
                                                                                              "lambda": {
                                                                                                "parameter": "v",
                                                                                                "domain": {"variable": "hydra.core.model.Term"},
                                                                                                "body": {
                                                                                                  "typeApplication": {
                                                                                                    "body": {
                                                                                                      "typeApplication": {
                                                                                                        "body": {
                                                                                                          "pair": {
                                                                                                            "first": {
                                                                                                              "application": {
                                                                                                                "function": {
                                                                                                                  "typeApplication": {
                                                                                                                    "body": {"typeApplication": {"body": {"variable": "hydra.core.lib.pairs.first"}, "type": {"variable": "t0"}}},
                                                                                                                    "type": {"variable": "hydra.core.model.Term"}}},
                                                                                                                "argument": {"variable": "p"}}},
                                                                                                            "second": {"variable": "v"}}},
                                                                                                        "type": {"variable": "t0"}}},
                                                                                                    "type": {"variable": "hydra.core.model.Term"}}}}}}},
                                                                                        "argument": {
                                                                                          "application": {
                                                                                            "function": {"application": {"function": {"variable": "recurse"}, "argument": {"variable": "bound"}}},
                                                                                            "argument": {
                                                                                              "application": {
                                                                                                "function": {
                                                                                                  "typeApplication": {
                                                                                                    "body": {"typeApplication": {"body": {"variable": "hydra.core.lib.pairs.second"}, "type": {"variable": "t0"}}},
                                                                                                    "type": {"variable": "hydra.core.model.Term"}}},
                                                                                                "argument": {"variable": "p"}}}}}}}}}}},
                                                                            "typeScheme": {
                                                                              "variables": ["t0"],
                                                                              "body": {
                                                                                "function": {
                                                                                  "domain": {"pair": {"first": {"variable": "t0"}, "second": {"variable": "hydra.core.model.Term"}}},
                                                                                  "codomain": {
                                                                                    "either": {
                                                                                      "left": {"literal": "string"},
                                                                                      "right": {"pair": {"first": {"variable": "t0"}, "second": {"variable": "hydra.core.model.Term"}}}}}}},
                                                                              "constraints": [{"key": "t0", "value": {"classes": []}}]}}],
                                                                        "body": {
                                                                          "application": {
                                                                            "function": {
                                                                              "application": {
                                                                                "function": {
                                                                                  "typeApplication": {
                                                                                    "body": {
                                                                                      "typeApplication": {
                                                                                        "body": {"typeApplication": {"body": {"variable": "hydra.core.lib.eithers.bind"}, "type": {"literal": "string"}}},
                                                                                        "type": {"variable": "hydra.core.model.Term"}}},
                                                                                    "type": {"variable": "hydra.core.model.Term"}}},
                                                                                "argument": {
                                                                                  "application": {
                                                                                    "function": {
                                                                                      "cases": {
                                                                                        "typeName": "hydra.core.model.Term",
                                                                                        "default": {
                                                                                          "typeApplication": {
                                                                                            "body": {"typeApplication": {"body": {"either": {"right": {"variable": "ann"}}}, "type": {"literal": "string"}}},
                                                                                            "type": {"variable": "hydra.core.model.Term"}}},
                                                                                        "cases": [
                                                                                          {
                                                                                            "name": "map",
                                                                                            "handler": {
                                                                                              "lambda": {
                                                                                                "parameter": "m",
                                                                                                "domain": {"map": {"keys": {"variable": "hydra.core.model.Term"}, "values": {"variable": "hydra.core.model.Term"}}},
                                                                                                "body": {
                                                                                                  "application": {
                                                                                                    "function": {
                                                                                                      "application": {
                                                                                                        "function": {
                                                                                                          "typeApplication": {
                                                                                                            "body": {
                                                                                                              "typeApplication": {
                                                                                                                "body": {
                                                                                                                  "typeApplication": {
                                                                                                                    "body": {"variable": "hydra.core.lib.eithers.map"},
                                                                                                                    "type": {"list": {"pair": {"first": {"variable": "hydra.core.model.Term"}, "second": {"variable": "hydra.core.model.Term"}}}}}},
                                                                                                                "type": {"variable": "hydra.core.model.Term"}}},
                                                                                                            "type": {"literal": "string"}}},
                                                                                                        "argument": {
                                                                                                          "lambda": {
                                                                                                            "parameter": "rpairs",
                                                                                                            "domain": {"list": {"pair": {"first": {"variable": "hydra.core.model.Term"}, "second": {"variable": "hydra.core.model.Term"}}}},
                                                                                                            "body": {
                                                                                                              "inject": {
                                                                                                                "typeName": "hydra.core.model.Term",
                                                                                                                "field": {
                                                                                                                  "name": "map",
                                                                                                                  "term": {
                                                                                                                    "application": {
                                                                                                                      "function": {
                                                                                                                        "typeApplication": {
                                                                                                                          "body": {
                                                                                                                            "typeApplication": {"body": {"variable": "hydra.core.lib.maps.fromList"}, "type": {"variable": "hydra.core.model.Term"}}},
                                                                                                                          "type": {"variable": "hydra.core.model.Term"}}},
                                                                                                                      "argument": {"variable": "rpairs"}}}}}}}}}},
                                                                                                    "argument": {
                                                                                                      "application": {
                                                                                                        "function": {
                                                                                                          "application": {
                                                                                                            "function": {
                                                                                                              "typeApplication": {
                                                                                                                "body": {
                                                                                                                  "typeApplication": {
                                                                                                                    "body": {
                                                                                                                      "typeApplication": {
                                                                                                                        "body": {"variable": "hydra.core.lib.eithers.mapList"},
                                                                                                                        "type": {"pair": {"first": {"variable": "hydra.core.model.Term"}, "second": {"variable": "hydra.core.model.Term"}}}}},
                                                                                                                    "type": {"pair": {"first": {"variable": "hydra.core.model.Term"}, "second": {"variable": "hydra.core.model.Term"}}}}},
                                                                                                                "type": {"literal": "string"}}},
                                                                                                            "argument": {"typeApplication": {"body": {"variable": "forAnn"}, "type": {"variable": "hydra.core.model.Term"}}}}},
                                                                                                        "argument": {
                                                                                                          "application": {
                                                                                                            "function": {
                                                                                                              "typeApplication": {
                                                                                                                "body": {"typeApplication": {"body": {"variable": "hydra.core.lib.maps.toList"}, "type": {"variable": "hydra.core.model.Term"}}},
                                                                                                                "type": {"variable": "hydra.core.model.Term"}}},
                                                                                                            "argument": {"variable": "m"}}}}}}}}}}]}},
                                                                                    "argument": {"variable": "ann"}}}}},
                                                                            "argument": {
                                                                              "lambda": {
                                                                                "parameter": "rann",
                                                                                "domain": {"variable": "hydra.core.model.Term"},
                                                                                "body": {
                                                                                  "application": {
                                                                                    "function": {
                                                                                      "application": {
                                                                                        "function": {
                                                                                          "typeApplication": {
                                                                                            "body": {
                                                                                              "typeApplication": {
                                                                                                "body": {"typeApplication": {"body": {"variable": "hydra.core.lib.eithers.map"}, "type": {"variable": "hydra.core.model.Term"}}},
                                                                                                "type": {"variable": "hydra.core.model.Term"}}},
                                                                                            "type": {"literal": "string"}}},
                                                                                        "argument": {
                                                                                          "lambda": {
                                                                                            "parameter": "b",
                                                                                            "domain": {"variable": "hydra.core.model.Term"},
                                                                                            "body": {
                                                                                              "inject": {
                                                                                                "typeName": "hydra.core.model.Term",
                                                                                                "field": {
                                                                                                  "name": "annotated",
                                                                                                  "term": {
                                                                                                    "record": {
                                                                                                      "typeName": "hydra.core.model.AnnotatedTerm",
                                                                                                      "fields": [{"name": "body", "term": {"variable": "b"}}, {"name": "annotation", "term": {"variable": "rann"}}]}}}}}}}}},
                                                                                    "argument": {
                                                                                      "application": {
                                                                                        "function": {"application": {"function": {"variable": "recurse"}, "argument": {"variable": "bound"}}},
                                                                                        "argument": {
                                                                                          "application": {
                                                                                            "function": {"project": {"typeName": "hydra.core.model.AnnotatedTerm", "fieldName": "body"}},
                                                                                            "argument": {"variable": "at"}}}}}}}}}}}}}}}}}},
                                                          {
                                                            "name": "application",
                                                            "handler": {
                                                              "lambda": {
                                                                "parameter": "a",
                                                                "domain": {"variable": "hydra.core.model.Application"},
                                                                "body": {
                                                                  "application": {
                                                                    "function": {
                                                                      "application": {
                                                                        "function": {
                                                                          "typeApplication": {
                                                                            "body": {
                                                                              "typeApplication": {
                                                                                "body": {"typeApplication": {"body": {"variable": "hydra.core.lib.eithers.bind"}, "type": {"literal": "string"}}},
                                                                                "type": {"variable": "hydra.core.model.Term"}}},
                                                                            "type": {"variable": "hydra.core.model.Term"}}},
                                                                        "argument": {
                                                                          "application": {
                                                                            "function": {"application": {"function": {"variable": "recurse"}, "argument": {"variable": "bound"}}},
                                                                            "argument": {
                                                                              "application": {
                                                                                "function": {"project": {"typeName": "hydra.core.model.Application", "fieldName": "function"}},
                                                                                "argument": {"variable": "a"}}}}}}},
                                                                    "argument": {
                                                                      "lambda": {
                                                                        "parameter": "f",
                                                                        "domain": {"variable": "hydra.core.model.Term"},
                                                                        "body": {
                                                                          "application": {
                                                                            "function": {
                                                                              "application": {
                                                                                "function": {
                                                                                  "typeApplication": {
                                                                                    "body": {
                                                                                      "typeApplication": {
                                                                                        "body": {"typeApplication": {"body": {"variable": "hydra.core.lib.eithers.map"}, "type": {"variable": "hydra.core.model.Term"}}},
                                                                                        "type": {"variable": "hydra.core.model.Term"}}},
                                                                                    "type": {"literal": "string"}}},
                                                                                "argument": {
                                                                                  "lambda": {
                                                                                    "parameter": "x",
                                                                                    "domain": {"variable": "hydra.core.model.Term"},
                                                                                    "body": {
                                                                                      "inject": {
                                                                                        "typeName": "hydra.core.model.Term",
                                                                                        "field": {
                                                                                          "name": "application",
                                                                                          "term": {
                                                                                            "record": {
                                                                                              "typeName": "hydra.core.model.Application",
                                                                                              "fields": [{"name": "function", "term": {"variable": "f"}}, {"name": "argument", "term": {"variable": "x"}}]}}}}}}}}},
                                                                            "argument": {
                                                                              "application": {
                                                                                "function": {"application": {"function": {"variable": "recurse"}, "argument": {"variable": "bound"}}},
                                                                                "argument": {
                                                                                  "application": {
                                                                                    "function": {"project": {"typeName": "hydra.core.model.Application", "fieldName": "argument"}},
                                                                                    "argument": {"variable": "a"}}}}}}}}}}}}}},
                                                          {
                                                            "name": "cases",
                                                            "handler": {
                                                              "lambda": {
                                                                "parameter": "cs",
                                                                "domain": {"variable": "hydra.core.model.CaseStatement"},
                                                                "body": {
                                                                  "application": {
                                                                    "function": {
                                                                      "application": {
                                                                        "function": {
                                                                          "typeApplication": {
                                                                            "body": {
                                                                              "typeApplication": {
                                                                                "body": {"typeApplication": {"body": {"variable": "hydra.core.lib.eithers.bind"}, "type": {"literal": "string"}}},
                                                                                "type": {"variable": "hydra.core.model.Name"}}},
                                                                            "type": {"variable": "hydra.core.model.Term"}}},
                                                                        "argument": {
                                                                          "application": {
                                                                            "function": {"variable": "resolveN"},
                                                                            "argument": {
                                                                              "application": {
                                                                                "function": {"project": {"typeName": "hydra.core.model.CaseStatement", "fieldName": "typeName"}},
                                                                                "argument": {"variable": "cs"}}}}}}},
                                                                    "argument": {
                                                                      "lambda": {
                                                                        "parameter": "tn",
                                                                        "domain": {"variable": "hydra.core.model.Name"},
                                                                        "body": {
                                                                          "application": {
                                                                            "function": {
                                                                              "application": {
                                                                                "function": {
                                                                                  "typeApplication": {
                                                                                    "body": {
                                                                                      "typeApplication": {
                                                                                        "body": {"typeApplication": {"body": {"variable": "hydra.core.lib.eithers.bind"}, "type": {"literal": "string"}}},
                                                                                        "type": {"optional": {"variable": "hydra.core.model.Term"}}}},
                                                                                    "type": {"variable": "hydra.core.model.Term"}}},
                                                                                "argument": {
                                                                                  "application": {
                                                                                    "function": {
                                                                                      "application": {
                                                                                        "function": {
                                                                                          "typeApplication": {
                                                                                            "body": {
                                                                                              "typeApplication": {
                                                                                                "body": {
                                                                                                  "typeApplication": {"body": {"variable": "hydra.core.lib.eithers.mapOptional"}, "type": {"variable": "hydra.core.model.Term"}}},
                                                                                                "type": {"variable": "hydra.core.model.Term"}}},
                                                                                            "type": {"literal": "string"}}},
                                                                                        "argument": {"application": {"function": {"variable": "recurse"}, "argument": {"variable": "bound"}}}}},
                                                                                    "argument": {
                                                                                      "application": {
                                                                                        "function": {"project": {"typeName": "hydra.core.model.CaseStatement", "fieldName": "default"}},
                                                                                        "argument": {"variable": "cs"}}}}}}},
                                                                            "argument": {
                                                                              "lambda": {
                                                                                "parameter": "rdflt",
                                                                                "domain": {"optional": {"variable": "hydra.core.model.Term"}},
                                                                                "body": {
                                                                                  "application": {
                                                                                    "function": {
                                                                                      "application": {
                                                                                        "function": {
                                                                                          "typeApplication": {
                                                                                            "body": {
                                                                                              "typeApplication": {
                                                                                                "body": {
                                                                                                  "typeApplication": {"body": {"variable": "hydra.core.lib.eithers.map"}, "type": {"list": {"variable": "hydra.core.model.CaseAlternative"}}}},
                                                                                                "type": {"variable": "hydra.core.model.Term"}}},
                                                                                            "type": {"literal": "string"}}},
                                                                                        "argument": {
                                                                                          "lambda": {
                                                                                            "parameter": "rcases",
                                                                                            "domain": {"list": {"variable": "hydra.core.model.CaseAlternative"}},
                                                                                            "body": {
                                                                                              "inject": {
                                                                                                "typeName": "hydra.core.model.Term",
                                                                                                "field": {
                                                                                                  "name": "cases",
                                                                                                  "term": {
                                                                                                    "record": {
                                                                                                      "typeName": "hydra.core.model.CaseStatement",
                                                                                                      "fields": [
                                                                                                        {"name": "typeName", "term": {"variable": "tn"}},
                                                                                                        {"name": "default", "term": {"variable": "rdflt"}},
                                                                                                        {"name": "cases", "term": {"variable": "rcases"}}]}}}}}}}}},
                                                                                    "argument": {
                                                                                      "application": {
                                                                                        "function": {
                                                                                          "application": {
                                                                                            "function": {
                                                                                              "typeApplication": {
                                                                                                "body": {
                                                                                                  "typeApplication": {
                                                                                                    "body": {
                                                                                                      "typeApplication": {"body": {"variable": "hydra.core.lib.eithers.mapList"}, "type": {"variable": "hydra.core.model.CaseAlternative"}}},
                                                                                                    "type": {"variable": "hydra.core.model.CaseAlternative"}}},
                                                                                                "type": {"literal": "string"}}},
                                                                                            "argument": {"application": {"function": {"variable": "forCaseAlternative"}, "argument": {"variable": "bound"}}}}},
                                                                                        "argument": {
                                                                                          "application": {
                                                                                            "function": {"project": {"typeName": "hydra.core.model.CaseStatement", "fieldName": "cases"}},
                                                                                            "argument": {"variable": "cs"}}}}}}}}}}}}}}}}}},
                                                          {
                                                            "name": "either",
                                                            "handler": {
                                                              "lambda": {
                                                                "parameter": "e",
                                                                "domain": {"either": {"left": {"variable": "hydra.core.model.Term"}, "right": {"variable": "hydra.core.model.Term"}}},
                                                                "body": {
                                                                  "application": {
                                                                    "function": {
                                                                      "application": {
                                                                        "function": {
                                                                          "typeApplication": {
                                                                            "body": {
                                                                              "typeApplication": {
                                                                                "body": {"typeApplication": {"body": {"variable": "hydra.core.lib.eithers.bind"}, "type": {"literal": "string"}}},
                                                                                "type": {"either": {"left": {"variable": "hydra.core.model.Term"}, "right": {"variable": "hydra.core.model.Term"}}}}},
                                                                            "type": {"variable": "hydra.core.model.Term"}}},
                                                                        "argument": {
                                                                          "application": {
                                                                            "function": {
                                                                              "application": {
                                                                                "function": {
                                                                                  "application": {
                                                                                    "function": {
                                                                                      "typeApplication": {
                                                                                        "body": {
                                                                                          "typeApplication": {
                                                                                            "body": {
                                                                                              "typeApplication": {"body": {"variable": "hydra.core.lib.eithers.either"}, "type": {"variable": "hydra.core.model.Term"}}},
                                                                                            "type": {"variable": "hydra.core.model.Term"}}},
                                                                                        "type": {
                                                                                          "either": {
                                                                                            "left": {"literal": "string"},
                                                                                            "right": {"either": {"left": {"variable": "hydra.core.model.Term"}, "right": {"variable": "hydra.core.model.Term"}}}}}}},
                                                                                    "argument": {
                                                                                      "lambda": {
                                                                                        "parameter": "l",
                                                                                        "domain": {"variable": "hydra.core.model.Term"},
                                                                                        "body": {
                                                                                          "application": {
                                                                                            "function": {
                                                                                              "application": {
                                                                                                "function": {
                                                                                                  "typeApplication": {
                                                                                                    "body": {
                                                                                                      "typeApplication": {
                                                                                                        "body": {"typeApplication": {"body": {"variable": "hydra.core.lib.eithers.map"}, "type": {"variable": "hydra.core.model.Term"}}},
                                                                                                        "type": {"either": {"left": {"variable": "hydra.core.model.Term"}, "right": {"variable": "hydra.core.model.Term"}}}}},
                                                                                                    "type": {"literal": "string"}}},
                                                                                                "argument": {
                                                                                                  "lambda": {
                                                                                                    "parameter": "x",
                                                                                                    "domain": {"variable": "hydra.core.model.Term"},
                                                                                                    "body": {
                                                                                                      "typeApplication": {
                                                                                                        "body": {"typeApplication": {"body": {"either": {"left": {"variable": "x"}}}, "type": {"variable": "hydra.core.model.Term"}}},
                                                                                                        "type": {"variable": "hydra.core.model.Term"}}}}}}},
                                                                                            "argument": {
                                                                                              "application": {
                                                                                                "function": {"application": {"function": {"variable": "recurse"}, "argument": {"variable": "bound"}}},
                                                                                                "argument": {"variable": "l"}}}}}}}}},
                                                                                "argument": {
                                                                                  "lambda": {
                                                                                    "parameter": "r",
                                                                                    "domain": {"variable": "hydra.core.model.Term"},
                                                                                    "body": {
                                                                                      "application": {
                                                                                        "function": {
                                                                                          "application": {
                                                                                            "function": {
                                                                                              "typeApplication": {
                                                                                                "body": {
                                                                                                  "typeApplication": {
                                                                                                    "body": {"typeApplication": {"body": {"variable": "hydra.core.lib.eithers.map"}, "type": {"variable": "hydra.core.model.Term"}}},
                                                                                                    "type": {"either": {"left": {"variable": "hydra.core.model.Term"}, "right": {"variable": "hydra.core.model.Term"}}}}},
                                                                                                "type": {"literal": "string"}}},
                                                                                            "argument": {
                                                                                              "lambda": {
                                                                                                "parameter": "x",
                                                                                                "domain": {"variable": "hydra.core.model.Term"},
                                                                                                "body": {
                                                                                                  "typeApplication": {
                                                                                                    "body": {"typeApplication": {"body": {"either": {"right": {"variable": "x"}}}, "type": {"variable": "hydra.core.model.Term"}}},
                                                                                                    "type": {"variable": "hydra.core.model.Term"}}}}}}},
                                                                                        "argument": {
                                                                                          "application": {
                                                                                            "function": {"application": {"function": {"variable": "recurse"}, "argument": {"variable": "bound"}}},
                                                                                            "argument": {"variable": "r"}}}}}}}}},
                                                                            "argument": {"variable": "e"}}}}},
                                                                    "argument": {
                                                                      "lambda": {
                                                                        "parameter": "re",
                                                                        "domain": {"either": {"left": {"variable": "hydra.core.model.Term"}, "right": {"variable": "hydra.core.model.Term"}}},
                                                                        "body": {
                                                                          "typeApplication": {
                                                                            "body": {
                                                                              "typeApplication": {
                                                                                "body": {
                                                                                  "either": {"right": {"inject": {"typeName": "hydra.core.model.Term", "field": {"name": "either", "term": {"variable": "re"}}}}}},
                                                                                "type": {"literal": "string"}}},
                                                                            "type": {"variable": "hydra.core.model.Term"}}}}}}}}}},
                                                          {
                                                            "name": "lambda",
                                                            "handler": {
                                                              "lambda": {
                                                                "parameter": "l",
                                                                "domain": {"variable": "hydra.core.model.Lambda"},
                                                                "body": {
                                                                  "let": {
                                                                    "bindings": [
                                                                      {
                                                                        "name": "param",
                                                                        "term": {
                                                                          "application": {
                                                                            "function": {"project": {"typeName": "hydra.core.model.Lambda", "fieldName": "parameter"}},
                                                                            "argument": {"variable": "l"}}},
                                                                        "typeScheme": {"variables": [], "body": {"variable": "hydra.core.model.Name"}, "constraints": []}}],
                                                                    "body": {
                                                                      "let": {
                                                                        "bindings": [
                                                                          {
                                                                            "name": "bound'",
                                                                            "term": {
                                                                              "application": {
                                                                                "function": {
                                                                                  "application": {
                                                                                    "function": {"typeApplication": {"body": {"variable": "hydra.core.lib.sets.insert"}, "type": {"literal": "string"}}},
                                                                                    "argument": {"application": {"function": {"unwrap": "hydra.core.model.Name"}, "argument": {"variable": "param"}}}}},
                                                                                "argument": {"variable": "bound"}}},
                                                                            "typeScheme": {"variables": [], "body": {"set": {"literal": "string"}}, "constraints": []}}],
                                                                        "body": {
                                                                          "application": {
                                                                            "function": {
                                                                              "application": {
                                                                                "function": {
                                                                                  "typeApplication": {
                                                                                    "body": {
                                                                                      "typeApplication": {
                                                                                        "body": {"typeApplication": {"body": {"variable": "hydra.core.lib.eithers.map"}, "type": {"variable": "hydra.core.model.Term"}}},
                                                                                        "type": {"variable": "hydra.core.model.Term"}}},
                                                                                    "type": {"literal": "string"}}},
                                                                                "argument": {
                                                                                  "lambda": {
                                                                                    "parameter": "b",
                                                                                    "domain": {"variable": "hydra.core.model.Term"},
                                                                                    "body": {
                                                                                      "inject": {
                                                                                        "typeName": "hydra.core.model.Term",
                                                                                        "field": {
                                                                                          "name": "lambda",
                                                                                          "term": {
                                                                                            "record": {
                                                                                              "typeName": "hydra.core.model.Lambda",
                                                                                              "fields": [
                                                                                                {"name": "parameter", "term": {"variable": "param"}},
                                                                                                {
                                                                                                  "name": "domain",
                                                                                                  "term": {
                                                                                                    "application": {"function": {"project": {"typeName": "hydra.core.model.Lambda", "fieldName": "domain"}}, "argument": {"variable": "l"}}}},
                                                                                                {"name": "body", "term": {"variable": "b"}}]}}}}}}}}},
                                                                            "argument": {
                                                                              "application": {
                                                                                "function": {
                                                                                  "application": {
                                                                                    "function": {
                                                                                      "application": {
                                                                                        "function": {
                                                                                          "application": {
                                                                                            "function": {
                                                                                              "application": {"function": {"variable": "hydra.core.parse.packaging.resolveNameRefsInTermWith"}, "argument": {"variable": "modName"}}},
                                                                                            "argument": {"variable": "ownNames"}}},
                                                                                        "argument": {"variable": "universe"}}},
                                                                                    "argument": {"variable": "bound'"}}},
                                                                                "argument": {
                                                                                  "application": {"function": {"project": {"typeName": "hydra.core.model.Lambda", "fieldName": "body"}}, "argument": {"variable": "l"}}}}}}}}}}}}}},
                                                          {
                                                            "name": "let",
                                                            "handler": {
                                                              "lambda": {
                                                                "parameter": "lt",
                                                                "domain": {"variable": "hydra.core.model.Let"},
                                                                "body": {
                                                                  "let": {
                                                                    "bindings": [
                                                                      {
                                                                        "name": "bindingNames",
                                                                        "term": {
                                                                          "application": {
                                                                            "function": {"typeApplication": {"body": {"variable": "hydra.core.lib.sets.fromList"}, "type": {"literal": "string"}}},
                                                                            "argument": {
                                                                              "application": {
                                                                                "function": {
                                                                                  "application": {
                                                                                    "function": {
                                                                                      "typeApplication": {
                                                                                        "body": {
                                                                                          "typeApplication": {"body": {"variable": "hydra.core.lib.lists.map"}, "type": {"variable": "hydra.core.model.Binding"}}},
                                                                                        "type": {"literal": "string"}}},
                                                                                    "argument": {
                                                                                      "lambda": {
                                                                                        "parameter": "b",
                                                                                        "domain": {"variable": "hydra.core.model.Binding"},
                                                                                        "body": {
                                                                                          "application": {
                                                                                            "function": {"unwrap": "hydra.core.model.Name"},
                                                                                            "argument": {
                                                                                              "application": {"function": {"project": {"typeName": "hydra.core.model.Binding", "fieldName": "name"}}, "argument": {"variable": "b"}}}}}}}}},
                                                                                "argument": {
                                                                                  "application": {"function": {"project": {"typeName": "hydra.core.model.Let", "fieldName": "bindings"}}, "argument": {"variable": "lt"}}}}}}},
                                                                        "typeScheme": {"variables": [], "body": {"set": {"literal": "string"}}, "constraints": []}}],
                                                                    "body": {
                                                                      "let": {
                                                                        "bindings": [
                                                                          {
                                                                            "name": "bound'",
                                                                            "term": {
                                                                              "application": {
                                                                                "function": {
                                                                                  "application": {
                                                                                    "function": {"typeApplication": {"body": {"variable": "hydra.core.lib.sets.union"}, "type": {"literal": "string"}}},
                                                                                    "argument": {"variable": "bound"}}},
                                                                                "argument": {"variable": "bindingNames"}}},
                                                                            "typeScheme": {"variables": [], "body": {"set": {"literal": "string"}}, "constraints": []}}],
                                                                        "body": {
                                                                          "let": {
                                                                            "bindings": [
                                                                              {
                                                                                "name": "mapBinding",
                                                                                "term": {
                                                                                  "lambda": {
                                                                                    "parameter": "b",
                                                                                    "domain": {"variable": "hydra.core.model.Binding"},
                                                                                    "body": {
                                                                                      "application": {
                                                                                        "function": {
                                                                                          "application": {
                                                                                            "function": {
                                                                                              "typeApplication": {
                                                                                                "body": {
                                                                                                  "typeApplication": {
                                                                                                    "body": {"typeApplication": {"body": {"variable": "hydra.core.lib.eithers.map"}, "type": {"variable": "hydra.core.model.Term"}}},
                                                                                                    "type": {"variable": "hydra.core.model.Binding"}}},
                                                                                                "type": {"literal": "string"}}},
                                                                                            "argument": {
                                                                                              "lambda": {
                                                                                                "parameter": "t",
                                                                                                "domain": {"variable": "hydra.core.model.Term"},
                                                                                                "body": {
                                                                                                  "record": {
                                                                                                    "typeName": "hydra.core.model.Binding",
                                                                                                    "fields": [
                                                                                                      {
                                                                                                        "name": "name",
                                                                                                        "term": {
                                                                                                          "application": {"function": {"project": {"typeName": "hydra.core.model.Binding", "fieldName": "name"}}, "argument": {"variable": "b"}}}},
                                                                                                      {"name": "term", "term": {"variable": "t"}},
                                                                                                      {
                                                                                                        "name": "typeScheme",
                                                                                                        "term": {
                                                                                                          "application": {
                                                                                                            "function": {"project": {"typeName": "hydra.core.model.Binding", "fieldName": "typeScheme"}},
                                                                                                            "argument": {"variable": "b"}}}}]}}}}}},
                                                                                        "argument": {
                                                                                          "application": {
                                                                                            "function": {
                                                                                              "application": {
                                                                                                "function": {
                                                                                                  "application": {
                                                                                                    "function": {
                                                                                                      "application": {
                                                                                                        "function": {
                                                                                                          "application": {"function": {"variable": "hydra.core.parse.packaging.resolveNameRefsInTermWith"}, "argument": {"variable": "modName"}}},
                                                                                                        "argument": {"variable": "ownNames"}}},
                                                                                                    "argument": {"variable": "universe"}}},
                                                                                                "argument": {"variable": "bound'"}}},
                                                                                            "argument": {
                                                                                              "application": {"function": {"project": {"typeName": "hydra.core.model.Binding", "fieldName": "term"}}, "argument": {"variable": "b"}}}}}}}}},
                                                                                "typeScheme": {
                                                                                  "variables": [],
                                                                                  "body": {
                                                                                    "function": {
                                                                                      "domain": {"variable": "hydra.core.model.Binding"},
                                                                                      "codomain": {"either": {"left": {"literal": "string"}, "right": {"variable": "hydra.core.model.Binding"}}}}},
                                                                                  "constraints": []}}],
                                                                            "body": {
                                                                              "application": {
                                                                                "function": {
                                                                                  "application": {
                                                                                    "function": {
                                                                                      "typeApplication": {
                                                                                        "body": {
                                                                                          "typeApplication": {
                                                                                            "body": {"typeApplication": {"body": {"variable": "hydra.core.lib.eithers.bind"}, "type": {"literal": "string"}}},
                                                                                            "type": {"list": {"variable": "hydra.core.model.Binding"}}}},
                                                                                        "type": {"variable": "hydra.core.model.Term"}}},
                                                                                    "argument": {
                                                                                      "application": {
                                                                                        "function": {
                                                                                          "application": {
                                                                                            "function": {
                                                                                              "typeApplication": {
                                                                                                "body": {
                                                                                                  "typeApplication": {
                                                                                                    "body": {
                                                                                                      "typeApplication": {"body": {"variable": "hydra.core.lib.eithers.mapList"}, "type": {"variable": "hydra.core.model.Binding"}}},
                                                                                                    "type": {"variable": "hydra.core.model.Binding"}}},
                                                                                                "type": {"literal": "string"}}},
                                                                                            "argument": {"variable": "mapBinding"}}},
                                                                                        "argument": {
                                                                                          "application": {"function": {"project": {"typeName": "hydra.core.model.Let", "fieldName": "bindings"}}, "argument": {"variable": "lt"}}}}}}},
                                                                                "argument": {
                                                                                  "lambda": {
                                                                                    "parameter": "rbindings",
                                                                                    "domain": {"list": {"variable": "hydra.core.model.Binding"}},
                                                                                    "body": {
                                                                                      "application": {
                                                                                        "function": {
                                                                                          "application": {
                                                                                            "function": {
                                                                                              "typeApplication": {
                                                                                                "body": {
                                                                                                  "typeApplication": {
                                                                                                    "body": {"typeApplication": {"body": {"variable": "hydra.core.lib.eithers.map"}, "type": {"variable": "hydra.core.model.Term"}}},
                                                                                                    "type": {"variable": "hydra.core.model.Term"}}},
                                                                                                "type": {"literal": "string"}}},
                                                                                            "argument": {
                                                                                              "lambda": {
                                                                                                "parameter": "renv",
                                                                                                "domain": {"variable": "hydra.core.model.Term"},
                                                                                                "body": {
                                                                                                  "inject": {
                                                                                                    "typeName": "hydra.core.model.Term",
                                                                                                    "field": {
                                                                                                      "name": "let",
                                                                                                      "term": {
                                                                                                        "record": {
                                                                                                          "typeName": "hydra.core.model.Let",
                                                                                                          "fields": [{"name": "bindings", "term": {"variable": "rbindings"}}, {"name": "body", "term": {"variable": "renv"}}]}}}}}}}}},
                                                                                        "argument": {
                                                                                          "application": {
                                                                                            "function": {
                                                                                              "application": {
                                                                                                "function": {
                                                                                                  "application": {
                                                                                                    "function": {
                                                                                                      "application": {
                                                                                                        "function": {
                                                                                                          "application": {"function": {"variable": "hydra.core.parse.packaging.resolveNameRefsInTermWith"}, "argument": {"variable": "modName"}}},
                                                                                                        "argument": {"variable": "ownNames"}}},
                                                                                                    "argument": {"variable": "universe"}}},
                                                                                                "argument": {"variable": "bound'"}}},
                                                                                            "argument": {
                                                                                              "application": {"function": {"project": {"typeName": "hydra.core.model.Let", "fieldName": "body"}}, "argument": {"variable": "lt"}}}}}}}}}}}}}}}}}}}},
                                                          {
                                                            "name": "list",
                                                            "handler": {
                                                              "lambda": {
                                                                "parameter": "els",
                                                                "domain": {"list": {"variable": "hydra.core.model.Term"}},
                                                                "body": {
                                                                  "application": {
                                                                    "function": {
                                                                      "application": {
                                                                        "function": {
                                                                          "typeApplication": {
                                                                            "body": {
                                                                              "typeApplication": {
                                                                                "body": {
                                                                                  "typeApplication": {"body": {"variable": "hydra.core.lib.eithers.map"}, "type": {"list": {"variable": "hydra.core.model.Term"}}}},
                                                                                "type": {"variable": "hydra.core.model.Term"}}},
                                                                            "type": {"literal": "string"}}},
                                                                        "argument": {
                                                                          "lambda": {
                                                                            "parameter": "x",
                                                                            "domain": {"list": {"variable": "hydra.core.model.Term"}},
                                                                            "body": {"inject": {"typeName": "hydra.core.model.Term", "field": {"name": "list", "term": {"variable": "x"}}}}}}}},
                                                                    "argument": {
                                                                      "application": {
                                                                        "function": {
                                                                          "application": {
                                                                            "function": {
                                                                              "typeApplication": {
                                                                                "body": {
                                                                                  "typeApplication": {
                                                                                    "body": {
                                                                                      "typeApplication": {"body": {"variable": "hydra.core.lib.eithers.mapList"}, "type": {"variable": "hydra.core.model.Term"}}},
                                                                                    "type": {"variable": "hydra.core.model.Term"}}},
                                                                                "type": {"literal": "string"}}},
                                                                            "argument": {"application": {"function": {"variable": "recurse"}, "argument": {"variable": "bound"}}}}},
                                                                        "argument": {"variable": "els"}}}}}}}},
                                                          {
                                                            "name": "literal",
                                                            "handler": {
                                                              "lambda": {
                                                                "parameter": "v",
                                                                "domain": {"variable": "hydra.core.model.Literal"},
                                                                "body": {
                                                                  "typeApplication": {
                                                                    "body": {
                                                                      "typeApplication": {
                                                                        "body": {
                                                                          "either": {"right": {"inject": {"typeName": "hydra.core.model.Term", "field": {"name": "literal", "term": {"variable": "v"}}}}}},
                                                                        "type": {"literal": "string"}}},
                                                                    "type": {"variable": "hydra.core.model.Term"}}}}}},
                                                          {
                                                            "name": "map",
                                                            "handler": {
                                                              "lambda": {
                                                                "parameter": "m",
                                                                "domain": {"map": {"keys": {"variable": "hydra.core.model.Term"}, "values": {"variable": "hydra.core.model.Term"}}},
                                                                "body": {
                                                                  "let": {
                                                                    "bindings": [
                                                                      {
                                                                        "name": "forPair",
                                                                        "term": {
                                                                          "lambda": {
                                                                            "parameter": "p",
                                                                            "domain": {"pair": {"first": {"variable": "hydra.core.model.Term"}, "second": {"variable": "hydra.core.model.Term"}}},
                                                                            "body": {
                                                                              "application": {
                                                                                "function": {
                                                                                  "application": {
                                                                                    "function": {
                                                                                      "typeApplication": {
                                                                                        "body": {
                                                                                          "typeApplication": {
                                                                                            "body": {"typeApplication": {"body": {"variable": "hydra.core.lib.eithers.bind"}, "type": {"literal": "string"}}},
                                                                                            "type": {"variable": "hydra.core.model.Term"}}},
                                                                                        "type": {"pair": {"first": {"variable": "hydra.core.model.Term"}, "second": {"variable": "hydra.core.model.Term"}}}}},
                                                                                    "argument": {
                                                                                      "application": {
                                                                                        "function": {"application": {"function": {"variable": "recurse"}, "argument": {"variable": "bound"}}},
                                                                                        "argument": {
                                                                                          "application": {
                                                                                            "function": {
                                                                                              "typeApplication": {
                                                                                                "body": {"typeApplication": {"body": {"variable": "hydra.core.lib.pairs.first"}, "type": {"variable": "hydra.core.model.Term"}}},
                                                                                                "type": {"variable": "hydra.core.model.Term"}}},
                                                                                            "argument": {"variable": "p"}}}}}}},
                                                                                "argument": {
                                                                                  "lambda": {
                                                                                    "parameter": "k",
                                                                                    "domain": {"variable": "hydra.core.model.Term"},
                                                                                    "body": {
                                                                                      "application": {
                                                                                        "function": {
                                                                                          "application": {
                                                                                            "function": {
                                                                                              "typeApplication": {
                                                                                                "body": {
                                                                                                  "typeApplication": {
                                                                                                    "body": {"typeApplication": {"body": {"variable": "hydra.core.lib.eithers.map"}, "type": {"variable": "hydra.core.model.Term"}}},
                                                                                                    "type": {"pair": {"first": {"variable": "hydra.core.model.Term"}, "second": {"variable": "hydra.core.model.Term"}}}}},
                                                                                                "type": {"literal": "string"}}},
                                                                                            "argument": {
                                                                                              "lambda": {
                                                                                                "parameter": "v",
                                                                                                "domain": {"variable": "hydra.core.model.Term"},
                                                                                                "body": {
                                                                                                  "typeApplication": {
                                                                                                    "body": {
                                                                                                      "typeApplication": {
                                                                                                        "body": {"pair": {"first": {"variable": "k"}, "second": {"variable": "v"}}},
                                                                                                        "type": {"variable": "hydra.core.model.Term"}}},
                                                                                                    "type": {"variable": "hydra.core.model.Term"}}}}}}},
                                                                                        "argument": {
                                                                                          "application": {
                                                                                            "function": {"application": {"function": {"variable": "recurse"}, "argument": {"variable": "bound"}}},
                                                                                            "argument": {
                                                                                              "application": {
                                                                                                "function": {
                                                                                                  "typeApplication": {
                                                                                                    "body": {
                                                                                                      "typeApplication": {"body": {"variable": "hydra.core.lib.pairs.second"}, "type": {"variable": "hydra.core.model.Term"}}},
                                                                                                    "type": {"variable": "hydra.core.model.Term"}}},
                                                                                                "argument": {"variable": "p"}}}}}}}}}}}}},
                                                                        "typeScheme": {
                                                                          "variables": [],
                                                                          "body": {
                                                                            "function": {
                                                                              "domain": {"pair": {"first": {"variable": "hydra.core.model.Term"}, "second": {"variable": "hydra.core.model.Term"}}},
                                                                              "codomain": {
                                                                                "either": {
                                                                                  "left": {"literal": "string"},
                                                                                  "right": {"pair": {"first": {"variable": "hydra.core.model.Term"}, "second": {"variable": "hydra.core.model.Term"}}}}}}},
                                                                          "constraints": []}}],
                                                                    "body": {
                                                                      "application": {
                                                                        "function": {
                                                                          "application": {
                                                                            "function": {
                                                                              "typeApplication": {
                                                                                "body": {
                                                                                  "typeApplication": {
                                                                                    "body": {
                                                                                      "typeApplication": {
                                                                                        "body": {"variable": "hydra.core.lib.eithers.map"},
                                                                                        "type": {"list": {"pair": {"first": {"variable": "hydra.core.model.Term"}, "second": {"variable": "hydra.core.model.Term"}}}}}},
                                                                                    "type": {"variable": "hydra.core.model.Term"}}},
                                                                                "type": {"literal": "string"}}},
                                                                            "argument": {
                                                                              "lambda": {
                                                                                "parameter": "rpairs",
                                                                                "domain": {"list": {"pair": {"first": {"variable": "hydra.core.model.Term"}, "second": {"variable": "hydra.core.model.Term"}}}},
                                                                                "body": {
                                                                                  "inject": {
                                                                                    "typeName": "hydra.core.model.Term",
                                                                                    "field": {
                                                                                      "name": "map",
                                                                                      "term": {
                                                                                        "application": {
                                                                                          "function": {
                                                                                            "typeApplication": {
                                                                                              "body": {
                                                                                                "typeApplication": {"body": {"variable": "hydra.core.lib.maps.fromList"}, "type": {"variable": "hydra.core.model.Term"}}},
                                                                                              "type": {"variable": "hydra.core.model.Term"}}},
                                                                                          "argument": {"variable": "rpairs"}}}}}}}}}},
                                                                        "argument": {
                                                                          "application": {
                                                                            "function": {
                                                                              "application": {
                                                                                "function": {
                                                                                  "typeApplication": {
                                                                                    "body": {
                                                                                      "typeApplication": {
                                                                                        "body": {
                                                                                          "typeApplication": {
                                                                                            "body": {"variable": "hydra.core.lib.eithers.mapList"},
                                                                                            "type": {"pair": {"first": {"variable": "hydra.core.model.Term"}, "second": {"variable": "hydra.core.model.Term"}}}}},
                                                                                        "type": {"pair": {"first": {"variable": "hydra.core.model.Term"}, "second": {"variable": "hydra.core.model.Term"}}}}},
                                                                                    "type": {"literal": "string"}}},
                                                                                "argument": {"variable": "forPair"}}},
                                                                            "argument": {
                                                                              "application": {
                                                                                "function": {
                                                                                  "typeApplication": {
                                                                                    "body": {"typeApplication": {"body": {"variable": "hydra.core.lib.maps.toList"}, "type": {"variable": "hydra.core.model.Term"}}},
                                                                                    "type": {"variable": "hydra.core.model.Term"}}},
                                                                                "argument": {"variable": "m"}}}}}}}}}}}},
                                                          {
                                                            "name": "optional",
                                                            "handler": {
                                                              "lambda": {
                                                                "parameter": "m",
                                                                "domain": {"optional": {"variable": "hydra.core.model.Term"}},
                                                                "body": {
                                                                  "application": {
                                                                    "function": {
                                                                      "application": {
                                                                        "function": {
                                                                          "typeApplication": {
                                                                            "body": {
                                                                              "typeApplication": {
                                                                                "body": {
                                                                                  "typeApplication": {"body": {"variable": "hydra.core.lib.eithers.map"}, "type": {"optional": {"variable": "hydra.core.model.Term"}}}},
                                                                                "type": {"variable": "hydra.core.model.Term"}}},
                                                                            "type": {"literal": "string"}}},
                                                                        "argument": {
                                                                          "lambda": {
                                                                            "parameter": "x",
                                                                            "domain": {"optional": {"variable": "hydra.core.model.Term"}},
                                                                            "body": {"inject": {"typeName": "hydra.core.model.Term", "field": {"name": "optional", "term": {"variable": "x"}}}}}}}},
                                                                    "argument": {
                                                                      "application": {
                                                                        "function": {
                                                                          "application": {
                                                                            "function": {
                                                                              "typeApplication": {
                                                                                "body": {
                                                                                  "typeApplication": {
                                                                                    "body": {
                                                                                      "typeApplication": {"body": {"variable": "hydra.core.lib.eithers.mapOptional"}, "type": {"variable": "hydra.core.model.Term"}}},
                                                                                    "type": {"variable": "hydra.core.model.Term"}}},
                                                                                "type": {"literal": "string"}}},
                                                                            "argument": {"application": {"function": {"variable": "recurse"}, "argument": {"variable": "bound"}}}}},
                                                                        "argument": {"variable": "m"}}}}}}}},
                                                          {
                                                            "name": "pair",
                                                            "handler": {
                                                              "lambda": {
                                                                "parameter": "p",
                                                                "domain": {"pair": {"first": {"variable": "hydra.core.model.Term"}, "second": {"variable": "hydra.core.model.Term"}}},
                                                                "body": {
                                                                  "application": {
                                                                    "function": {
                                                                      "application": {
                                                                        "function": {
                                                                          "typeApplication": {
                                                                            "body": {
                                                                              "typeApplication": {
                                                                                "body": {"typeApplication": {"body": {"variable": "hydra.core.lib.eithers.bind"}, "type": {"literal": "string"}}},
                                                                                "type": {"variable": "hydra.core.model.Term"}}},
                                                                            "type": {"variable": "hydra.core.model.Term"}}},
                                                                        "argument": {
                                                                          "application": {
                                                                            "function": {"application": {"function": {"variable": "recurse"}, "argument": {"variable": "bound"}}},
                                                                            "argument": {
                                                                              "application": {
                                                                                "function": {
                                                                                  "typeApplication": {
                                                                                    "body": {"typeApplication": {"body": {"variable": "hydra.core.lib.pairs.first"}, "type": {"variable": "hydra.core.model.Term"}}},
                                                                                    "type": {"variable": "hydra.core.model.Term"}}},
                                                                                "argument": {"variable": "p"}}}}}}},
                                                                    "argument": {
                                                                      "lambda": {
                                                                        "parameter": "f",
                                                                        "domain": {"variable": "hydra.core.model.Term"},
                                                                        "body": {
                                                                          "application": {
                                                                            "function": {
                                                                              "application": {
                                                                                "function": {
                                                                                  "typeApplication": {
                                                                                    "body": {
                                                                                      "typeApplication": {
                                                                                        "body": {"typeApplication": {"body": {"variable": "hydra.core.lib.eithers.map"}, "type": {"variable": "hydra.core.model.Term"}}},
                                                                                        "type": {"variable": "hydra.core.model.Term"}}},
                                                                                    "type": {"literal": "string"}}},
                                                                                "argument": {
                                                                                  "lambda": {
                                                                                    "parameter": "s",
                                                                                    "domain": {"variable": "hydra.core.model.Term"},
                                                                                    "body": {
                                                                                      "inject": {
                                                                                        "typeName": "hydra.core.model.Term",
                                                                                        "field": {
                                                                                          "name": "pair",
                                                                                          "term": {
                                                                                            "typeApplication": {
                                                                                              "body": {
                                                                                                "typeApplication": {
                                                                                                  "body": {"pair": {"first": {"variable": "f"}, "second": {"variable": "s"}}},
                                                                                                  "type": {"variable": "hydra.core.model.Term"}}},
                                                                                              "type": {"variable": "hydra.core.model.Term"}}}}}}}}}},
                                                                            "argument": {
                                                                              "application": {
                                                                                "function": {"application": {"function": {"variable": "recurse"}, "argument": {"variable": "bound"}}},
                                                                                "argument": {
                                                                                  "application": {
                                                                                    "function": {
                                                                                      "typeApplication": {
                                                                                        "body": {
                                                                                          "typeApplication": {"body": {"variable": "hydra.core.lib.pairs.second"}, "type": {"variable": "hydra.core.model.Term"}}},
                                                                                        "type": {"variable": "hydra.core.model.Term"}}},
                                                                                    "argument": {"variable": "p"}}}}}}}}}}}}}},
                                                          {
                                                            "name": "project",
                                                            "handler": {
                                                              "lambda": {
                                                                "parameter": "p",
                                                                "domain": {"variable": "hydra.core.model.Projection"},
                                                                "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.model.Term"}}},
                                                                            "type": {"literal": "string"}}},
                                                                        "argument": {
                                                                          "lambda": {
                                                                            "parameter": "tn",
                                                                            "domain": {"variable": "hydra.core.model.Name"},
                                                                            "body": {
                                                                              "inject": {
                                                                                "typeName": "hydra.core.model.Term",
                                                                                "field": {
                                                                                  "name": "project",
                                                                                  "term": {
                                                                                    "record": {
                                                                                      "typeName": "hydra.core.model.Projection",
                                                                                      "fields": [
                                                                                        {"name": "typeName", "term": {"variable": "tn"}},
                                                                                        {
                                                                                          "name": "fieldName",
                                                                                          "term": {
                                                                                            "application": {
                                                                                              "function": {"project": {"typeName": "hydra.core.model.Projection", "fieldName": "fieldName"}},
                                                                                              "argument": {"variable": "p"}}}}]}}}}}}}}},
                                                                    "argument": {
                                                                      "application": {
                                                                        "function": {"variable": "resolveN"},
                                                                        "argument": {
                                                                          "application": {
                                                                            "function": {"project": {"typeName": "hydra.core.model.Projection", "fieldName": "typeName"}},
                                                                            "argument": {"variable": "p"}}}}}}}}}},
                                                          {
                                                            "name": "record",
                                                            "handler": {
                                                              "lambda": {
                                                                "parameter": "r",
                                                                "domain": {"variable": "hydra.core.model.Record"},
                                                                "body": {
                                                                  "application": {
                                                                    "function": {
                                                                      "application": {
                                                                        "function": {
                                                                          "typeApplication": {
                                                                            "body": {
                                                                              "typeApplication": {
                                                                                "body": {"typeApplication": {"body": {"variable": "hydra.core.lib.eithers.bind"}, "type": {"literal": "string"}}},
                                                                                "type": {"variable": "hydra.core.model.Name"}}},
                                                                            "type": {"variable": "hydra.core.model.Term"}}},
                                                                        "argument": {
                                                                          "application": {
                                                                            "function": {"variable": "resolveN"},
                                                                            "argument": {
                                                                              "application": {
                                                                                "function": {"project": {"typeName": "hydra.core.model.Record", "fieldName": "typeName"}},
                                                                                "argument": {"variable": "r"}}}}}}},
                                                                    "argument": {
                                                                      "lambda": {
                                                                        "parameter": "tn",
                                                                        "domain": {"variable": "hydra.core.model.Name"},
                                                                        "body": {
                                                                          "application": {
                                                                            "function": {
                                                                              "application": {
                                                                                "function": {
                                                                                  "typeApplication": {
                                                                                    "body": {
                                                                                      "typeApplication": {
                                                                                        "body": {
                                                                                          "typeApplication": {"body": {"variable": "hydra.core.lib.eithers.map"}, "type": {"list": {"variable": "hydra.core.model.Field"}}}},
                                                                                        "type": {"variable": "hydra.core.model.Term"}}},
                                                                                    "type": {"literal": "string"}}},
                                                                                "argument": {
                                                                                  "lambda": {
                                                                                    "parameter": "rfields",
                                                                                    "domain": {"list": {"variable": "hydra.core.model.Field"}},
                                                                                    "body": {
                                                                                      "inject": {
                                                                                        "typeName": "hydra.core.model.Term",
                                                                                        "field": {
                                                                                          "name": "record",
                                                                                          "term": {
                                                                                            "record": {
                                                                                              "typeName": "hydra.core.model.Record",
                                                                                              "fields": [{"name": "typeName", "term": {"variable": "tn"}}, {"name": "fields", "term": {"variable": "rfields"}}]}}}}}}}}},
                                                                            "argument": {
                                                                              "application": {
                                                                                "function": {
                                                                                  "application": {
                                                                                    "function": {
                                                                                      "typeApplication": {
                                                                                        "body": {
                                                                                          "typeApplication": {
                                                                                            "body": {
                                                                                              "typeApplication": {"body": {"variable": "hydra.core.lib.eithers.mapList"}, "type": {"variable": "hydra.core.model.Field"}}},
                                                                                            "type": {"variable": "hydra.core.model.Field"}}},
                                                                                        "type": {"literal": "string"}}},
                                                                                    "argument": {"application": {"function": {"variable": "forField"}, "argument": {"variable": "bound"}}}}},
                                                                                "argument": {
                                                                                  "application": {"function": {"project": {"typeName": "hydra.core.model.Record", "fieldName": "fields"}}, "argument": {"variable": "r"}}}}}}}}}}}}}},
                                                          {
                                                            "name": "set",
                                                            "handler": {
                                                              "lambda": {
                                                                "parameter": "s",
                                                                "domain": {"set": {"variable": "hydra.core.model.Term"}},
                                                                "body": {
                                                                  "application": {
                                                                    "function": {
                                                                      "application": {
                                                                        "function": {
                                                                          "typeApplication": {
                                                                            "body": {
                                                                              "typeApplication": {
                                                                                "body": {
                                                                                  "typeApplication": {"body": {"variable": "hydra.core.lib.eithers.map"}, "type": {"list": {"variable": "hydra.core.model.Term"}}}},
                                                                                "type": {"variable": "hydra.core.model.Term"}}},
                                                                            "type": {"literal": "string"}}},
                                                                        "argument": {
                                                                          "lambda": {
                                                                            "parameter": "rlist",
                                                                            "domain": {"list": {"variable": "hydra.core.model.Term"}},
                                                                            "body": {
                                                                              "inject": {
                                                                                "typeName": "hydra.core.model.Term",
                                                                                "field": {
                                                                                  "name": "set",
                                                                                  "term": {
                                                                                    "application": {
                                                                                      "function": {
                                                                                        "typeApplication": {"body": {"variable": "hydra.core.lib.sets.fromList"}, "type": {"variable": "hydra.core.model.Term"}}},
                                                                                      "argument": {"variable": "rlist"}}}}}}}}}},
                                                                    "argument": {
                                                                      "application": {
                                                                        "function": {
                                                                          "application": {
                                                                            "function": {
                                                                              "typeApplication": {
                                                                                "body": {
                                                                                  "typeApplication": {
                                                                                    "body": {
                                                                                      "typeApplication": {"body": {"variable": "hydra.core.lib.eithers.mapList"}, "type": {"variable": "hydra.core.model.Term"}}},
                                                                                    "type": {"variable": "hydra.core.model.Term"}}},
                                                                                "type": {"literal": "string"}}},
                                                                            "argument": {"application": {"function": {"variable": "recurse"}, "argument": {"variable": "bound"}}}}},
                                                                        "argument": {
                                                                          "application": {
                                                                            "function": {"typeApplication": {"body": {"variable": "hydra.core.lib.sets.toList"}, "type": {"variable": "hydra.core.model.Term"}}},
                                                                            "argument": {"variable": "s"}}}}}}}}}},
                                                          {
                                                            "name": "typeApplication",
                                                            "handler": {
                                                              "lambda": {
                                                                "parameter": "tt",
                                                                "domain": {"variable": "hydra.core.model.TypeApplicationTerm"},
                                                                "body": {
                                                                  "application": {
                                                                    "function": {
                                                                      "application": {
                                                                        "function": {
                                                                          "typeApplication": {
                                                                            "body": {
                                                                              "typeApplication": {
                                                                                "body": {"typeApplication": {"body": {"variable": "hydra.core.lib.eithers.map"}, "type": {"variable": "hydra.core.model.Term"}}},
                                                                                "type": {"variable": "hydra.core.model.Term"}}},
                                                                            "type": {"literal": "string"}}},
                                                                        "argument": {
                                                                          "lambda": {
                                                                            "parameter": "b",
                                                                            "domain": {"variable": "hydra.core.model.Term"},
                                                                            "body": {
                                                                              "inject": {
                                                                                "typeName": "hydra.core.model.Term",
                                                                                "field": {
                                                                                  "name": "typeApplication",
                                                                                  "term": {
                                                                                    "record": {
                                                                                      "typeName": "hydra.core.model.TypeApplicationTerm",
                                                                                      "fields": [
                                                                                        {"name": "body", "term": {"variable": "b"}},
                                                                                        {
                                                                                          "name": "type",
                                                                                          "term": {
                                                                                            "application": {
                                                                                              "function": {"project": {"typeName": "hydra.core.model.TypeApplicationTerm", "fieldName": "type"}},
                                                                                              "argument": {"variable": "tt"}}}}]}}}}}}}}},
                                                                    "argument": {
                                                                      "application": {
                                                                        "function": {"application": {"function": {"variable": "recurse"}, "argument": {"variable": "bound"}}},
                                                                        "argument": {
                                                                          "application": {
                                                                            "function": {"project": {"typeName": "hydra.core.model.TypeApplicationTerm", "fieldName": "body"}},
                                                                            "argument": {"variable": "tt"}}}}}}}}}},
                                                          {
                                                            "name": "typeLambda",
                                                            "handler": {
                                                              "lambda": {
                                                                "parameter": "ta",
                                                                "domain": {"variable": "hydra.core.model.TypeLambda"},
                                                                "body": {
                                                                  "application": {
                                                                    "function": {
                                                                      "application": {
                                                                        "function": {
                                                                          "typeApplication": {
                                                                            "body": {
                                                                              "typeApplication": {
                                                                                "body": {"typeApplication": {"body": {"variable": "hydra.core.lib.eithers.map"}, "type": {"variable": "hydra.core.model.Term"}}},
                                                                                "type": {"variable": "hydra.core.model.Term"}}},
                                                                            "type": {"literal": "string"}}},
                                                                        "argument": {
                                                                          "lambda": {
                                                                            "parameter": "b",
                                                                            "domain": {"variable": "hydra.core.model.Term"},
                                                                            "body": {
                                                                              "inject": {
                                                                                "typeName": "hydra.core.model.Term",
                                                                                "field": {
                                                                                  "name": "typeLambda",
                                                                                  "term": {
                                                                                    "record": {
                                                                                      "typeName": "hydra.core.model.TypeLambda",
                                                                                      "fields": [
                                                                                        {
                                                                                          "name": "parameter",
                                                                                          "term": {
                                                                                            "application": {
                                                                                              "function": {"project": {"typeName": "hydra.core.model.TypeLambda", "fieldName": "parameter"}},
                                                                                              "argument": {"variable": "ta"}}}},
                                                                                        {"name": "body", "term": {"variable": "b"}}]}}}}}}}}},
                                                                    "argument": {
                                                                      "application": {
                                                                        "function": {"application": {"function": {"variable": "recurse"}, "argument": {"variable": "bound"}}},
                                                                        "argument": {
                                                                          "application": {
                                                                            "function": {"project": {"typeName": "hydra.core.model.TypeLambda", "fieldName": "body"}},
                                                                            "argument": {"variable": "ta"}}}}}}}}}},
                                                          {
                                                            "name": "inject",
                                                            "handler": {
                                                              "lambda": {
                                                                "parameter": "inj",
                                                                "domain": {"variable": "hydra.core.model.Injection"},
                                                                "body": {
                                                                  "application": {
                                                                    "function": {
                                                                      "application": {
                                                                        "function": {
                                                                          "typeApplication": {
                                                                            "body": {
                                                                              "typeApplication": {
                                                                                "body": {"typeApplication": {"body": {"variable": "hydra.core.lib.eithers.bind"}, "type": {"literal": "string"}}},
                                                                                "type": {"variable": "hydra.core.model.Name"}}},
                                                                            "type": {"variable": "hydra.core.model.Term"}}},
                                                                        "argument": {
                                                                          "application": {
                                                                            "function": {"variable": "resolveN"},
                                                                            "argument": {
                                                                              "application": {
                                                                                "function": {"project": {"typeName": "hydra.core.model.Injection", "fieldName": "typeName"}},
                                                                                "argument": {"variable": "inj"}}}}}}},
                                                                    "argument": {
                                                                      "lambda": {
                                                                        "parameter": "tn",
                                                                        "domain": {"variable": "hydra.core.model.Name"},
                                                                        "body": {
                                                                          "application": {
                                                                            "function": {
                                                                              "application": {
                                                                                "function": {
                                                                                  "typeApplication": {
                                                                                    "body": {
                                                                                      "typeApplication": {
                                                                                        "body": {
                                                                                          "typeApplication": {"body": {"variable": "hydra.core.lib.eithers.map"}, "type": {"variable": "hydra.core.model.Field"}}},
                                                                                        "type": {"variable": "hydra.core.model.Term"}}},
                                                                                    "type": {"literal": "string"}}},
                                                                                "argument": {
                                                                                  "lambda": {
                                                                                    "parameter": "rfield",
                                                                                    "domain": {"variable": "hydra.core.model.Field"},
                                                                                    "body": {
                                                                                      "inject": {
                                                                                        "typeName": "hydra.core.model.Term",
                                                                                        "field": {
                                                                                          "name": "inject",
                                                                                          "term": {
                                                                                            "record": {
                                                                                              "typeName": "hydra.core.model.Injection",
                                                                                              "fields": [{"name": "typeName", "term": {"variable": "tn"}}, {"name": "field", "term": {"variable": "rfield"}}]}}}}}}}}},
                                                                            "argument": {
                                                                              "application": {
                                                                                "function": {"application": {"function": {"variable": "forField"}, "argument": {"variable": "bound"}}},
                                                                                "argument": {
                                                                                  "application": {
                                                                                    "function": {"project": {"typeName": "hydra.core.model.Injection", "fieldName": "field"}},
                                                                                    "argument": {"variable": "inj"}}}}}}}}}}}}}},
                                                          {
                                                            "name": "unit",
                                                            "handler": {
                                                              "lambda": {
                                                                "parameter": "_",
                                                                "domain": "unit",
                                                                "body": {
                                                                  "typeApplication": {
                                                                    "body": {
                                                                      "typeApplication": {
                                                                        "body": {"either": {"right": {"inject": {"typeName": "hydra.core.model.Term", "field": {"name": "unit", "term": "unit"}}}}},
                                                                        "type": {"literal": "string"}}},
                                                                    "type": {"variable": "hydra.core.model.Term"}}}}}},
                                                          {
                                                            "name": "unwrap",
                                                            "handler": {
                                                              "lambda": {
                                                                "parameter": "n",
                                                                "domain": {"variable": "hydra.core.model.Name"},
                                                                "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.model.Term"}}},
                                                                            "type": {"literal": "string"}}},
                                                                        "argument": {
                                                                          "lambda": {
                                                                            "parameter": "x",
                                                                            "domain": {"variable": "hydra.core.model.Name"},
                                                                            "body": {"inject": {"typeName": "hydra.core.model.Term", "field": {"name": "unwrap", "term": {"variable": "x"}}}}}}}},
                                                                    "argument": {"application": {"function": {"variable": "resolveN"}, "argument": {"variable": "n"}}}}}}}},
                                                          {
                                                            "name": "variable",
                                                            "handler": {
                                                              "lambda": {
                                                                "parameter": "v",
                                                                "domain": {"variable": "hydra.core.model.Name"},
                                                                "body": {
                                                                  "application": {
                                                                    "function": {
                                                                      "application": {
                                                                        "function": {
                                                                          "application": {
                                                                            "function": {
                                                                              "typeApplication": {
                                                                                "body": {"variable": "hydra.core.lib.logic.ifElse"},
                                                                                "type": {"either": {"left": {"literal": "string"}, "right": {"variable": "hydra.core.model.Term"}}}}},
                                                                            "argument": {
                                                                              "application": {
                                                                                "function": {
                                                                                  "application": {
                                                                                    "function": {"typeApplication": {"body": {"variable": "hydra.core.lib.sets.member"}, "type": {"literal": "string"}}},
                                                                                    "argument": {"application": {"function": {"unwrap": "hydra.core.model.Name"}, "argument": {"variable": "v"}}}}},
                                                                                "argument": {"variable": "bound"}}}}},
                                                                        "argument": {
                                                                          "typeApplication": {
                                                                            "body": {
                                                                              "typeApplication": {
                                                                                "body": {
                                                                                  "either": {"right": {"inject": {"typeName": "hydra.core.model.Term", "field": {"name": "variable", "term": {"variable": "v"}}}}}},
                                                                                "type": {"literal": "string"}}},
                                                                            "type": {"variable": "hydra.core.model.Term"}}}}},
                                                                    "argument": {
                                                                      "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.model.Term"}}},
                                                                                "type": {"literal": "string"}}},
                                                                            "argument": {
                                                                              "lambda": {
                                                                                "parameter": "x",
                                                                                "domain": {"variable": "hydra.core.model.Name"},
                                                                                "body": {"inject": {"typeName": "hydra.core.model.Term", "field": {"name": "variable", "term": {"variable": "x"}}}}}}}},
                                                                        "argument": {"application": {"function": {"variable": "resolveN"}, "argument": {"variable": "v"}}}}}}}}}},
                                                          {
                                                            "name": "wrap",
                                                            "handler": {
                                                              "lambda": {
                                                                "parameter": "wt",
                                                                "domain": {"variable": "hydra.core.model.WrappedTerm"},
                                                                "body": {
                                                                  "application": {
                                                                    "function": {
                                                                      "application": {
                                                                        "function": {
                                                                          "typeApplication": {
                                                                            "body": {
                                                                              "typeApplication": {
                                                                                "body": {"typeApplication": {"body": {"variable": "hydra.core.lib.eithers.bind"}, "type": {"literal": "string"}}},
                                                                                "type": {"variable": "hydra.core.model.Name"}}},
                                                                            "type": {"variable": "hydra.core.model.Term"}}},
                                                                        "argument": {
                                                                          "application": {
                                                                            "function": {"variable": "resolveN"},
                                                                            "argument": {
                                                                              "application": {
                                                                                "function": {"project": {"typeName": "hydra.core.model.WrappedTerm", "fieldName": "typeName"}},
                                                                                "argument": {"variable": "wt"}}}}}}},
                                                                    "argument": {
                                                                      "lambda": {
                                                                        "parameter": "tn",
                                                                        "domain": {"variable": "hydra.core.model.Name"},
                                                                        "body": {
                                                                          "application": {
                                                                            "function": {
                                                                              "application": {
                                                                                "function": {
                                                                                  "typeApplication": {
                                                                                    "body": {
                                                                                      "typeApplication": {
                                                                                        "body": {"typeApplication": {"body": {"variable": "hydra.core.lib.eithers.map"}, "type": {"variable": "hydra.core.model.Term"}}},
                                                                                        "type": {"variable": "hydra.core.model.Term"}}},
                                                                                    "type": {"literal": "string"}}},
                                                                                "argument": {
                                                                                  "lambda": {
                                                                                    "parameter": "b",
                                                                                    "domain": {"variable": "hydra.core.model.Term"},
                                                                                    "body": {
                                                                                      "inject": {
                                                                                        "typeName": "hydra.core.model.Term",
                                                                                        "field": {
                                                                                          "name": "wrap",
                                                                                          "term": {
                                                                                            "record": {
                                                                                              "typeName": "hydra.core.model.WrappedTerm",
                                                                                              "fields": [{"name": "typeName", "term": {"variable": "tn"}}, {"name": "body", "term": {"variable": "b"}}]}}}}}}}}},
                                                                            "argument": {
                                                                              "application": {
                                                                                "function": {"application": {"function": {"variable": "recurse"}, "argument": {"variable": "bound"}}},
                                                                                "argument": {
                                                                                  "application": {
                                                                                    "function": {"project": {"typeName": "hydra.core.model.WrappedTerm", "fieldName": "body"}},
                                                                                    "argument": {"variable": "wt"}}}}}}}}}}}}}}]}},
                                                    "argument": {"variable": "term"}}}}}}}}}}}}}}}}}}}}},
            "annotation": {
              "map": [
                {
                  "key": {"variable": "description"},
                  "value": {
                    "literal": {
                      "string": "Recursively resolve bare name references inside a term against the printer's universe, tracking bound term variables"}}}]}}}}},
    {
      "term": {
        "name": "hydra.core.parse.packaging.resolveNameRefsInTypeWith",
        "signature": {
          "typeParameters": [],
          "parameters": [
            {"name": "arg0", "type": {"variable": "hydra.core.packaging.ModuleName"}, "isLazy": false},
            {"name": "arg1", "type": {"set": {"literal": "string"}}, "isLazy": false},
            {
              "name": "arg2",
              "type": {
                "map": {"keys": {"variable": "hydra.core.packaging.ModuleName"}, "values": {"set": {"variable": "hydra.core.model.Name"}}}},
              "isLazy": false},
            {"name": "arg3", "type": {"set": {"literal": "string"}}, "isLazy": false},
            {"name": "arg4", "type": {"variable": "hydra.core.model.Type"}, "isLazy": false}],
          "result": {"type": {"either": {"left": {"literal": "string"}, "right": {"variable": "hydra.core.model.Type"}}}}},
        "body": {
          "annotated": {
            "body": {
              "lambda": {
                "parameter": "modName",
                "domain": {"variable": "hydra.core.packaging.ModuleName"},
                "body": {
                  "lambda": {
                    "parameter": "ownNames",
                    "domain": {"set": {"literal": "string"}},
                    "body": {
                      "lambda": {
                        "parameter": "universe",
                        "domain": {
                          "map": {"keys": {"variable": "hydra.core.packaging.ModuleName"}, "values": {"set": {"variable": "hydra.core.model.Name"}}}},
                        "body": {
                          "lambda": {
                            "parameter": "bound",
                            "domain": {"set": {"literal": "string"}},
                            "body": {
                              "lambda": {
                                "parameter": "typ",
                                "domain": {"variable": "hydra.core.model.Type"},
                                "body": {
                                  "let": {
                                    "bindings": [
                                      {
                                        "name": "recurse",
                                        "term": {
                                          "application": {
                                            "function": {
                                              "application": {
                                                "function": {
                                                  "application": {"function": {"variable": "hydra.core.parse.packaging.resolveNameRefsInTypeWith"}, "argument": {"variable": "modName"}}},
                                                "argument": {"variable": "ownNames"}}},
                                            "argument": {"variable": "universe"}}},
                                        "typeScheme": {
                                          "variables": [],
                                          "body": {
                                            "function": {
                                              "domain": {"set": {"literal": "string"}},
                                              "codomain": {
                                                "function": {
                                                  "domain": {"variable": "hydra.core.model.Type"},
                                                  "codomain": {"either": {"left": {"literal": "string"}, "right": {"variable": "hydra.core.model.Type"}}}}}}},
                                          "constraints": []}}],
                                    "body": {
                                      "let": {
                                        "bindings": [
                                          {
                                            "name": "forField",
                                            "term": {
                                              "lambda": {
                                                "parameter": "boundHere",
                                                "domain": {"set": {"literal": "string"}},
                                                "body": {
                                                  "lambda": {
                                                    "parameter": "field",
                                                    "domain": {"variable": "hydra.core.model.FieldType"},
                                                    "body": {
                                                      "application": {
                                                        "function": {
                                                          "application": {
                                                            "function": {
                                                              "typeApplication": {
                                                                "body": {
                                                                  "typeApplication": {
                                                                    "body": {"typeApplication": {"body": {"variable": "hydra.core.lib.eithers.map"}, "type": {"variable": "hydra.core.model.Type"}}},
                                                                    "type": {"variable": "hydra.core.model.FieldType"}}},
                                                                "type": {"literal": "string"}}},
                                                            "argument": {
                                                              "lambda": {
                                                                "parameter": "t",
                                                                "domain": {"variable": "hydra.core.model.Type"},
                                                                "body": {
                                                                  "record": {
                                                                    "typeName": "hydra.core.model.FieldType",
                                                                    "fields": [
                                                                      {
                                                                        "name": "name",
                                                                        "term": {
                                                                          "application": {
                                                                            "function": {"project": {"typeName": "hydra.core.model.FieldType", "fieldName": "name"}},
                                                                            "argument": {"variable": "field"}}}},
                                                                      {"name": "type", "term": {"variable": "t"}}]}}}}}},
                                                        "argument": {
                                                          "application": {
                                                            "function": {"application": {"function": {"variable": "recurse"}, "argument": {"variable": "boundHere"}}},
                                                            "argument": {
                                                              "application": {
                                                                "function": {"project": {"typeName": "hydra.core.model.FieldType", "fieldName": "type"}},
                                                                "argument": {"variable": "field"}}}}}}}}}}},
                                            "typeScheme": {
                                              "variables": [],
                                              "body": {
                                                "function": {
                                                  "domain": {"set": {"literal": "string"}},
                                                  "codomain": {
                                                    "function": {
                                                      "domain": {"variable": "hydra.core.model.FieldType"},
                                                      "codomain": {"either": {"left": {"literal": "string"}, "right": {"variable": "hydra.core.model.FieldType"}}}}}}},
                                              "constraints": []}}],
                                        "body": {
                                          "application": {
                                            "function": {
                                              "cases": {
                                                "typeName": "hydra.core.model.Type",
                                                "cases": [
                                                  {
                                                    "name": "annotated",
                                                    "handler": {
                                                      "lambda": {
                                                        "parameter": "at",
                                                        "domain": {"variable": "hydra.core.model.AnnotatedType"},
                                                        "body": {
                                                          "let": {
                                                            "bindings": [
                                                              {
                                                                "name": "ann",
                                                                "term": {
                                                                  "application": {
                                                                    "function": {"project": {"typeName": "hydra.core.model.AnnotatedType", "fieldName": "annotation"}},
                                                                    "argument": {"variable": "at"}}},
                                                                "typeScheme": {"variables": [], "body": {"variable": "hydra.core.model.Term"}, "constraints": []}}],
                                                            "body": {
                                                              "let": {
                                                                "bindings": [
                                                                  {
                                                                    "name": "resolveV",
                                                                    "term": {
                                                                      "application": {
                                                                        "function": {
                                                                          "application": {
                                                                            "function": {
                                                                              "application": {
                                                                                "function": {
                                                                                  "application": {"function": {"variable": "hydra.core.parse.packaging.resolveNameRefsInTermWith"}, "argument": {"variable": "modName"}}},
                                                                                "argument": {"variable": "ownNames"}}},
                                                                            "argument": {"variable": "universe"}}},
                                                                        "argument": {"typeApplication": {"body": {"variable": "hydra.core.lib.sets.empty"}, "type": {"literal": "string"}}}}},
                                                                    "typeScheme": {
                                                                      "variables": [],
                                                                      "body": {
                                                                        "function": {
                                                                          "domain": {"variable": "hydra.core.model.Term"},
                                                                          "codomain": {"either": {"left": {"literal": "string"}, "right": {"variable": "hydra.core.model.Term"}}}}},
                                                                      "constraints": []}}],
                                                                "body": {
                                                                  "let": {
                                                                    "bindings": [
                                                                      {
                                                                        "name": "forAnn",
                                                                        "term": {
                                                                          "typeLambda": {
                                                                            "parameter": "t0",
                                                                            "body": {
                                                                              "lambda": {
                                                                                "parameter": "p",
                                                                                "domain": {"pair": {"first": {"variable": "t0"}, "second": {"variable": "hydra.core.model.Term"}}},
                                                                                "body": {
                                                                                  "application": {
                                                                                    "function": {
                                                                                      "application": {
                                                                                        "function": {
                                                                                          "typeApplication": {
                                                                                            "body": {
                                                                                              "typeApplication": {
                                                                                                "body": {"typeApplication": {"body": {"variable": "hydra.core.lib.eithers.map"}, "type": {"variable": "hydra.core.model.Term"}}},
                                                                                                "type": {"pair": {"first": {"variable": "t0"}, "second": {"variable": "hydra.core.model.Term"}}}}},
                                                                                            "type": {"literal": "string"}}},
                                                                                        "argument": {
                                                                                          "lambda": {
                                                                                            "parameter": "v",
                                                                                            "domain": {"variable": "hydra.core.model.Term"},
                                                                                            "body": {
                                                                                              "typeApplication": {
                                                                                                "body": {
                                                                                                  "typeApplication": {
                                                                                                    "body": {
                                                                                                      "pair": {
                                                                                                        "first": {
                                                                                                          "application": {
                                                                                                            "function": {
                                                                                                              "typeApplication": {
                                                                                                                "body": {"typeApplication": {"body": {"variable": "hydra.core.lib.pairs.first"}, "type": {"variable": "t0"}}},
                                                                                                                "type": {"variable": "hydra.core.model.Term"}}},
                                                                                                            "argument": {"variable": "p"}}},
                                                                                                        "second": {"variable": "v"}}},
                                                                                                    "type": {"variable": "t0"}}},
                                                                                                "type": {"variable": "hydra.core.model.Term"}}}}}}},
                                                                                    "argument": {
                                                                                      "application": {
                                                                                        "function": {"variable": "resolveV"},
                                                                                        "argument": {
                                                                                          "application": {
                                                                                            "function": {
                                                                                              "typeApplication": {
                                                                                                "body": {"typeApplication": {"body": {"variable": "hydra.core.lib.pairs.second"}, "type": {"variable": "t0"}}},
                                                                                                "type": {"variable": "hydra.core.model.Term"}}},
                                                                                            "argument": {"variable": "p"}}}}}}}}}}},
                                                                        "typeScheme": {
                                                                          "variables": ["t0"],
                                                                          "body": {
                                                                            "function": {
                                                                              "domain": {"pair": {"first": {"variable": "t0"}, "second": {"variable": "hydra.core.model.Term"}}},
                                                                              "codomain": {
                                                                                "either": {
                                                                                  "left": {"literal": "string"},
                                                                                  "right": {"pair": {"first": {"variable": "t0"}, "second": {"variable": "hydra.core.model.Term"}}}}}}},
                                                                          "constraints": [{"key": "t0", "value": {"classes": []}}]}}],
                                                                    "body": {
                                                                      "application": {
                                                                        "function": {
                                                                          "application": {
                                                                            "function": {
                                                                              "typeApplication": {
                                                                                "body": {
                                                                                  "typeApplication": {
                                                                                    "body": {"typeApplication": {"body": {"variable": "hydra.core.lib.eithers.bind"}, "type": {"literal": "string"}}},
                                                                                    "type": {"variable": "hydra.core.model.Term"}}},
                                                                                "type": {"variable": "hydra.core.model.Type"}}},
                                                                            "argument": {
                                                                              "application": {
                                                                                "function": {
                                                                                  "cases": {
                                                                                    "typeName": "hydra.core.model.Term",
                                                                                    "default": {
                                                                                      "typeApplication": {
                                                                                        "body": {"typeApplication": {"body": {"either": {"right": {"variable": "ann"}}}, "type": {"literal": "string"}}},
                                                                                        "type": {"variable": "hydra.core.model.Term"}}},
                                                                                    "cases": [
                                                                                      {
                                                                                        "name": "map",
                                                                                        "handler": {
                                                                                          "lambda": {
                                                                                            "parameter": "m",
                                                                                            "domain": {"map": {"keys": {"variable": "hydra.core.model.Term"}, "values": {"variable": "hydra.core.model.Term"}}},
                                                                                            "body": {
                                                                                              "application": {
                                                                                                "function": {
                                                                                                  "application": {
                                                                                                    "function": {
                                                                                                      "typeApplication": {
                                                                                                        "body": {
                                                                                                          "typeApplication": {
                                                                                                            "body": {
                                                                                                              "typeApplication": {
                                                                                                                "body": {"variable": "hydra.core.lib.eithers.map"},
                                                                                                                "type": {"list": {"pair": {"first": {"variable": "hydra.core.model.Term"}, "second": {"variable": "hydra.core.model.Term"}}}}}},
                                                                                                            "type": {"variable": "hydra.core.model.Term"}}},
                                                                                                        "type": {"literal": "string"}}},
                                                                                                    "argument": {
                                                                                                      "lambda": {
                                                                                                        "parameter": "rpairs",
                                                                                                        "domain": {"list": {"pair": {"first": {"variable": "hydra.core.model.Term"}, "second": {"variable": "hydra.core.model.Term"}}}},
                                                                                                        "body": {
                                                                                                          "inject": {
                                                                                                            "typeName": "hydra.core.model.Term",
                                                                                                            "field": {
                                                                                                              "name": "map",
                                                                                                              "term": {
                                                                                                                "application": {
                                                                                                                  "function": {
                                                                                                                    "typeApplication": {
                                                                                                                      "body": {
                                                                                                                        "typeApplication": {"body": {"variable": "hydra.core.lib.maps.fromList"}, "type": {"variable": "hydra.core.model.Term"}}},
                                                                                                                      "type": {"variable": "hydra.core.model.Term"}}},
                                                                                                                  "argument": {"variable": "rpairs"}}}}}}}}}},
                                                                                                "argument": {
                                                                                                  "application": {
                                                                                                    "function": {
                                                                                                      "application": {
                                                                                                        "function": {
                                                                                                          "typeApplication": {
                                                                                                            "body": {
                                                                                                              "typeApplication": {
                                                                                                                "body": {
                                                                                                                  "typeApplication": {
                                                                                                                    "body": {"variable": "hydra.core.lib.eithers.mapList"},
                                                                                                                    "type": {"pair": {"first": {"variable": "hydra.core.model.Term"}, "second": {"variable": "hydra.core.model.Term"}}}}},
                                                                                                                "type": {"pair": {"first": {"variable": "hydra.core.model.Term"}, "second": {"variable": "hydra.core.model.Term"}}}}},
                                                                                                            "type": {"literal": "string"}}},
                                                                                                        "argument": {"typeApplication": {"body": {"variable": "forAnn"}, "type": {"variable": "hydra.core.model.Term"}}}}},
                                                                                                    "argument": {
                                                                                                      "application": {
                                                                                                        "function": {
                                                                                                          "typeApplication": {
                                                                                                            "body": {"typeApplication": {"body": {"variable": "hydra.core.lib.maps.toList"}, "type": {"variable": "hydra.core.model.Term"}}},
                                                                                                            "type": {"variable": "hydra.core.model.Term"}}},
                                                                                                        "argument": {"variable": "m"}}}}}}}}}}]}},
                                                                                "argument": {"variable": "ann"}}}}},
                                                                        "argument": {
                                                                          "lambda": {
                                                                            "parameter": "rann",
                                                                            "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.Type"}}},
                                                                                            "type": {"variable": "hydra.core.model.Type"}}},
                                                                                        "type": {"literal": "string"}}},
                                                                                    "argument": {
                                                                                      "lambda": {
                                                                                        "parameter": "b",
                                                                                        "domain": {"variable": "hydra.core.model.Type"},
                                                                                        "body": {
                                                                                          "inject": {
                                                                                            "typeName": "hydra.core.model.Type",
                                                                                            "field": {
                                                                                              "name": "annotated",
                                                                                              "term": {
                                                                                                "record": {
                                                                                                  "typeName": "hydra.core.model.AnnotatedType",
                                                                                                  "fields": [{"name": "body", "term": {"variable": "b"}}, {"name": "annotation", "term": {"variable": "rann"}}]}}}}}}}}},
                                                                                "argument": {
                                                                                  "application": {
                                                                                    "function": {"application": {"function": {"variable": "recurse"}, "argument": {"variable": "bound"}}},
                                                                                    "argument": {
                                                                                      "application": {
                                                                                        "function": {"project": {"typeName": "hydra.core.model.AnnotatedType", "fieldName": "body"}},
                                                                                        "argument": {"variable": "at"}}}}}}}}}}}}}}}}}}}},
                                                  {
                                                    "name": "application",
                                                    "handler": {
                                                      "lambda": {
                                                        "parameter": "app",
                                                        "domain": {"variable": "hydra.core.model.ApplicationType"},
                                                        "body": {
                                                          "application": {
                                                            "function": {
                                                              "application": {
                                                                "function": {
                                                                  "typeApplication": {
                                                                    "body": {
                                                                      "typeApplication": {
                                                                        "body": {"typeApplication": {"body": {"variable": "hydra.core.lib.eithers.bind"}, "type": {"literal": "string"}}},
                                                                        "type": {"variable": "hydra.core.model.Type"}}},
                                                                    "type": {"variable": "hydra.core.model.Type"}}},
                                                                "argument": {
                                                                  "application": {
                                                                    "function": {"application": {"function": {"variable": "recurse"}, "argument": {"variable": "bound"}}},
                                                                    "argument": {
                                                                      "application": {
                                                                        "function": {"project": {"typeName": "hydra.core.model.ApplicationType", "fieldName": "function"}},
                                                                        "argument": {"variable": "app"}}}}}}},
                                                            "argument": {
                                                              "lambda": {
                                                                "parameter": "f",
                                                                "domain": {"variable": "hydra.core.model.Type"},
                                                                "body": {
                                                                  "application": {
                                                                    "function": {
                                                                      "application": {
                                                                        "function": {
                                                                          "typeApplication": {
                                                                            "body": {
                                                                              "typeApplication": {
                                                                                "body": {"typeApplication": {"body": {"variable": "hydra.core.lib.eithers.map"}, "type": {"variable": "hydra.core.model.Type"}}},
                                                                                "type": {"variable": "hydra.core.model.Type"}}},
                                                                            "type": {"literal": "string"}}},
                                                                        "argument": {
                                                                          "lambda": {
                                                                            "parameter": "a",
                                                                            "domain": {"variable": "hydra.core.model.Type"},
                                                                            "body": {
                                                                              "inject": {
                                                                                "typeName": "hydra.core.model.Type",
                                                                                "field": {
                                                                                  "name": "application",
                                                                                  "term": {
                                                                                    "record": {
                                                                                      "typeName": "hydra.core.model.ApplicationType",
                                                                                      "fields": [{"name": "function", "term": {"variable": "f"}}, {"name": "argument", "term": {"variable": "a"}}]}}}}}}}}},
                                                                    "argument": {
                                                                      "application": {
                                                                        "function": {"application": {"function": {"variable": "recurse"}, "argument": {"variable": "bound"}}},
                                                                        "argument": {
                                                                          "application": {
                                                                            "function": {"project": {"typeName": "hydra.core.model.ApplicationType", "fieldName": "argument"}},
                                                                            "argument": {"variable": "app"}}}}}}}}}}}}}},
                                                  {
                                                    "name": "effect",
                                                    "handler": {
                                                      "lambda": {
                                                        "parameter": "t",
                                                        "domain": {"variable": "hydra.core.model.Type"},
                                                        "body": {
                                                          "application": {
                                                            "function": {
                                                              "application": {
                                                                "function": {
                                                                  "typeApplication": {
                                                                    "body": {
                                                                      "typeApplication": {
                                                                        "body": {"typeApplication": {"body": {"variable": "hydra.core.lib.eithers.map"}, "type": {"variable": "hydra.core.model.Type"}}},
                                                                        "type": {"variable": "hydra.core.model.Type"}}},
                                                                    "type": {"literal": "string"}}},
                                                                "argument": {
                                                                  "lambda": {
                                                                    "parameter": "x",
                                                                    "domain": {"variable": "hydra.core.model.Type"},
                                                                    "body": {"inject": {"typeName": "hydra.core.model.Type", "field": {"name": "effect", "term": {"variable": "x"}}}}}}}},
                                                            "argument": {
                                                              "application": {
                                                                "function": {"application": {"function": {"variable": "recurse"}, "argument": {"variable": "bound"}}},
                                                                "argument": {"variable": "t"}}}}}}}},
                                                  {
                                                    "name": "either",
                                                    "handler": {
                                                      "lambda": {
                                                        "parameter": "et",
                                                        "domain": {"variable": "hydra.core.model.EitherType"},
                                                        "body": {
                                                          "application": {
                                                            "function": {
                                                              "application": {
                                                                "function": {
                                                                  "typeApplication": {
                                                                    "body": {
                                                                      "typeApplication": {
                                                                        "body": {"typeApplication": {"body": {"variable": "hydra.core.lib.eithers.bind"}, "type": {"literal": "string"}}},
                                                                        "type": {"variable": "hydra.core.model.Type"}}},
                                                                    "type": {"variable": "hydra.core.model.Type"}}},
                                                                "argument": {
                                                                  "application": {
                                                                    "function": {"application": {"function": {"variable": "recurse"}, "argument": {"variable": "bound"}}},
                                                                    "argument": {
                                                                      "application": {
                                                                        "function": {"project": {"typeName": "hydra.core.model.EitherType", "fieldName": "left"}},
                                                                        "argument": {"variable": "et"}}}}}}},
                                                            "argument": {
                                                              "lambda": {
                                                                "parameter": "l",
                                                                "domain": {"variable": "hydra.core.model.Type"},
                                                                "body": {
                                                                  "application": {
                                                                    "function": {
                                                                      "application": {
                                                                        "function": {
                                                                          "typeApplication": {
                                                                            "body": {
                                                                              "typeApplication": {
                                                                                "body": {"typeApplication": {"body": {"variable": "hydra.core.lib.eithers.map"}, "type": {"variable": "hydra.core.model.Type"}}},
                                                                                "type": {"variable": "hydra.core.model.Type"}}},
                                                                            "type": {"literal": "string"}}},
                                                                        "argument": {
                                                                          "lambda": {
                                                                            "parameter": "r",
                                                                            "domain": {"variable": "hydra.core.model.Type"},
                                                                            "body": {
                                                                              "inject": {
                                                                                "typeName": "hydra.core.model.Type",
                                                                                "field": {
                                                                                  "name": "either",
                                                                                  "term": {
                                                                                    "record": {
                                                                                      "typeName": "hydra.core.model.EitherType",
                                                                                      "fields": [{"name": "left", "term": {"variable": "l"}}, {"name": "right", "term": {"variable": "r"}}]}}}}}}}}},
                                                                    "argument": {
                                                                      "application": {
                                                                        "function": {"application": {"function": {"variable": "recurse"}, "argument": {"variable": "bound"}}},
                                                                        "argument": {
                                                                          "application": {
                                                                            "function": {"project": {"typeName": "hydra.core.model.EitherType", "fieldName": "right"}},
                                                                            "argument": {"variable": "et"}}}}}}}}}}}}}},
                                                  {
                                                    "name": "forall",
                                                    "handler": {
                                                      "lambda": {
                                                        "parameter": "ft",
                                                        "domain": {"variable": "hydra.core.model.ForallType"},
                                                        "body": {
                                                          "let": {
                                                            "bindings": [
                                                              {
                                                                "name": "param",
                                                                "term": {
                                                                  "application": {
                                                                    "function": {"project": {"typeName": "hydra.core.model.ForallType", "fieldName": "parameter"}},
                                                                    "argument": {"variable": "ft"}}},
                                                                "typeScheme": {"variables": [], "body": {"variable": "hydra.core.model.Name"}, "constraints": []}}],
                                                            "body": {
                                                              "let": {
                                                                "bindings": [
                                                                  {
                                                                    "name": "bound'",
                                                                    "term": {
                                                                      "application": {
                                                                        "function": {
                                                                          "application": {
                                                                            "function": {"typeApplication": {"body": {"variable": "hydra.core.lib.sets.insert"}, "type": {"literal": "string"}}},
                                                                            "argument": {"application": {"function": {"unwrap": "hydra.core.model.Name"}, "argument": {"variable": "param"}}}}},
                                                                        "argument": {"variable": "bound"}}},
                                                                    "typeScheme": {"variables": [], "body": {"set": {"literal": "string"}}, "constraints": []}}],
                                                                "body": {
                                                                  "application": {
                                                                    "function": {
                                                                      "application": {
                                                                        "function": {
                                                                          "typeApplication": {
                                                                            "body": {
                                                                              "typeApplication": {
                                                                                "body": {"typeApplication": {"body": {"variable": "hydra.core.lib.eithers.map"}, "type": {"variable": "hydra.core.model.Type"}}},
                                                                                "type": {"variable": "hydra.core.model.Type"}}},
                                                                            "type": {"literal": "string"}}},
                                                                        "argument": {
                                                                          "lambda": {
                                                                            "parameter": "b",
                                                                            "domain": {"variable": "hydra.core.model.Type"},
                                                                            "body": {
                                                                              "inject": {
                                                                                "typeName": "hydra.core.model.Type",
                                                                                "field": {
                                                                                  "name": "forall",
                                                                                  "term": {
                                                                                    "record": {
                                                                                      "typeName": "hydra.core.model.ForallType",
                                                                                      "fields": [{"name": "parameter", "term": {"variable": "param"}}, {"name": "body", "term": {"variable": "b"}}]}}}}}}}}},
                                                                    "argument": {
                                                                      "application": {
                                                                        "function": {
                                                                          "application": {
                                                                            "function": {
                                                                              "application": {
                                                                                "function": {
                                                                                  "application": {
                                                                                    "function": {
                                                                                      "application": {"function": {"variable": "hydra.core.parse.packaging.resolveNameRefsInTypeWith"}, "argument": {"variable": "modName"}}},
                                                                                    "argument": {"variable": "ownNames"}}},
                                                                                "argument": {"variable": "universe"}}},
                                                                            "argument": {"variable": "bound'"}}},
                                                                        "argument": {
                                                                          "application": {
                                                                            "function": {"project": {"typeName": "hydra.core.model.ForallType", "fieldName": "body"}},
                                                                            "argument": {"variable": "ft"}}}}}}}}}}}}}},
                                                  {
                                                    "name": "function",
                                                    "handler": {
                                                      "lambda": {
                                                        "parameter": "fun",
                                                        "domain": {"variable": "hydra.core.model.FunctionType"},
                                                        "body": {
                                                          "application": {
                                                            "function": {
                                                              "application": {
                                                                "function": {
                                                                  "typeApplication": {
                                                                    "body": {
                                                                      "typeApplication": {
                                                                        "body": {"typeApplication": {"body": {"variable": "hydra.core.lib.eithers.bind"}, "type": {"literal": "string"}}},
                                                                        "type": {"variable": "hydra.core.model.Type"}}},
                                                                    "type": {"variable": "hydra.core.model.Type"}}},
                                                                "argument": {
                                                                  "application": {
                                                                    "function": {"application": {"function": {"variable": "recurse"}, "argument": {"variable": "bound"}}},
                                                                    "argument": {
                                                                      "application": {
                                                                        "function": {"project": {"typeName": "hydra.core.model.FunctionType", "fieldName": "domain"}},
                                                                        "argument": {"variable": "fun"}}}}}}},
                                                            "argument": {
                                                              "lambda": {
                                                                "parameter": "d",
                                                                "domain": {"variable": "hydra.core.model.Type"},
                                                                "body": {
                                                                  "application": {
                                                                    "function": {
                                                                      "application": {
                                                                        "function": {
                                                                          "typeApplication": {
                                                                            "body": {
                                                                              "typeApplication": {
                                                                                "body": {"typeApplication": {"body": {"variable": "hydra.core.lib.eithers.map"}, "type": {"variable": "hydra.core.model.Type"}}},
                                                                                "type": {"variable": "hydra.core.model.Type"}}},
                                                                            "type": {"literal": "string"}}},
                                                                        "argument": {
                                                                          "lambda": {
                                                                            "parameter": "c",
                                                                            "domain": {"variable": "hydra.core.model.Type"},
                                                                            "body": {
                                                                              "inject": {
                                                                                "typeName": "hydra.core.model.Type",
                                                                                "field": {
                                                                                  "name": "function",
                                                                                  "term": {
                                                                                    "record": {
                                                                                      "typeName": "hydra.core.model.FunctionType",
                                                                                      "fields": [{"name": "domain", "term": {"variable": "d"}}, {"name": "codomain", "term": {"variable": "c"}}]}}}}}}}}},
                                                                    "argument": {
                                                                      "application": {
                                                                        "function": {"application": {"function": {"variable": "recurse"}, "argument": {"variable": "bound"}}},
                                                                        "argument": {
                                                                          "application": {
                                                                            "function": {"project": {"typeName": "hydra.core.model.FunctionType", "fieldName": "codomain"}},
                                                                            "argument": {"variable": "fun"}}}}}}}}}}}}}},
                                                  {
                                                    "name": "list",
                                                    "handler": {
                                                      "lambda": {
                                                        "parameter": "t",
                                                        "domain": {"variable": "hydra.core.model.Type"},
                                                        "body": {
                                                          "application": {
                                                            "function": {
                                                              "application": {
                                                                "function": {
                                                                  "typeApplication": {
                                                                    "body": {
                                                                      "typeApplication": {
                                                                        "body": {"typeApplication": {"body": {"variable": "hydra.core.lib.eithers.map"}, "type": {"variable": "hydra.core.model.Type"}}},
                                                                        "type": {"variable": "hydra.core.model.Type"}}},
                                                                    "type": {"literal": "string"}}},
                                                                "argument": {
                                                                  "lambda": {
                                                                    "parameter": "x",
                                                                    "domain": {"variable": "hydra.core.model.Type"},
                                                                    "body": {"inject": {"typeName": "hydra.core.model.Type", "field": {"name": "list", "term": {"variable": "x"}}}}}}}},
                                                            "argument": {
                                                              "application": {
                                                                "function": {"application": {"function": {"variable": "recurse"}, "argument": {"variable": "bound"}}},
                                                                "argument": {"variable": "t"}}}}}}}},
                                                  {
                                                    "name": "literal",
                                                    "handler": {
                                                      "lambda": {
                                                        "parameter": "lt",
                                                        "domain": {"variable": "hydra.core.model.LiteralType"},
                                                        "body": {
                                                          "typeApplication": {
                                                            "body": {
                                                              "typeApplication": {
                                                                "body": {
                                                                  "either": {"right": {"inject": {"typeName": "hydra.core.model.Type", "field": {"name": "literal", "term": {"variable": "lt"}}}}}},
                                                                "type": {"literal": "string"}}},
                                                            "type": {"variable": "hydra.core.model.Type"}}}}}},
                                                  {
                                                    "name": "map",
                                                    "handler": {
                                                      "lambda": {
                                                        "parameter": "mt",
                                                        "domain": {"variable": "hydra.core.model.MapType"},
                                                        "body": {
                                                          "application": {
                                                            "function": {
                                                              "application": {
                                                                "function": {
                                                                  "typeApplication": {
                                                                    "body": {
                                                                      "typeApplication": {
                                                                        "body": {"typeApplication": {"body": {"variable": "hydra.core.lib.eithers.bind"}, "type": {"literal": "string"}}},
                                                                        "type": {"variable": "hydra.core.model.Type"}}},
                                                                    "type": {"variable": "hydra.core.model.Type"}}},
                                                                "argument": {
                                                                  "application": {
                                                                    "function": {"application": {"function": {"variable": "recurse"}, "argument": {"variable": "bound"}}},
                                                                    "argument": {
                                                                      "application": {"function": {"project": {"typeName": "hydra.core.model.MapType", "fieldName": "keys"}}, "argument": {"variable": "mt"}}}}}}},
                                                            "argument": {
                                                              "lambda": {
                                                                "parameter": "k",
                                                                "domain": {"variable": "hydra.core.model.Type"},
                                                                "body": {
                                                                  "application": {
                                                                    "function": {
                                                                      "application": {
                                                                        "function": {
                                                                          "typeApplication": {
                                                                            "body": {
                                                                              "typeApplication": {
                                                                                "body": {"typeApplication": {"body": {"variable": "hydra.core.lib.eithers.map"}, "type": {"variable": "hydra.core.model.Type"}}},
                                                                                "type": {"variable": "hydra.core.model.Type"}}},
                                                                            "type": {"literal": "string"}}},
                                                                        "argument": {
                                                                          "lambda": {
                                                                            "parameter": "v",
                                                                            "domain": {"variable": "hydra.core.model.Type"},
                                                                            "body": {
                                                                              "inject": {
                                                                                "typeName": "hydra.core.model.Type",
                                                                                "field": {
                                                                                  "name": "map",
                                                                                  "term": {
                                                                                    "record": {
                                                                                      "typeName": "hydra.core.model.MapType",
                                                                                      "fields": [{"name": "keys", "term": {"variable": "k"}}, {"name": "values", "term": {"variable": "v"}}]}}}}}}}}},
                                                                    "argument": {
                                                                      "application": {
                                                                        "function": {"application": {"function": {"variable": "recurse"}, "argument": {"variable": "bound"}}},
                                                                        "argument": {
                                                                          "application": {
                                                                            "function": {"project": {"typeName": "hydra.core.model.MapType", "fieldName": "values"}},
                                                                            "argument": {"variable": "mt"}}}}}}}}}}}}}},
                                                  {
                                                    "name": "optional",
                                                    "handler": {
                                                      "lambda": {
                                                        "parameter": "t",
                                                        "domain": {"variable": "hydra.core.model.Type"},
                                                        "body": {
                                                          "application": {
                                                            "function": {
                                                              "application": {
                                                                "function": {
                                                                  "typeApplication": {
                                                                    "body": {
                                                                      "typeApplication": {
                                                                        "body": {"typeApplication": {"body": {"variable": "hydra.core.lib.eithers.map"}, "type": {"variable": "hydra.core.model.Type"}}},
                                                                        "type": {"variable": "hydra.core.model.Type"}}},
                                                                    "type": {"literal": "string"}}},
                                                                "argument": {
                                                                  "lambda": {
                                                                    "parameter": "x",
                                                                    "domain": {"variable": "hydra.core.model.Type"},
                                                                    "body": {"inject": {"typeName": "hydra.core.model.Type", "field": {"name": "optional", "term": {"variable": "x"}}}}}}}},
                                                            "argument": {
                                                              "application": {
                                                                "function": {"application": {"function": {"variable": "recurse"}, "argument": {"variable": "bound"}}},
                                                                "argument": {"variable": "t"}}}}}}}},
                                                  {
                                                    "name": "pair",
                                                    "handler": {
                                                      "lambda": {
                                                        "parameter": "pt",
                                                        "domain": {"variable": "hydra.core.model.PairType"},
                                                        "body": {
                                                          "application": {
                                                            "function": {
                                                              "application": {
                                                                "function": {
                                                                  "typeApplication": {
                                                                    "body": {
                                                                      "typeApplication": {
                                                                        "body": {"typeApplication": {"body": {"variable": "hydra.core.lib.eithers.bind"}, "type": {"literal": "string"}}},
                                                                        "type": {"variable": "hydra.core.model.Type"}}},
                                                                    "type": {"variable": "hydra.core.model.Type"}}},
                                                                "argument": {
                                                                  "application": {
                                                                    "function": {"application": {"function": {"variable": "recurse"}, "argument": {"variable": "bound"}}},
                                                                    "argument": {
                                                                      "application": {
                                                                        "function": {"project": {"typeName": "hydra.core.model.PairType", "fieldName": "first"}},
                                                                        "argument": {"variable": "pt"}}}}}}},
                                                            "argument": {
                                                              "lambda": {
                                                                "parameter": "f",
                                                                "domain": {"variable": "hydra.core.model.Type"},
                                                                "body": {
                                                                  "application": {
                                                                    "function": {
                                                                      "application": {
                                                                        "function": {
                                                                          "typeApplication": {
                                                                            "body": {
                                                                              "typeApplication": {
                                                                                "body": {"typeApplication": {"body": {"variable": "hydra.core.lib.eithers.map"}, "type": {"variable": "hydra.core.model.Type"}}},
                                                                                "type": {"variable": "hydra.core.model.Type"}}},
                                                                            "type": {"literal": "string"}}},
                                                                        "argument": {
                                                                          "lambda": {
                                                                            "parameter": "s",
                                                                            "domain": {"variable": "hydra.core.model.Type"},
                                                                            "body": {
                                                                              "inject": {
                                                                                "typeName": "hydra.core.model.Type",
                                                                                "field": {
                                                                                  "name": "pair",
                                                                                  "term": {
                                                                                    "record": {
                                                                                      "typeName": "hydra.core.model.PairType",
                                                                                      "fields": [{"name": "first", "term": {"variable": "f"}}, {"name": "second", "term": {"variable": "s"}}]}}}}}}}}},
                                                                    "argument": {
                                                                      "application": {
                                                                        "function": {"application": {"function": {"variable": "recurse"}, "argument": {"variable": "bound"}}},
                                                                        "argument": {
                                                                          "application": {
                                                                            "function": {"project": {"typeName": "hydra.core.model.PairType", "fieldName": "second"}},
                                                                            "argument": {"variable": "pt"}}}}}}}}}}}}}},
                                                  {
                                                    "name": "record",
                                                    "handler": {
                                                      "lambda": {
                                                        "parameter": "rt",
                                                        "domain": {"list": {"variable": "hydra.core.model.FieldType"}},
                                                        "body": {
                                                          "application": {
                                                            "function": {
                                                              "application": {
                                                                "function": {
                                                                  "typeApplication": {
                                                                    "body": {
                                                                      "typeApplication": {
                                                                        "body": {
                                                                          "typeApplication": {"body": {"variable": "hydra.core.lib.eithers.map"}, "type": {"list": {"variable": "hydra.core.model.FieldType"}}}},
                                                                        "type": {"variable": "hydra.core.model.Type"}}},
                                                                    "type": {"literal": "string"}}},
                                                                "argument": {
                                                                  "lambda": {
                                                                    "parameter": "x",
                                                                    "domain": {"list": {"variable": "hydra.core.model.FieldType"}},
                                                                    "body": {"inject": {"typeName": "hydra.core.model.Type", "field": {"name": "record", "term": {"variable": "x"}}}}}}}},
                                                            "argument": {
                                                              "application": {
                                                                "function": {
                                                                  "application": {
                                                                    "function": {
                                                                      "typeApplication": {
                                                                        "body": {
                                                                          "typeApplication": {
                                                                            "body": {
                                                                              "typeApplication": {"body": {"variable": "hydra.core.lib.eithers.mapList"}, "type": {"variable": "hydra.core.model.FieldType"}}},
                                                                            "type": {"variable": "hydra.core.model.FieldType"}}},
                                                                        "type": {"literal": "string"}}},
                                                                    "argument": {"application": {"function": {"variable": "forField"}, "argument": {"variable": "bound"}}}}},
                                                                "argument": {"variable": "rt"}}}}}}}},
                                                  {
                                                    "name": "set",
                                                    "handler": {
                                                      "lambda": {
                                                        "parameter": "t",
                                                        "domain": {"variable": "hydra.core.model.Type"},
                                                        "body": {
                                                          "application": {
                                                            "function": {
                                                              "application": {
                                                                "function": {
                                                                  "typeApplication": {
                                                                    "body": {
                                                                      "typeApplication": {
                                                                        "body": {"typeApplication": {"body": {"variable": "hydra.core.lib.eithers.map"}, "type": {"variable": "hydra.core.model.Type"}}},
                                                                        "type": {"variable": "hydra.core.model.Type"}}},
                                                                    "type": {"literal": "string"}}},
                                                                "argument": {
                                                                  "lambda": {
                                                                    "parameter": "x",
                                                                    "domain": {"variable": "hydra.core.model.Type"},
                                                                    "body": {"inject": {"typeName": "hydra.core.model.Type", "field": {"name": "set", "term": {"variable": "x"}}}}}}}},
                                                            "argument": {
                                                              "application": {
                                                                "function": {"application": {"function": {"variable": "recurse"}, "argument": {"variable": "bound"}}},
                                                                "argument": {"variable": "t"}}}}}}}},
                                                  {
                                                    "name": "union",
                                                    "handler": {
                                                      "lambda": {
                                                        "parameter": "rt",
                                                        "domain": {"list": {"variable": "hydra.core.model.FieldType"}},
                                                        "body": {
                                                          "application": {
                                                            "function": {
                                                              "application": {
                                                                "function": {
                                                                  "typeApplication": {
                                                                    "body": {
                                                                      "typeApplication": {
                                                                        "body": {
                                                                          "typeApplication": {"body": {"variable": "hydra.core.lib.eithers.map"}, "type": {"list": {"variable": "hydra.core.model.FieldType"}}}},
                                                                        "type": {"variable": "hydra.core.model.Type"}}},
                                                                    "type": {"literal": "string"}}},
                                                                "argument": {
                                                                  "lambda": {
                                                                    "parameter": "x",
                                                                    "domain": {"list": {"variable": "hydra.core.model.FieldType"}},
                                                                    "body": {"inject": {"typeName": "hydra.core.model.Type", "field": {"name": "union", "term": {"variable": "x"}}}}}}}},
                                                            "argument": {
                                                              "application": {
                                                                "function": {
                                                                  "application": {
                                                                    "function": {
                                                                      "typeApplication": {
                                                                        "body": {
                                                                          "typeApplication": {
                                                                            "body": {
                                                                              "typeApplication": {"body": {"variable": "hydra.core.lib.eithers.mapList"}, "type": {"variable": "hydra.core.model.FieldType"}}},
                                                                            "type": {"variable": "hydra.core.model.FieldType"}}},
                                                                        "type": {"literal": "string"}}},
                                                                    "argument": {"application": {"function": {"variable": "forField"}, "argument": {"variable": "bound"}}}}},
                                                                "argument": {"variable": "rt"}}}}}}}},
                                                  {
                                                    "name": "unit",
                                                    "handler": {
                                                      "lambda": {
                                                        "parameter": "_",
                                                        "domain": "unit",
                                                        "body": {
                                                          "typeApplication": {
                                                            "body": {
                                                              "typeApplication": {
                                                                "body": {"either": {"right": {"inject": {"typeName": "hydra.core.model.Type", "field": {"name": "unit", "term": "unit"}}}}},
                                                                "type": {"literal": "string"}}},
                                                            "type": {"variable": "hydra.core.model.Type"}}}}}},
                                                  {
                                                    "name": "variable",
                                                    "handler": {
                                                      "lambda": {
                                                        "parameter": "n",
                                                        "domain": {"variable": "hydra.core.model.Name"},
                                                        "body": {
                                                          "application": {
                                                            "function": {
                                                              "application": {
                                                                "function": {
                                                                  "application": {
                                                                    "function": {
                                                                      "typeApplication": {
                                                                        "body": {"variable": "hydra.core.lib.logic.ifElse"},
                                                                        "type": {"either": {"left": {"literal": "string"}, "right": {"variable": "hydra.core.model.Type"}}}}},
                                                                    "argument": {
                                                                      "application": {
                                                                        "function": {
                                                                          "application": {
                                                                            "function": {"typeApplication": {"body": {"variable": "hydra.core.lib.sets.member"}, "type": {"literal": "string"}}},
                                                                            "argument": {"application": {"function": {"unwrap": "hydra.core.model.Name"}, "argument": {"variable": "n"}}}}},
                                                                        "argument": {"variable": "bound"}}}}},
                                                                "argument": {
                                                                  "typeApplication": {
                                                                    "body": {
                                                                      "typeApplication": {
                                                                        "body": {
                                                                          "either": {"right": {"inject": {"typeName": "hydra.core.model.Type", "field": {"name": "variable", "term": {"variable": "n"}}}}}},
                                                                        "type": {"literal": "string"}}},
                                                                    "type": {"variable": "hydra.core.model.Type"}}}}},
                                                            "argument": {
                                                              "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.model.Type"}}},
                                                                        "type": {"literal": "string"}}},
                                                                    "argument": {
                                                                      "lambda": {
                                                                        "parameter": "x",
                                                                        "domain": {"variable": "hydra.core.model.Name"},
                                                                        "body": {"inject": {"typeName": "hydra.core.model.Type", "field": {"name": "variable", "term": {"variable": "x"}}}}}}}},
                                                                "argument": {
                                                                  "application": {
                                                                    "function": {
                                                                      "application": {
                                                                        "function": {
                                                                          "application": {
                                                                            "function": {
                                                                              "application": {"function": {"variable": "hydra.core.parse.packaging.resolveNameRefWith"}, "argument": {"variable": "modName"}}},
                                                                            "argument": {"variable": "ownNames"}}},
                                                                        "argument": {"variable": "universe"}}},
                                                                    "argument": {"variable": "n"}}}}}}}}}},
                                                  {
                                                    "name": "void",
                                                    "handler": {
                                                      "lambda": {
                                                        "parameter": "_",
                                                        "domain": "unit",
                                                        "body": {
                                                          "typeApplication": {
                                                            "body": {
                                                              "typeApplication": {
                                                                "body": {"either": {"right": {"inject": {"typeName": "hydra.core.model.Type", "field": {"name": "void", "term": "unit"}}}}},
                                                                "type": {"literal": "string"}}},
                                                            "type": {"variable": "hydra.core.model.Type"}}}}}},
                                                  {
                                                    "name": "wrap",
                                                    "handler": {
                                                      "lambda": {
                                                        "parameter": "wt",
                                                        "domain": {"variable": "hydra.core.model.Type"},
                                                        "body": {
                                                          "application": {
                                                            "function": {
                                                              "application": {
                                                                "function": {
                                                                  "typeApplication": {
                                                                    "body": {
                                                                      "typeApplication": {
                                                                        "body": {"typeApplication": {"body": {"variable": "hydra.core.lib.eithers.map"}, "type": {"variable": "hydra.core.model.Type"}}},
                                                                        "type": {"variable": "hydra.core.model.Type"}}},
                                                                    "type": {"literal": "string"}}},
                                                                "argument": {
                                                                  "lambda": {
                                                                    "parameter": "x",
                                                                    "domain": {"variable": "hydra.core.model.Type"},
                                                                    "body": {"inject": {"typeName": "hydra.core.model.Type", "field": {"name": "wrap", "term": {"variable": "x"}}}}}}}},
                                                            "argument": {
                                                              "application": {
                                                                "function": {"application": {"function": {"variable": "recurse"}, "argument": {"variable": "bound"}}},
                                                                "argument": {"variable": "wt"}}}}}}}}]}},
                                            "argument": {"variable": "typ"}}}}}}}}}}}}}}}}},
            "annotation": {
              "map": [
                {
                  "key": {"variable": "description"},
                  "value": {
                    "literal": {
                      "string": "Recursively resolve bare name references inside a type against the printer's universe, tracking bound type variables"}}}]}}}}},
    {
      "term": {
        "name": "hydra.core.parse.packaging.stripSpansInType",
        "signature": {
          "typeParameters": [],
          "parameters": [{"name": "arg0", "type": {"variable": "hydra.core.model.Type"}, "isLazy": false}],
          "result": {"type": {"variable": "hydra.core.model.Type"}}},
        "body": {
          "annotated": {
            "body": {
              "lambda": {
                "parameter": "typ",
                "domain": {"variable": "hydra.core.model.Type"},
                "body": {
                  "let": {
                    "bindings": [
                      {
                        "name": "remove",
                        "term": {
                          "typeLambda": {
                            "parameter": "t0",
                            "body": {
                              "lambda": {
                                "parameter": "recurse",
                                "domain": {"function": {"domain": {"variable": "t0"}, "codomain": {"variable": "hydra.core.model.Type"}}},
                                "body": {
                                  "lambda": {
                                    "parameter": "typ",
                                    "domain": {"variable": "t0"},
                                    "body": {
                                      "let": {
                                        "bindings": [
                                          {
                                            "name": "rewritten",
                                            "term": {"application": {"function": {"variable": "recurse"}, "argument": {"variable": "typ"}}},
                                            "typeScheme": {"variables": [], "body": {"variable": "hydra.core.model.Type"}, "constraints": []}}],
                                        "body": {
                                          "application": {
                                            "function": {
                                              "cases": {
                                                "typeName": "hydra.core.model.Type",
                                                "default": {"variable": "rewritten"},
                                                "cases": [
                                                  {
                                                    "name": "annotated",
                                                    "handler": {
                                                      "lambda": {
                                                        "parameter": "at",
                                                        "domain": {"variable": "hydra.core.model.AnnotatedType"},
                                                        "body": {
                                                          "inject": {
                                                            "typeName": "hydra.core.model.Type",
                                                            "field": {
                                                              "name": "annotated",
                                                              "term": {
                                                                "record": {
                                                                  "typeName": "hydra.core.model.AnnotatedType",
                                                                  "fields": [
                                                                    {
                                                                      "name": "body",
                                                                      "term": {
                                                                        "application": {
                                                                          "function": {"project": {"typeName": "hydra.core.model.AnnotatedType", "fieldName": "body"}},
                                                                          "argument": {"variable": "at"}}}},
                                                                    {
                                                                      "name": "annotation",
                                                                      "term": {
                                                                        "application": {
                                                                          "function": {"variable": "hydra.core.positions.stripSpans"},
                                                                          "argument": {
                                                                            "application": {
                                                                              "function": {"project": {"typeName": "hydra.core.model.AnnotatedType", "fieldName": "annotation"}},
                                                                              "argument": {"variable": "at"}}}}}}]}}}}}}}}]}},
                                            "argument": {"variable": "rewritten"}}}}}}}}}}},
                        "typeScheme": {
                          "variables": ["t0"],
                          "body": {
                            "function": {
                              "domain": {"function": {"domain": {"variable": "t0"}, "codomain": {"variable": "hydra.core.model.Type"}}},
                              "codomain": {"function": {"domain": {"variable": "t0"}, "codomain": {"variable": "hydra.core.model.Type"}}}}},
                          "constraints": []}}],
                    "body": {
                      "application": {
                        "function": {
                          "application": {
                            "function": {"variable": "hydra.core.rewriting.rewriteType"},
                            "argument": {"typeApplication": {"body": {"variable": "remove"}, "type": {"variable": "hydra.core.model.Type"}}}}},
                        "argument": {"variable": "typ"}}}}}}},
            "annotation": {
              "map": [
                {
                  "key": {"variable": "description"},
                  "value": {"literal": {"string": "Remove every span annotation from a type's own annotation payloads"}}}]}}}}},
    {
      "term": {
        "name": "hydra.core.parse.packaging.termDefinitionParser",
        "signature": {
          "typeParameters": [],
          "parameters": [{"name": "arg0", "type": {"variable": "hydra.core.packaging.ModuleName"}, "isLazy": false}],
          "result": {
            "type": {
              "application": {"function": {"variable": "hydra.core.parsing.Parser"}, "argument": {"variable": "hydra.core.packaging.Definition"}}}}},
        "body": {
          "annotated": {
            "body": {
              "lambda": {
                "parameter": "modName",
                "domain": {"variable": "hydra.core.packaging.ModuleName"},
                "body": {
                  "application": {
                    "function": {
                      "application": {
                        "function": {
                          "typeApplication": {
                            "body": {
                              "typeApplication": {
                                "body": {"variable": "hydra.core.parsers.bind"},
                                "type": {"optional": {"variable": "hydra.core.packaging.EntityMetadata"}}}},
                            "type": {"variable": "hydra.core.packaging.Definition"}}},
                        "argument": {
                          "application": {"function": {"variable": "hydra.core.parse.packaging.docCommentBlock"}, "argument": {"variable": "modName"}}}}},
                    "argument": {
                      "lambda": {
                        "parameter": "mmeta",
                        "domain": {"optional": {"variable": "hydra.core.packaging.EntityMetadata"}},
                        "body": {
                          "application": {
                            "function": {
                              "application": {
                                "function": {
                                  "typeApplication": {
                                    "body": {"typeApplication": {"body": {"variable": "hydra.core.parsers.bind"}, "type": {"literal": "string"}}},
                                    "type": {"variable": "hydra.core.packaging.Definition"}}},
                                "argument": {
                                  "application": {"function": {"variable": "hydra.core.parse.packaging.keyword"}, "argument": {"literal": {"string": "term"}}}}}},
                            "argument": {
                              "lambda": {
                                "parameter": "_",
                                "domain": {"literal": "string"},
                                "body": {
                                  "application": {
                                    "function": {
                                      "application": {
                                        "function": {
                                          "typeApplication": {
                                            "body": {"typeApplication": {"body": {"variable": "hydra.core.parsers.bind"}, "type": {"literal": "string"}}},
                                            "type": {"variable": "hydra.core.packaging.Definition"}}},
                                        "argument": {"variable": "hydra.core.parse.packaging.identifier"}}},
                                    "argument": {
                                      "lambda": {
                                        "parameter": "local",
                                        "domain": {"literal": "string"},
                                        "body": {
                                          "application": {
                                            "function": {
                                              "application": {
                                                "function": {
                                                  "typeApplication": {
                                                    "body": {
                                                      "typeApplication": {"body": {"variable": "hydra.core.parsers.bind"}, "type": {"optional": {"variable": "hydra.core.typing.TermSignature"}}}},
                                                    "type": {"variable": "hydra.core.packaging.Definition"}}},
                                                "argument": {
                                                  "application": {
                                                    "function": {
                                                      "typeApplication": {"body": {"variable": "hydra.core.parsers.optional"}, "type": {"variable": "hydra.core.typing.TermSignature"}}},
                                                    "argument": {
                                                      "application": {
                                                        "function": {
                                                          "application": {
                                                            "function": {
                                                              "typeApplication": {
                                                                "body": {"typeApplication": {"body": {"variable": "hydra.core.parsers.bind"}, "type": {"literal": "string"}}},
                                                                "type": {"variable": "hydra.core.typing.TermSignature"}}},
                                                            "argument": {
                                                              "application": {"function": {"variable": "hydra.core.parse.packaging.keyword"}, "argument": {"literal": {"string": ":"}}}}}},
                                                        "argument": {
                                                          "lambda": {"parameter": "_", "domain": {"literal": "string"}, "body": {"variable": "hydra.core.parse.core.termSignature"}}}}}}}}},
                                            "argument": {
                                              "lambda": {
                                                "parameter": "msig",
                                                "domain": {"optional": {"variable": "hydra.core.typing.TermSignature"}},
                                                "body": {
                                                  "application": {
                                                    "function": {
                                                      "application": {
                                                        "function": {
                                                          "typeApplication": {
                                                            "body": {"typeApplication": {"body": {"variable": "hydra.core.parsers.bind"}, "type": {"literal": "string"}}},
                                                            "type": {"variable": "hydra.core.packaging.Definition"}}},
                                                        "argument": {
                                                          "application": {"function": {"variable": "hydra.core.parse.packaging.keyword"}, "argument": {"literal": {"string": "="}}}}}},
                                                    "argument": {
                                                      "lambda": {
                                                        "parameter": "_",
                                                        "domain": {"literal": "string"},
                                                        "body": {
                                                          "application": {
                                                            "function": {
                                                              "application": {
                                                                "function": {
                                                                  "typeApplication": {
                                                                    "body": {"typeApplication": {"body": {"variable": "hydra.core.parsers.map"}, "type": {"variable": "hydra.core.model.Term"}}},
                                                                    "type": {"variable": "hydra.core.packaging.Definition"}}},
                                                                "argument": {
                                                                  "lambda": {
                                                                    "parameter": "t",
                                                                    "domain": {"variable": "hydra.core.model.Term"},
                                                                    "body": {
                                                                      "let": {
                                                                        "bindings": [
                                                                          {
                                                                            "name": "reattached",
                                                                            "term": {
                                                                              "application": {
                                                                                "function": {
                                                                                  "application": {
                                                                                    "function": {"variable": "hydra.core.parse.packaging.reattachTermDescriptionToBody"},
                                                                                    "argument": {"variable": "mmeta"}}},
                                                                                "argument": {"variable": "t"}}},
                                                                            "typeScheme": {
                                                                              "variables": [],
                                                                              "body": {
                                                                                "pair": {
                                                                                  "first": {"optional": {"variable": "hydra.core.packaging.EntityMetadata"}},
                                                                                  "second": {"variable": "hydra.core.model.Term"}}},
                                                                              "constraints": []}}],
                                                                        "body": {
                                                                          "inject": {
                                                                            "typeName": "hydra.core.packaging.Definition",
                                                                            "field": {
                                                                              "name": "term",
                                                                              "term": {
                                                                                "record": {
                                                                                  "typeName": "hydra.core.packaging.TermDefinition",
                                                                                  "fields": [
                                                                                    {
                                                                                      "name": "name",
                                                                                      "term": {
                                                                                        "application": {
                                                                                          "function": {
                                                                                            "application": {"function": {"variable": "hydra.core.parse.packaging.qualifyLocalName"}, "argument": {"variable": "modName"}}},
                                                                                          "argument": {"variable": "local"}}}},
                                                                                    {
                                                                                      "name": "metadata",
                                                                                      "term": {
                                                                                        "application": {
                                                                                          "function": {
                                                                                            "typeApplication": {
                                                                                              "body": {
                                                                                                "typeApplication": {
                                                                                                  "body": {"variable": "hydra.core.lib.pairs.first"},
                                                                                                  "type": {"optional": {"variable": "hydra.core.packaging.EntityMetadata"}}}},
                                                                                              "type": {"variable": "hydra.core.model.Term"}}},
                                                                                          "argument": {"variable": "reattached"}}}},
                                                                                    {"name": "signature", "term": {"variable": "msig"}},
                                                                                    {
                                                                                      "name": "body",
                                                                                      "term": {
                                                                                        "application": {
                                                                                          "function": {
                                                                                            "typeApplication": {
                                                                                              "body": {
                                                                                                "typeApplication": {
                                                                                                  "body": {"variable": "hydra.core.lib.pairs.second"},
                                                                                                  "type": {"optional": {"variable": "hydra.core.packaging.EntityMetadata"}}}},
                                                                                              "type": {"variable": "hydra.core.model.Term"}}},
                                                                                          "argument": {"variable": "reattached"}}}}]}}}}}}}}}}},
                                                            "argument": {
                                                              "application": {
                                                                "function": {
                                                                  "typeApplication": {"body": {"variable": "hydra.core.parse.packaging.token"}, "type": {"variable": "hydra.core.model.Term"}}},
                                                                "argument": {
                                                                  "application": {
                                                                    "function": {
                                                                      "application": {
                                                                        "function": {
                                                                          "typeApplication": {
                                                                            "body": {"typeApplication": {"body": {"variable": "hydra.core.parsers.map"}, "type": {"variable": "hydra.core.model.Term"}}},
                                                                            "type": {"variable": "hydra.core.model.Term"}}},
                                                                        "argument": {"variable": "hydra.core.positions.stripSpans"}}},
                                                                    "argument": {"variable": "hydra.core.parse.core.term"}}}}}}}}}}}}}}}}}}}}}}}}}}}}},
            "annotation": {
              "map": [
                {
                  "key": {"variable": "description"},
                  "value": {"literal": {"string": "Parse a term definition: ['##' doc comment] 'term name [: termSignature] = term'"}}}]}}}}},
    {
      "term": {
        "name": "hydra.core.parse.packaging.token",
        "signature": {
          "typeParameters": [{"name": "t0", "constraints": []}],
          "parameters": [
            {
              "name": "arg0",
              "type": {"application": {"function": {"variable": "hydra.core.parsing.Parser"}, "argument": {"variable": "t0"}}},
              "isLazy": false}],
          "result": {"type": {"application": {"function": {"variable": "hydra.core.parsing.Parser"}, "argument": {"variable": "t0"}}}}},
        "body": {
          "typeLambda": {
            "parameter": "t0",
            "body": {
              "annotated": {
                "body": {
                  "lambda": {
                    "parameter": "p",
                    "domain": {"application": {"function": {"variable": "hydra.core.parsing.Parser"}, "argument": {"variable": "t0"}}},
                    "body": {
                      "application": {
                        "function": {
                          "application": {
                            "function": {
                              "typeApplication": {
                                "body": {"typeApplication": {"body": {"variable": "hydra.core.parsers.bind"}, "type": {"variable": "t0"}}},
                                "type": {"variable": "t0"}}},
                            "argument": {"variable": "p"}}},
                        "argument": {
                          "lambda": {
                            "parameter": "x",
                            "domain": {"variable": "t0"},
                            "body": {
                              "application": {
                                "function": {
                                  "application": {
                                    "function": {
                                      "typeApplication": {
                                        "body": {"typeApplication": {"body": {"variable": "hydra.core.parsers.bind"}, "type": "unit"}},
                                        "type": {"variable": "t0"}}},
                                    "argument": {"variable": "hydra.core.parse.packaging.whitespace"}}},
                                "argument": {
                                  "lambda": {
                                    "parameter": "_",
                                    "domain": "unit",
                                    "body": {
                                      "application": {
                                        "function": {"typeApplication": {"body": {"variable": "hydra.core.parsers.pure"}, "type": {"variable": "t0"}}},
                                        "argument": {"variable": "x"}}}}}}}}}}}}},
                "annotation": {
                  "map": [
                    {
                      "key": {"variable": "description"},
                      "value": {"literal": {"string": "Parse a token followed by optional trailing whitespace"}}}]}}}}}}},
    {
      "term": {
        "name": "hydra.core.parse.packaging.typeDefinitionParser",
        "signature": {
          "typeParameters": [],
          "parameters": [{"name": "arg0", "type": {"variable": "hydra.core.packaging.ModuleName"}, "isLazy": false}],
          "result": {
            "type": {
              "application": {"function": {"variable": "hydra.core.parsing.Parser"}, "argument": {"variable": "hydra.core.packaging.Definition"}}}}},
        "body": {
          "annotated": {
            "body": {
              "lambda": {
                "parameter": "modName",
                "domain": {"variable": "hydra.core.packaging.ModuleName"},
                "body": {
                  "application": {
                    "function": {
                      "application": {
                        "function": {
                          "typeApplication": {
                            "body": {
                              "typeApplication": {
                                "body": {"variable": "hydra.core.parsers.bind"},
                                "type": {"optional": {"variable": "hydra.core.packaging.EntityMetadata"}}}},
                            "type": {"variable": "hydra.core.packaging.Definition"}}},
                        "argument": {
                          "application": {"function": {"variable": "hydra.core.parse.packaging.docCommentBlock"}, "argument": {"variable": "modName"}}}}},
                    "argument": {
                      "lambda": {
                        "parameter": "mmeta",
                        "domain": {"optional": {"variable": "hydra.core.packaging.EntityMetadata"}},
                        "body": {
                          "application": {
                            "function": {
                              "application": {
                                "function": {
                                  "typeApplication": {
                                    "body": {"typeApplication": {"body": {"variable": "hydra.core.parsers.bind"}, "type": {"literal": "string"}}},
                                    "type": {"variable": "hydra.core.packaging.Definition"}}},
                                "argument": {
                                  "application": {"function": {"variable": "hydra.core.parse.packaging.keyword"}, "argument": {"literal": {"string": "type"}}}}}},
                            "argument": {
                              "lambda": {
                                "parameter": "_",
                                "domain": {"literal": "string"},
                                "body": {
                                  "application": {
                                    "function": {
                                      "application": {
                                        "function": {
                                          "typeApplication": {
                                            "body": {"typeApplication": {"body": {"variable": "hydra.core.parsers.bind"}, "type": {"literal": "string"}}},
                                            "type": {"variable": "hydra.core.packaging.Definition"}}},
                                        "argument": {"variable": "hydra.core.parse.packaging.identifier"}}},
                                    "argument": {
                                      "lambda": {
                                        "parameter": "local",
                                        "domain": {"literal": "string"},
                                        "body": {
                                          "application": {
                                            "function": {
                                              "application": {
                                                "function": {
                                                  "typeApplication": {
                                                    "body": {"typeApplication": {"body": {"variable": "hydra.core.parsers.bind"}, "type": {"literal": "string"}}},
                                                    "type": {"variable": "hydra.core.packaging.Definition"}}},
                                                "argument": {
                                                  "application": {"function": {"variable": "hydra.core.parse.packaging.keyword"}, "argument": {"literal": {"string": "="}}}}}},
                                            "argument": {
                                              "lambda": {
                                                "parameter": "_",
                                                "domain": {"literal": "string"},
                                                "body": {
                                                  "application": {
                                                    "function": {
                                                      "application": {
                                                        "function": {
                                                          "typeApplication": {
                                                            "body": {
                                                              "typeApplication": {"body": {"variable": "hydra.core.parsers.map"}, "type": {"variable": "hydra.core.model.TypeScheme"}}},
                                                            "type": {"variable": "hydra.core.packaging.Definition"}}},
                                                        "argument": {
                                                          "lambda": {
                                                            "parameter": "ts",
                                                            "domain": {"variable": "hydra.core.model.TypeScheme"},
                                                            "body": {
                                                              "let": {
                                                                "bindings": [
                                                                  {
                                                                    "name": "reattached",
                                                                    "term": {
                                                                      "application": {
                                                                        "function": {
                                                                          "application": {
                                                                            "function": {"variable": "hydra.core.parse.packaging.reattachTypeDescriptionToBody"},
                                                                            "argument": {"variable": "mmeta"}}},
                                                                        "argument": {
                                                                          "application": {
                                                                            "function": {"variable": "hydra.core.parse.packaging.stripSpansInType"},
                                                                            "argument": {
                                                                              "application": {
                                                                                "function": {"project": {"typeName": "hydra.core.model.TypeScheme", "fieldName": "body"}},
                                                                                "argument": {"variable": "ts"}}}}}}},
                                                                    "typeScheme": {
                                                                      "variables": [],
                                                                      "body": {
                                                                        "pair": {
                                                                          "first": {"optional": {"variable": "hydra.core.packaging.EntityMetadata"}},
                                                                          "second": {"variable": "hydra.core.model.Type"}}},
                                                                      "constraints": []}}],
                                                                "body": {
                                                                  "inject": {
                                                                    "typeName": "hydra.core.packaging.Definition",
                                                                    "field": {
                                                                      "name": "type",
                                                                      "term": {
                                                                        "record": {
                                                                          "typeName": "hydra.core.packaging.TypeDefinition",
                                                                          "fields": [
                                                                            {
                                                                              "name": "name",
                                                                              "term": {
                                                                                "application": {
                                                                                  "function": {
                                                                                    "application": {"function": {"variable": "hydra.core.parse.packaging.qualifyLocalName"}, "argument": {"variable": "modName"}}},
                                                                                  "argument": {"variable": "local"}}}},
                                                                            {
                                                                              "name": "metadata",
                                                                              "term": {
                                                                                "application": {
                                                                                  "function": {
                                                                                    "typeApplication": {
                                                                                      "body": {
                                                                                        "typeApplication": {
                                                                                          "body": {"variable": "hydra.core.lib.pairs.first"},
                                                                                          "type": {"optional": {"variable": "hydra.core.packaging.EntityMetadata"}}}},
                                                                                      "type": {"variable": "hydra.core.model.Type"}}},
                                                                                  "argument": {"variable": "reattached"}}}},
                                                                            {
                                                                              "name": "body",
                                                                              "term": {
                                                                                "record": {
                                                                                  "typeName": "hydra.core.model.TypeScheme",
                                                                                  "fields": [
                                                                                    {
                                                                                      "name": "variables",
                                                                                      "term": {
                                                                                        "application": {
                                                                                          "function": {"project": {"typeName": "hydra.core.model.TypeScheme", "fieldName": "variables"}},
                                                                                          "argument": {"variable": "ts"}}}},
                                                                                    {
                                                                                      "name": "body",
                                                                                      "term": {
                                                                                        "application": {
                                                                                          "function": {
                                                                                            "typeApplication": {
                                                                                              "body": {
                                                                                                "typeApplication": {
                                                                                                  "body": {"variable": "hydra.core.lib.pairs.second"},
                                                                                                  "type": {"optional": {"variable": "hydra.core.packaging.EntityMetadata"}}}},
                                                                                              "type": {"variable": "hydra.core.model.Type"}}},
                                                                                          "argument": {"variable": "reattached"}}}},
                                                                                    {
                                                                                      "name": "constraints",
                                                                                      "term": {
                                                                                        "application": {
                                                                                          "function": {"project": {"typeName": "hydra.core.model.TypeScheme", "fieldName": "constraints"}},
                                                                                          "argument": {"variable": "ts"}}}}]}}}]}}}}}}}}}}},
                                                    "argument": {
                                                      "application": {
                                                        "function": {
                                                          "typeApplication": {"body": {"variable": "hydra.core.parse.packaging.token"}, "type": {"variable": "hydra.core.model.TypeScheme"}}},
                                                        "argument": {"variable": "hydra.core.parse.core.typeScheme"}}}}}}}}}}}}}}}}}}}}}}},
            "annotation": {
              "map": [
                {
                  "key": {"variable": "description"},
                  "value": {"literal": {"string": "Parse a type definition: ['##' doc comment] 'type name = typeScheme'"}}}]}}}}},
    {
      "term": {
        "name": "hydra.core.parse.packaging.typeEnvFromDefinitions",
        "signature": {
          "typeParameters": [],
          "parameters": [{"name": "arg0", "type": {"list": {"variable": "hydra.core.packaging.Definition"}}, "isLazy": false}],
          "result": {"type": {"map": {"keys": {"variable": "hydra.core.model.Name"}, "values": {"variable": "hydra.core.model.Type"}}}}},
        "body": {
          "annotated": {
            "body": {
              "lambda": {
                "parameter": "defs",
                "domain": {"list": {"variable": "hydra.core.packaging.Definition"}},
                "body": {
                  "application": {
                    "function": {
                      "typeApplication": {
                        "body": {
                          "typeApplication": {"body": {"variable": "hydra.core.lib.maps.fromList"}, "type": {"variable": "hydra.core.model.Name"}}},
                        "type": {"variable": "hydra.core.model.Type"}}},
                    "argument": {
                      "application": {
                        "function": {
                          "typeApplication": {
                            "body": {"variable": "hydra.core.lib.optionals.givens"},
                            "type": {"pair": {"first": {"variable": "hydra.core.model.Name"}, "second": {"variable": "hydra.core.model.Type"}}}}},
                        "argument": {
                          "application": {
                            "function": {
                              "application": {
                                "function": {
                                  "typeApplication": {
                                    "body": {
                                      "typeApplication": {"body": {"variable": "hydra.core.lib.lists.map"}, "type": {"variable": "hydra.core.packaging.Definition"}}},
                                    "type": {
                                      "optional": {"pair": {"first": {"variable": "hydra.core.model.Name"}, "second": {"variable": "hydra.core.model.Type"}}}}}},
                                "argument": {
                                  "lambda": {
                                    "parameter": "def",
                                    "domain": {"variable": "hydra.core.packaging.Definition"},
                                    "body": {
                                      "application": {
                                        "function": {
                                          "cases": {
                                            "typeName": "hydra.core.packaging.Definition",
                                            "default": {
                                              "typeApplication": {
                                                "body": {"optional": null},
                                                "type": {"pair": {"first": {"variable": "hydra.core.model.Name"}, "second": {"variable": "hydra.core.model.Type"}}}}},
                                            "cases": [
                                              {
                                                "name": "type",
                                                "handler": {
                                                  "lambda": {
                                                    "parameter": "td",
                                                    "domain": {"variable": "hydra.core.packaging.TypeDefinition"},
                                                    "body": {
                                                      "optional": {
                                                        "typeApplication": {
                                                          "body": {
                                                            "typeApplication": {
                                                              "body": {
                                                                "pair": {
                                                                  "first": {
                                                                    "application": {
                                                                      "function": {"project": {"typeName": "hydra.core.packaging.TypeDefinition", "fieldName": "name"}},
                                                                      "argument": {"variable": "td"}}},
                                                                  "second": {
                                                                    "application": {
                                                                      "function": {"project": {"typeName": "hydra.core.model.TypeScheme", "fieldName": "body"}},
                                                                      "argument": {
                                                                        "application": {
                                                                          "function": {"project": {"typeName": "hydra.core.packaging.TypeDefinition", "fieldName": "body"}},
                                                                          "argument": {"variable": "td"}}}}}}},
                                                              "type": {"variable": "hydra.core.model.Name"}}},
                                                          "type": {"variable": "hydra.core.model.Type"}}}}}}}]}},
                                        "argument": {"variable": "def"}}}}}}},
                            "argument": {"variable": "defs"}}}}}}}}},
            "annotation": {
              "map": [
                {
                  "key": {"variable": "description"},
                  "value": {"literal": {"string": "Map each of a module's own type definitions to its (deannotated) scheme body (#809)"}}}]}}}}},
    {
      "term": {
        "name": "hydra.core.parse.packaging.unionTypeNamesOf",
        "signature": {
          "typeParameters": [],
          "parameters": [{"name": "arg0", "type": {"list": {"variable": "hydra.core.packaging.Module"}}, "isLazy": false}],
          "result": {"type": {"set": {"variable": "hydra.core.model.Name"}}}},
        "body": {
          "annotated": {
            "body": {
              "lambda": {
                "parameter": "mods",
                "domain": {"list": {"variable": "hydra.core.packaging.Module"}},
                "body": {
                  "application": {
                    "function": {
                      "typeApplication": {"body": {"variable": "hydra.core.lib.sets.fromList"}, "type": {"variable": "hydra.core.model.Name"}}},
                    "argument": {
                      "application": {
                        "function": {
                          "typeApplication": {"body": {"variable": "hydra.core.lib.lists.concat"}, "type": {"variable": "hydra.core.model.Name"}}},
                        "argument": {
                          "application": {
                            "function": {
                              "application": {
                                "function": {
                                  "typeApplication": {
                                    "body": {
                                      "typeApplication": {"body": {"variable": "hydra.core.lib.lists.map"}, "type": {"variable": "hydra.core.packaging.Module"}}},
                                    "type": {"list": {"variable": "hydra.core.model.Name"}}}},
                                "argument": {
                                  "lambda": {
                                    "parameter": "mod",
                                    "domain": {"variable": "hydra.core.packaging.Module"},
                                    "body": {
                                      "application": {
                                        "function": {
                                          "typeApplication": {"body": {"variable": "hydra.core.lib.optionals.givens"}, "type": {"variable": "hydra.core.model.Name"}}},
                                        "argument": {
                                          "application": {
                                            "function": {
                                              "application": {
                                                "function": {
                                                  "typeApplication": {
                                                    "body": {
                                                      "typeApplication": {"body": {"variable": "hydra.core.lib.lists.map"}, "type": {"variable": "hydra.core.packaging.Definition"}}},
                                                    "type": {"optional": {"variable": "hydra.core.model.Name"}}}},
                                                "argument": {
                                                  "lambda": {
                                                    "parameter": "def",
                                                    "domain": {"variable": "hydra.core.packaging.Definition"},
                                                    "body": {
                                                      "application": {
                                                        "function": {
                                                          "cases": {
                                                            "typeName": "hydra.core.packaging.Definition",
                                                            "cases": [
                                                              {
                                                                "name": "type",
                                                                "handler": {
                                                                  "lambda": {
                                                                    "parameter": "td",
                                                                    "domain": {"variable": "hydra.core.packaging.TypeDefinition"},
                                                                    "body": {
                                                                      "application": {
                                                                        "function": {
                                                                          "application": {
                                                                            "function": {
                                                                              "application": {
                                                                                "function": {
                                                                                  "typeApplication": {"body": {"variable": "hydra.core.lib.logic.ifElse"}, "type": {"optional": {"variable": "hydra.core.model.Name"}}}},
                                                                                "argument": {
                                                                                  "application": {
                                                                                    "function": {"variable": "hydra.core.parse.packaging.isUnionType"},
                                                                                    "argument": {
                                                                                      "application": {
                                                                                        "function": {"project": {"typeName": "hydra.core.model.TypeScheme", "fieldName": "body"}},
                                                                                        "argument": {
                                                                                          "application": {
                                                                                            "function": {"project": {"typeName": "hydra.core.packaging.TypeDefinition", "fieldName": "body"}},
                                                                                            "argument": {"variable": "td"}}}}}}}}},
                                                                            "argument": {
                                                                              "optional": {
                                                                                "application": {
                                                                                  "function": {"project": {"typeName": "hydra.core.packaging.TypeDefinition", "fieldName": "name"}},
                                                                                  "argument": {"variable": "td"}}}}}},
                                                                        "argument": {"typeApplication": {"body": {"optional": null}, "type": {"variable": "hydra.core.model.Name"}}}}}}}},
                                                              {
                                                                "name": "term",
                                                                "handler": {
                                                                  "lambda": {
                                                                    "parameter": "_",
                                                                    "domain": {"variable": "hydra.core.packaging.TermDefinition"},
                                                                    "body": {"typeApplication": {"body": {"optional": null}, "type": {"variable": "hydra.core.model.Name"}}}}}},
                                                              {
                                                                "name": "primitive",
                                                                "handler": {
                                                                  "lambda": {
                                                                    "parameter": "_",
                                                                    "domain": {"variable": "hydra.core.packaging.PrimitiveDefinition"},
                                                                    "body": {"typeApplication": {"body": {"optional": null}, "type": {"variable": "hydra.core.model.Name"}}}}}}]}},
                                                        "argument": {"variable": "def"}}}}}}},
                                            "argument": {
                                              "application": {
                                                "function": {"project": {"typeName": "hydra.core.packaging.Module", "fieldName": "definitions"}},
                                                "argument": {"variable": "mod"}}}}}}}}}}},
                            "argument": {"variable": "mods"}}}}}}}}},
            "annotation": {
              "map": [
                {
                  "key": {"variable": "description"},
                  "value": {"literal": {"string": "Build the flat set of fully-qualified union type names across a list of modules (#842)"}}}]}}}}},
    {
      "term": {
        "name": "hydra.core.parse.packaging.universeEntryOf",
        "signature": {
          "typeParameters": [],
          "parameters": [{"name": "arg0", "type": {"variable": "hydra.core.packaging.Module"}, "isLazy": false}],
          "result": {
            "type": {
              "pair": {"first": {"variable": "hydra.core.packaging.ModuleName"}, "second": {"set": {"variable": "hydra.core.model.Name"}}}}}},
        "body": {
          "annotated": {
            "body": {
              "lambda": {
                "parameter": "mod",
                "domain": {"variable": "hydra.core.packaging.Module"},
                "body": {
                  "typeApplication": {
                    "body": {
                      "typeApplication": {
                        "body": {
                          "pair": {
                            "first": {
                              "application": {
                                "function": {"project": {"typeName": "hydra.core.packaging.Module", "fieldName": "name"}},
                                "argument": {"variable": "mod"}}},
                            "second": {
                              "application": {
                                "function": {
                                  "typeApplication": {"body": {"variable": "hydra.core.lib.sets.fromList"}, "type": {"variable": "hydra.core.model.Name"}}},
                                "argument": {
                                  "application": {
                                    "function": {
                                      "application": {
                                        "function": {
                                          "typeApplication": {
                                            "body": {
                                              "typeApplication": {"body": {"variable": "hydra.core.lib.lists.map"}, "type": {"variable": "hydra.core.packaging.Definition"}}},
                                            "type": {"variable": "hydra.core.model.Name"}}},
                                        "argument": {
                                          "lambda": {
                                            "parameter": "def",
                                            "domain": {"variable": "hydra.core.packaging.Definition"},
                                            "body": {
                                              "application": {
                                                "function": {
                                                  "cases": {
                                                    "typeName": "hydra.core.packaging.Definition",
                                                    "cases": [
                                                      {
                                                        "name": "type",
                                                        "handler": {
                                                          "lambda": {
                                                            "parameter": "td",
                                                            "domain": {"variable": "hydra.core.packaging.TypeDefinition"},
                                                            "body": {
                                                              "application": {
                                                                "function": {"project": {"typeName": "hydra.core.packaging.TypeDefinition", "fieldName": "name"}},
                                                                "argument": {"variable": "td"}}}}}},
                                                      {
                                                        "name": "term",
                                                        "handler": {
                                                          "lambda": {
                                                            "parameter": "td",
                                                            "domain": {"variable": "hydra.core.packaging.TermDefinition"},
                                                            "body": {
                                                              "application": {
                                                                "function": {"project": {"typeName": "hydra.core.packaging.TermDefinition", "fieldName": "name"}},
                                                                "argument": {"variable": "td"}}}}}},
                                                      {
                                                        "name": "primitive",
                                                        "handler": {
                                                          "lambda": {
                                                            "parameter": "pd",
                                                            "domain": {"variable": "hydra.core.packaging.PrimitiveDefinition"},
                                                            "body": {
                                                              "application": {
                                                                "function": {"project": {"typeName": "hydra.core.packaging.PrimitiveDefinition", "fieldName": "name"}},
                                                                "argument": {"variable": "pd"}}}}}}]}},
                                                "argument": {"variable": "def"}}}}}}},
                                    "argument": {
                                      "application": {
                                        "function": {"project": {"typeName": "hydra.core.packaging.Module", "fieldName": "definitions"}},
                                        "argument": {"variable": "mod"}}}}}}}}},
                        "type": {"variable": "hydra.core.packaging.ModuleName"}}},
                    "type": {"set": {"variable": "hydra.core.model.Name"}}}}}},
            "annotation": {
              "map": [
                {
                  "key": {"variable": "description"},
                  "value": {"literal": {"string": "Build a module's (name, declared-names) universe entry (#842)"}}}]}}}}},
    {
      "term": {
        "name": "hydra.core.parse.packaging.universeNamesOf",
        "signature": {
          "typeParameters": [],
          "parameters": [{"name": "arg0", "type": {"list": {"variable": "hydra.core.packaging.Module"}}, "isLazy": false}],
          "result": {
            "type": {
              "map": {"keys": {"variable": "hydra.core.packaging.ModuleName"}, "values": {"set": {"variable": "hydra.core.model.Name"}}}}}},
        "body": {
          "annotated": {
            "body": {
              "lambda": {
                "parameter": "mods",
                "domain": {"list": {"variable": "hydra.core.packaging.Module"}},
                "body": {
                  "application": {
                    "function": {
                      "typeApplication": {
                        "body": {
                          "typeApplication": {"body": {"variable": "hydra.core.lib.maps.fromList"}, "type": {"variable": "hydra.core.packaging.ModuleName"}}},
                        "type": {"set": {"variable": "hydra.core.model.Name"}}}},
                    "argument": {
                      "application": {
                        "function": {
                          "application": {
                            "function": {
                              "typeApplication": {
                                "body": {
                                  "typeApplication": {"body": {"variable": "hydra.core.lib.lists.map"}, "type": {"variable": "hydra.core.packaging.Module"}}},
                                "type": {
                                  "pair": {"first": {"variable": "hydra.core.packaging.ModuleName"}, "second": {"set": {"variable": "hydra.core.model.Name"}}}}}},
                            "argument": {"variable": "hydra.core.parse.packaging.universeEntryOf"}}},
                        "argument": {"variable": "mods"}}}}}}},
            "annotation": {
              "map": [
                {
                  "key": {"variable": "description"},
                  "value": {"literal": {"string": "Build a universe map (module name -> its declared local names) from a list of modules (#842)"}}}]}}}}},
    {
      "term": {
        "name": "hydra.core.parse.packaging.whitespace",
        "signature": {
          "typeParameters": [],
          "parameters": [],
          "result": {"type": {"application": {"function": {"variable": "hydra.core.parsing.Parser"}, "argument": "unit"}}}},
        "body": {
          "annotated": {
            "body": {
              "application": {
                "function": {
                  "application": {
                    "function": {
                      "typeApplication": {
                        "body": {"typeApplication": {"body": {"variable": "hydra.core.parsers.map"}, "type": {"list": "unit"}}},
                        "type": "unit"}},
                    "argument": {"lambda": {"parameter": "_", "domain": {"list": "unit"}, "body": "unit"}}}},
                "argument": {
                  "application": {
                    "function": {"typeApplication": {"body": {"variable": "hydra.core.parsers.many"}, "type": "unit"}},
                    "argument": {
                      "application": {
                        "function": {
                          "application": {
                            "function": {"typeApplication": {"body": {"variable": "hydra.core.parsers.alt"}, "type": "unit"}},
                            "argument": {
                              "application": {
                                "function": {
                                  "application": {
                                    "function": {
                                      "typeApplication": {
                                        "body": {"typeApplication": {"body": {"variable": "hydra.core.parsers.map"}, "type": {"literal": {"integer": "int32"}}}},
                                        "type": "unit"}},
                                    "argument": {"lambda": {"parameter": "_", "domain": {"literal": {"integer": "int32"}}, "body": "unit"}}}},
                                "argument": {
                                  "application": {
                                    "function": {"variable": "hydra.core.parsers.satisfy"},
                                    "argument": {
                                      "lambda": {
                                        "parameter": "c",
                                        "domain": {"literal": {"integer": "int32"}},
                                        "body": {"application": {"function": {"variable": "hydra.core.lib.chars.isSpace"}, "argument": {"variable": "c"}}}}}}}}}}},
                        "argument": {
                          "application": {
                            "function": {"typeApplication": {"body": {"variable": "hydra.core.parsers.try"}, "type": "unit"}},
                            "argument": {
                              "application": {
                                "function": {
                                  "application": {
                                    "function": {
                                      "typeApplication": {
                                        "body": {"typeApplication": {"body": {"variable": "hydra.core.parsers.bind"}, "type": {"literal": {"integer": "int32"}}}},
                                        "type": "unit"}},
                                    "argument": {
                                      "application": {"function": {"variable": "hydra.core.parsers.char"}, "argument": {"literal": {"integer": {"int32": 35}}}}}}},
                                "argument": {
                                  "lambda": {
                                    "parameter": "_",
                                    "domain": {"literal": {"integer": "int32"}},
                                    "body": {
                                      "application": {
                                        "function": {
                                          "application": {
                                            "function": {
                                              "typeApplication": {"body": {"typeApplication": {"body": {"variable": "hydra.core.parsers.bind"}, "type": "unit"}}, "type": "unit"}},
                                            "argument": {
                                              "application": {
                                                "function": {
                                                  "application": {
                                                    "function": {"typeApplication": {"body": {"variable": "hydra.core.parsers.alt"}, "type": "unit"}},
                                                    "argument": {"variable": "hydra.core.parsers.eof"}}},
                                                "argument": {
                                                  "application": {
                                                    "function": {
                                                      "application": {
                                                        "function": {
                                                          "typeApplication": {
                                                            "body": {"typeApplication": {"body": {"variable": "hydra.core.parsers.map"}, "type": {"literal": {"integer": "int32"}}}},
                                                            "type": "unit"}},
                                                        "argument": {"lambda": {"parameter": "_", "domain": {"literal": {"integer": "int32"}}, "body": "unit"}}}},
                                                    "argument": {
                                                      "application": {
                                                        "function": {"variable": "hydra.core.parsers.satisfy"},
                                                        "argument": {
                                                          "lambda": {
                                                            "parameter": "c",
                                                            "domain": {"literal": {"integer": "int32"}},
                                                            "body": {
                                                              "application": {
                                                                "function": {"variable": "hydra.core.lib.logic.not"},
                                                                "argument": {
                                                                  "application": {
                                                                    "function": {
                                                                      "application": {
                                                                        "function": {"typeApplication": {"body": {"variable": "hydra.core.lib.equality.equal"}, "type": {"literal": {"integer": "int32"}}}},
                                                                        "argument": {"variable": "c"}}},
                                                                    "argument": {"literal": {"integer": {"int32": 35}}}}}}}}}}}}}}}}},
                                        "argument": {
                                          "lambda": {
                                            "parameter": "_",
                                            "domain": "unit",
                                            "body": {
                                              "application": {
                                                "function": {
                                                  "application": {
                                                    "function": {
                                                      "typeApplication": {
                                                        "body": {
                                                          "typeApplication": {"body": {"variable": "hydra.core.parsers.map"}, "type": {"list": {"literal": {"integer": "int32"}}}}},
                                                        "type": "unit"}},
                                                    "argument": {"lambda": {"parameter": "_", "domain": {"list": {"literal": {"integer": "int32"}}}, "body": "unit"}}}},
                                                "argument": {
                                                  "application": {
                                                    "function": {"typeApplication": {"body": {"variable": "hydra.core.parsers.many"}, "type": {"literal": {"integer": "int32"}}}},
                                                    "argument": {
                                                      "application": {
                                                        "function": {"variable": "hydra.core.parsers.satisfy"},
                                                        "argument": {
                                                          "lambda": {
                                                            "parameter": "c",
                                                            "domain": {"literal": {"integer": "int32"}},
                                                            "body": {
                                                              "application": {
                                                                "function": {"variable": "hydra.core.lib.logic.not"},
                                                                "argument": {
                                                                  "application": {
                                                                    "function": {
                                                                      "application": {
                                                                        "function": {"typeApplication": {"body": {"variable": "hydra.core.lib.equality.equal"}, "type": {"literal": {"integer": "int32"}}}},
                                                                        "argument": {"variable": "c"}}},
                                                                    "argument": {"literal": {"integer": {"int32": 10}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}},
            "annotation": {
              "map": [
                {
                  "key": {"variable": "description"},
                  "value": {"literal": {"string": "Skip zero or more whitespace characters and ordinary (non-'##') '#' line comments"}}}]}}}}}]}