packages feed

hydra-kernel-0.18.1: hydra-kernel-json/hydra/core/encode/typing.json

{
  "name": "hydra.core.encode.typing",
  "metadata": {"description": "Term encoders for hydra.core.typing", "comments": [], "seeAlso": [], "provisions": []},
  "dependencies": [{"module": "hydra.core.encode.model"}, {"module": "hydra.core.encode.paths"}, {"module": "hydra.core.typing"}],
  "definitions": [
    {
      "term": {
        "name": "hydra.core.encode.typing.functionStructure",
        "signature": {
          "typeParameters": [{"name": "env", "constraints": []}],
          "parameters": [
            {
              "name": "arg0",
              "type": {"function": {"domain": {"variable": "env"}, "codomain": {"variable": "hydra.core.model.Term"}}},
              "isLazy": false},
            {
              "name": "arg1",
              "type": {"application": {"function": {"variable": "hydra.core.typing.FunctionStructure"}, "argument": {"variable": "env"}}},
              "isLazy": false}],
          "result": {"type": {"variable": "hydra.core.model.Term"}}},
        "body": {
          "annotated": {
            "body": {
              "lambda": {
                "parameter": "env",
                "domain": {"function": {"domain": {"variable": "env"}, "codomain": {"variable": "hydra.core.model.Term"}}},
                "body": {
                  "lambda": {
                    "parameter": "x",
                    "domain": {"variable": "hydra.core.typing.FunctionStructure"},
                    "body": {
                      "inject": {
                        "typeName": "hydra.core.model.Term",
                        "field": {
                          "name": "record",
                          "term": {
                            "record": {
                              "typeName": "hydra.core.model.Record",
                              "fields": [
                                {
                                  "name": "typeName",
                                  "term": {"wrap": {"typeName": "hydra.core.model.Name", "body": {"literal": {"string": "hydra.core.typing.FunctionStructure"}}}}},
                                {
                                  "name": "fields",
                                  "term": {
                                    "list": [
                                      {
                                        "record": {
                                          "typeName": "hydra.core.model.Field",
                                          "fields": [
                                            {"name": "name", "term": {"wrap": {"typeName": "hydra.core.model.Name", "body": {"literal": {"string": "typeParams"}}}}},
                                            {
                                              "name": "term",
                                              "term": {
                                                "application": {
                                                  "function": {
                                                    "lambda": {
                                                      "parameter": "xs",
                                                      "domain": {"list": {"variable": "hydra.core.model.Name"}},
                                                      "body": {
                                                        "inject": {
                                                          "typeName": "hydra.core.model.Term",
                                                          "field": {
                                                            "name": "list",
                                                            "term": {
                                                              "application": {
                                                                "function": {
                                                                  "application": {
                                                                    "function": {
                                                                      "typeApplication": {
                                                                        "body": {"typeApplication": {"body": {"variable": "hydra.core.lib.lists.map"}, "type": {"variable": "hydra.core.model.Name"}}},
                                                                        "type": {"variable": "hydra.core.model.Term"}}},
                                                                    "argument": {"variable": "hydra.core.encode.model.name"}}},
                                                                "argument": {"variable": "xs"}}}}}}}},
                                                  "argument": {
                                                    "application": {
                                                      "function": {"project": {"typeName": "hydra.core.typing.FunctionStructure", "fieldName": "typeParams"}},
                                                      "argument": {"variable": "x"}}}}}}]}},
                                      {
                                        "record": {
                                          "typeName": "hydra.core.model.Field",
                                          "fields": [
                                            {"name": "name", "term": {"wrap": {"typeName": "hydra.core.model.Name", "body": {"literal": {"string": "params"}}}}},
                                            {
                                              "name": "term",
                                              "term": {
                                                "application": {
                                                  "function": {
                                                    "lambda": {
                                                      "parameter": "xs",
                                                      "domain": {"list": {"variable": "hydra.core.model.Name"}},
                                                      "body": {
                                                        "inject": {
                                                          "typeName": "hydra.core.model.Term",
                                                          "field": {
                                                            "name": "list",
                                                            "term": {
                                                              "application": {
                                                                "function": {
                                                                  "application": {
                                                                    "function": {
                                                                      "typeApplication": {
                                                                        "body": {"typeApplication": {"body": {"variable": "hydra.core.lib.lists.map"}, "type": {"variable": "hydra.core.model.Name"}}},
                                                                        "type": {"variable": "hydra.core.model.Term"}}},
                                                                    "argument": {"variable": "hydra.core.encode.model.name"}}},
                                                                "argument": {"variable": "xs"}}}}}}}},
                                                  "argument": {
                                                    "application": {
                                                      "function": {"project": {"typeName": "hydra.core.typing.FunctionStructure", "fieldName": "params"}},
                                                      "argument": {"variable": "x"}}}}}}]}},
                                      {
                                        "record": {
                                          "typeName": "hydra.core.model.Field",
                                          "fields": [
                                            {"name": "name", "term": {"wrap": {"typeName": "hydra.core.model.Name", "body": {"literal": {"string": "bindings"}}}}},
                                            {
                                              "name": "term",
                                              "term": {
                                                "application": {
                                                  "function": {
                                                    "lambda": {
                                                      "parameter": "xs",
                                                      "domain": {"list": {"variable": "hydra.core.model.Binding"}},
                                                      "body": {
                                                        "inject": {
                                                          "typeName": "hydra.core.model.Term",
                                                          "field": {
                                                            "name": "list",
                                                            "term": {
                                                              "application": {
                                                                "function": {
                                                                  "application": {
                                                                    "function": {
                                                                      "typeApplication": {
                                                                        "body": {
                                                                          "typeApplication": {"body": {"variable": "hydra.core.lib.lists.map"}, "type": {"variable": "hydra.core.model.Binding"}}},
                                                                        "type": {"variable": "hydra.core.model.Term"}}},
                                                                    "argument": {"variable": "hydra.core.encode.model.binding"}}},
                                                                "argument": {"variable": "xs"}}}}}}}},
                                                  "argument": {
                                                    "application": {
                                                      "function": {"project": {"typeName": "hydra.core.typing.FunctionStructure", "fieldName": "bindings"}},
                                                      "argument": {"variable": "x"}}}}}}]}},
                                      {
                                        "record": {
                                          "typeName": "hydra.core.model.Field",
                                          "fields": [
                                            {"name": "name", "term": {"wrap": {"typeName": "hydra.core.model.Name", "body": {"literal": {"string": "body"}}}}},
                                            {
                                              "name": "term",
                                              "term": {
                                                "application": {
                                                  "function": {"variable": "hydra.core.encode.model.term"},
                                                  "argument": {
                                                    "application": {
                                                      "function": {"project": {"typeName": "hydra.core.typing.FunctionStructure", "fieldName": "body"}},
                                                      "argument": {"variable": "x"}}}}}}]}},
                                      {
                                        "record": {
                                          "typeName": "hydra.core.model.Field",
                                          "fields": [
                                            {"name": "name", "term": {"wrap": {"typeName": "hydra.core.model.Name", "body": {"literal": {"string": "domains"}}}}},
                                            {
                                              "name": "term",
                                              "term": {
                                                "application": {
                                                  "function": {
                                                    "lambda": {
                                                      "parameter": "xs",
                                                      "domain": {"list": {"variable": "hydra.core.model.Type"}},
                                                      "body": {
                                                        "inject": {
                                                          "typeName": "hydra.core.model.Term",
                                                          "field": {
                                                            "name": "list",
                                                            "term": {
                                                              "application": {
                                                                "function": {
                                                                  "application": {
                                                                    "function": {
                                                                      "typeApplication": {
                                                                        "body": {"typeApplication": {"body": {"variable": "hydra.core.lib.lists.map"}, "type": {"variable": "hydra.core.model.Type"}}},
                                                                        "type": {"variable": "hydra.core.model.Term"}}},
                                                                    "argument": {"variable": "hydra.core.encode.model.type"}}},
                                                                "argument": {"variable": "xs"}}}}}}}},
                                                  "argument": {
                                                    "application": {
                                                      "function": {"project": {"typeName": "hydra.core.typing.FunctionStructure", "fieldName": "domains"}},
                                                      "argument": {"variable": "x"}}}}}}]}},
                                      {
                                        "record": {
                                          "typeName": "hydra.core.model.Field",
                                          "fields": [
                                            {"name": "name", "term": {"wrap": {"typeName": "hydra.core.model.Name", "body": {"literal": {"string": "codomain"}}}}},
                                            {
                                              "name": "term",
                                              "term": {
                                                "application": {
                                                  "function": {
                                                    "lambda": {
                                                      "parameter": "opt",
                                                      "domain": {"optional": {"variable": "hydra.core.model.Type"}},
                                                      "body": {
                                                        "inject": {
                                                          "typeName": "hydra.core.model.Term",
                                                          "field": {
                                                            "name": "optional",
                                                            "term": {
                                                              "application": {
                                                                "function": {
                                                                  "application": {
                                                                    "function": {
                                                                      "typeApplication": {
                                                                        "body": {
                                                                          "typeApplication": {"body": {"variable": "hydra.core.lib.optionals.map"}, "type": {"variable": "hydra.core.model.Type"}}},
                                                                        "type": {"variable": "hydra.core.model.Term"}}},
                                                                    "argument": {"variable": "hydra.core.encode.model.type"}}},
                                                                "argument": {"variable": "opt"}}}}}}}},
                                                  "argument": {
                                                    "application": {
                                                      "function": {"project": {"typeName": "hydra.core.typing.FunctionStructure", "fieldName": "codomain"}},
                                                      "argument": {"variable": "x"}}}}}}]}},
                                      {
                                        "record": {
                                          "typeName": "hydra.core.model.Field",
                                          "fields": [
                                            {
                                              "name": "name",
                                              "term": {"wrap": {"typeName": "hydra.core.model.Name", "body": {"literal": {"string": "environment"}}}}},
                                            {
                                              "name": "term",
                                              "term": {
                                                "application": {
                                                  "function": {"variable": "env"},
                                                  "argument": {
                                                    "application": {
                                                      "function": {"project": {"typeName": "hydra.core.typing.FunctionStructure", "fieldName": "environment"}},
                                                      "argument": {"variable": "x"}}}}}}]}}]}}]}}}}}}}}},
            "annotation": {
              "map": [
                {
                  "key": {"variable": "description"},
                  "value": {"literal": {"string": "Encoder for hydra.core.typing.FunctionStructure"}}}]}}}}},
    {
      "term": {
        "name": "hydra.core.encode.typing.inferenceContext",
        "signature": {
          "typeParameters": [],
          "parameters": [{"name": "arg0", "type": {"variable": "hydra.core.typing.InferenceContext"}, "isLazy": false}],
          "result": {"type": {"variable": "hydra.core.model.Term"}}},
        "body": {
          "annotated": {
            "body": {
              "lambda": {
                "parameter": "x",
                "domain": {"variable": "hydra.core.typing.InferenceContext"},
                "body": {
                  "inject": {
                    "typeName": "hydra.core.model.Term",
                    "field": {
                      "name": "record",
                      "term": {
                        "record": {
                          "typeName": "hydra.core.model.Record",
                          "fields": [
                            {
                              "name": "typeName",
                              "term": {"wrap": {"typeName": "hydra.core.model.Name", "body": {"literal": {"string": "hydra.core.typing.InferenceContext"}}}}},
                            {
                              "name": "fields",
                              "term": {
                                "list": [
                                  {
                                    "record": {
                                      "typeName": "hydra.core.model.Field",
                                      "fields": [
                                        {
                                          "name": "name",
                                          "term": {"wrap": {"typeName": "hydra.core.model.Name", "body": {"literal": {"string": "freshTypeVariableCount"}}}}},
                                        {
                                          "name": "term",
                                          "term": {
                                            "application": {
                                              "function": {
                                                "lambda": {
                                                  "parameter": "x",
                                                  "domain": {"literal": {"integer": "int32"}},
                                                  "body": {
                                                    "inject": {
                                                      "typeName": "hydra.core.model.Term",
                                                      "field": {
                                                        "name": "literal",
                                                        "term": {
                                                          "inject": {
                                                            "typeName": "hydra.core.model.Literal",
                                                            "field": {
                                                              "name": "integer",
                                                              "term": {"inject": {"typeName": "hydra.core.model.IntegerValue", "field": {"name": "int32", "term": {"variable": "x"}}}}}}}}}}}},
                                              "argument": {
                                                "application": {
                                                  "function": {"project": {"typeName": "hydra.core.typing.InferenceContext", "fieldName": "freshTypeVariableCount"}},
                                                  "argument": {"variable": "x"}}}}}}]}},
                                  {
                                    "record": {
                                      "typeName": "hydra.core.model.Field",
                                      "fields": [
                                        {"name": "name", "term": {"wrap": {"typeName": "hydra.core.model.Name", "body": {"literal": {"string": "trace"}}}}},
                                        {
                                          "name": "term",
                                          "term": {
                                            "application": {
                                              "function": {
                                                "lambda": {
                                                  "parameter": "xs",
                                                  "domain": {"list": {"variable": "hydra.core.paths.SubtermStep"}},
                                                  "body": {
                                                    "inject": {
                                                      "typeName": "hydra.core.model.Term",
                                                      "field": {
                                                        "name": "list",
                                                        "term": {
                                                          "application": {
                                                            "function": {
                                                              "application": {
                                                                "function": {
                                                                  "typeApplication": {
                                                                    "body": {
                                                                      "typeApplication": {"body": {"variable": "hydra.core.lib.lists.map"}, "type": {"variable": "hydra.core.paths.SubtermStep"}}},
                                                                    "type": {"variable": "hydra.core.model.Term"}}},
                                                                "argument": {"variable": "hydra.core.encode.paths.subtermStep"}}},
                                                            "argument": {"variable": "xs"}}}}}}}},
                                              "argument": {
                                                "application": {
                                                  "function": {"project": {"typeName": "hydra.core.typing.InferenceContext", "fieldName": "trace"}},
                                                  "argument": {"variable": "x"}}}}}}]}}]}}]}}}}}}},
            "annotation": {
              "map": [
                {"key": {"variable": "description"}, "value": {"literal": {"string": "Encoder for hydra.core.typing.InferenceContext"}}}]}}}}},
    {
      "term": {
        "name": "hydra.core.encode.typing.inferenceResult",
        "signature": {
          "typeParameters": [],
          "parameters": [{"name": "arg0", "type": {"variable": "hydra.core.typing.InferenceResult"}, "isLazy": false}],
          "result": {"type": {"variable": "hydra.core.model.Term"}}},
        "body": {
          "annotated": {
            "body": {
              "lambda": {
                "parameter": "x",
                "domain": {"variable": "hydra.core.typing.InferenceResult"},
                "body": {
                  "inject": {
                    "typeName": "hydra.core.model.Term",
                    "field": {
                      "name": "record",
                      "term": {
                        "record": {
                          "typeName": "hydra.core.model.Record",
                          "fields": [
                            {
                              "name": "typeName",
                              "term": {"wrap": {"typeName": "hydra.core.model.Name", "body": {"literal": {"string": "hydra.core.typing.InferenceResult"}}}}},
                            {
                              "name": "fields",
                              "term": {
                                "list": [
                                  {
                                    "record": {
                                      "typeName": "hydra.core.model.Field",
                                      "fields": [
                                        {"name": "name", "term": {"wrap": {"typeName": "hydra.core.model.Name", "body": {"literal": {"string": "term"}}}}},
                                        {
                                          "name": "term",
                                          "term": {
                                            "application": {
                                              "function": {"variable": "hydra.core.encode.model.term"},
                                              "argument": {
                                                "application": {
                                                  "function": {"project": {"typeName": "hydra.core.typing.InferenceResult", "fieldName": "term"}},
                                                  "argument": {"variable": "x"}}}}}}]}},
                                  {
                                    "record": {
                                      "typeName": "hydra.core.model.Field",
                                      "fields": [
                                        {"name": "name", "term": {"wrap": {"typeName": "hydra.core.model.Name", "body": {"literal": {"string": "type"}}}}},
                                        {
                                          "name": "term",
                                          "term": {
                                            "application": {
                                              "function": {"variable": "hydra.core.encode.model.type"},
                                              "argument": {
                                                "application": {
                                                  "function": {"project": {"typeName": "hydra.core.typing.InferenceResult", "fieldName": "type"}},
                                                  "argument": {"variable": "x"}}}}}}]}},
                                  {
                                    "record": {
                                      "typeName": "hydra.core.model.Field",
                                      "fields": [
                                        {"name": "name", "term": {"wrap": {"typeName": "hydra.core.model.Name", "body": {"literal": {"string": "subst"}}}}},
                                        {
                                          "name": "term",
                                          "term": {
                                            "application": {
                                              "function": {"variable": "hydra.core.encode.typing.typeSubst"},
                                              "argument": {
                                                "application": {
                                                  "function": {"project": {"typeName": "hydra.core.typing.InferenceResult", "fieldName": "subst"}},
                                                  "argument": {"variable": "x"}}}}}}]}},
                                  {
                                    "record": {
                                      "typeName": "hydra.core.model.Field",
                                      "fields": [
                                        {
                                          "name": "name",
                                          "term": {"wrap": {"typeName": "hydra.core.model.Name", "body": {"literal": {"string": "classConstraints"}}}}},
                                        {
                                          "name": "term",
                                          "term": {
                                            "application": {
                                              "function": {
                                                "lambda": {
                                                  "parameter": "m",
                                                  "domain": {
                                                    "map": {"keys": {"variable": "hydra.core.model.Name"}, "values": {"variable": "hydra.core.model.TypeVariableConstraints"}}},
                                                  "body": {
                                                    "inject": {
                                                      "typeName": "hydra.core.model.Term",
                                                      "field": {
                                                        "name": "map",
                                                        "term": {
                                                          "application": {
                                                            "function": {
                                                              "application": {
                                                                "function": {
                                                                  "application": {
                                                                    "function": {
                                                                      "typeApplication": {
                                                                        "body": {
                                                                          "typeApplication": {
                                                                            "body": {
                                                                              "typeApplication": {
                                                                                "body": {"typeApplication": {"body": {"variable": "hydra.core.lib.maps.bimap"}, "type": {"variable": "hydra.core.model.Name"}}},
                                                                                "type": {"variable": "hydra.core.model.Term"}}},
                                                                            "type": {"variable": "hydra.core.model.TypeVariableConstraints"}}},
                                                                        "type": {"variable": "hydra.core.model.Term"}}},
                                                                    "argument": {"variable": "hydra.core.encode.model.name"}}},
                                                                "argument": {"variable": "hydra.core.encode.model.typeVariableConstraints"}}},
                                                            "argument": {"variable": "m"}}}}}}}},
                                              "argument": {
                                                "application": {
                                                  "function": {"project": {"typeName": "hydra.core.typing.InferenceResult", "fieldName": "classConstraints"}},
                                                  "argument": {"variable": "x"}}}}}}]}},
                                  {
                                    "record": {
                                      "typeName": "hydra.core.model.Field",
                                      "fields": [
                                        {"name": "name", "term": {"wrap": {"typeName": "hydra.core.model.Name", "body": {"literal": {"string": "context"}}}}},
                                        {
                                          "name": "term",
                                          "term": {
                                            "application": {
                                              "function": {"variable": "hydra.core.encode.typing.inferenceContext"},
                                              "argument": {
                                                "application": {
                                                  "function": {"project": {"typeName": "hydra.core.typing.InferenceResult", "fieldName": "context"}},
                                                  "argument": {"variable": "x"}}}}}}]}}]}}]}}}}}}},
            "annotation": {
              "map": [
                {"key": {"variable": "description"}, "value": {"literal": {"string": "Encoder for hydra.core.typing.InferenceResult"}}}]}}}}},
    {
      "term": {
        "name": "hydra.core.encode.typing.parameter",
        "signature": {
          "typeParameters": [],
          "parameters": [{"name": "arg0", "type": {"variable": "hydra.core.typing.Parameter"}, "isLazy": false}],
          "result": {"type": {"variable": "hydra.core.model.Term"}}},
        "body": {
          "annotated": {
            "body": {
              "lambda": {
                "parameter": "x",
                "domain": {"variable": "hydra.core.typing.Parameter"},
                "body": {
                  "inject": {
                    "typeName": "hydra.core.model.Term",
                    "field": {
                      "name": "record",
                      "term": {
                        "record": {
                          "typeName": "hydra.core.model.Record",
                          "fields": [
                            {
                              "name": "typeName",
                              "term": {"wrap": {"typeName": "hydra.core.model.Name", "body": {"literal": {"string": "hydra.core.typing.Parameter"}}}}},
                            {
                              "name": "fields",
                              "term": {
                                "list": [
                                  {
                                    "record": {
                                      "typeName": "hydra.core.model.Field",
                                      "fields": [
                                        {"name": "name", "term": {"wrap": {"typeName": "hydra.core.model.Name", "body": {"literal": {"string": "name"}}}}},
                                        {
                                          "name": "term",
                                          "term": {
                                            "application": {
                                              "function": {"variable": "hydra.core.encode.model.name"},
                                              "argument": {
                                                "application": {
                                                  "function": {"project": {"typeName": "hydra.core.typing.Parameter", "fieldName": "name"}},
                                                  "argument": {"variable": "x"}}}}}}]}},
                                  {
                                    "record": {
                                      "typeName": "hydra.core.model.Field",
                                      "fields": [
                                        {
                                          "name": "name",
                                          "term": {"wrap": {"typeName": "hydra.core.model.Name", "body": {"literal": {"string": "description"}}}}},
                                        {
                                          "name": "term",
                                          "term": {
                                            "application": {
                                              "function": {
                                                "lambda": {
                                                  "parameter": "opt",
                                                  "domain": {"optional": {"literal": "string"}},
                                                  "body": {
                                                    "inject": {
                                                      "typeName": "hydra.core.model.Term",
                                                      "field": {
                                                        "name": "optional",
                                                        "term": {
                                                          "application": {
                                                            "function": {
                                                              "application": {
                                                                "function": {
                                                                  "typeApplication": {
                                                                    "body": {"typeApplication": {"body": {"variable": "hydra.core.lib.optionals.map"}, "type": {"literal": "string"}}},
                                                                    "type": {"variable": "hydra.core.model.Term"}}},
                                                                "argument": {
                                                                  "lambda": {
                                                                    "parameter": "x",
                                                                    "domain": {"literal": "string"},
                                                                    "body": {
                                                                      "inject": {
                                                                        "typeName": "hydra.core.model.Term",
                                                                        "field": {
                                                                          "name": "literal",
                                                                          "term": {"inject": {"typeName": "hydra.core.model.Literal", "field": {"name": "string", "term": {"variable": "x"}}}}}}}}}}},
                                                            "argument": {"variable": "opt"}}}}}}}},
                                              "argument": {
                                                "application": {
                                                  "function": {"project": {"typeName": "hydra.core.typing.Parameter", "fieldName": "description"}},
                                                  "argument": {"variable": "x"}}}}}}]}},
                                  {
                                    "record": {
                                      "typeName": "hydra.core.model.Field",
                                      "fields": [
                                        {"name": "name", "term": {"wrap": {"typeName": "hydra.core.model.Name", "body": {"literal": {"string": "type"}}}}},
                                        {
                                          "name": "term",
                                          "term": {
                                            "application": {
                                              "function": {"variable": "hydra.core.encode.model.type"},
                                              "argument": {
                                                "application": {
                                                  "function": {"project": {"typeName": "hydra.core.typing.Parameter", "fieldName": "type"}},
                                                  "argument": {"variable": "x"}}}}}}]}},
                                  {
                                    "record": {
                                      "typeName": "hydra.core.model.Field",
                                      "fields": [
                                        {"name": "name", "term": {"wrap": {"typeName": "hydra.core.model.Name", "body": {"literal": {"string": "isLazy"}}}}},
                                        {
                                          "name": "term",
                                          "term": {
                                            "application": {
                                              "function": {
                                                "lambda": {
                                                  "parameter": "x",
                                                  "domain": {"literal": "boolean"},
                                                  "body": {
                                                    "inject": {
                                                      "typeName": "hydra.core.model.Term",
                                                      "field": {
                                                        "name": "literal",
                                                        "term": {"inject": {"typeName": "hydra.core.model.Literal", "field": {"name": "boolean", "term": {"variable": "x"}}}}}}}}},
                                              "argument": {
                                                "application": {
                                                  "function": {"project": {"typeName": "hydra.core.typing.Parameter", "fieldName": "isLazy"}},
                                                  "argument": {"variable": "x"}}}}}}]}}]}}]}}}}}}},
            "annotation": {
              "map": [{"key": {"variable": "description"}, "value": {"literal": {"string": "Encoder for hydra.core.typing.Parameter"}}}]}}}}},
    {
      "term": {
        "name": "hydra.core.encode.typing.result",
        "signature": {
          "typeParameters": [],
          "parameters": [{"name": "arg0", "type": {"variable": "hydra.core.typing.Result"}, "isLazy": false}],
          "result": {"type": {"variable": "hydra.core.model.Term"}}},
        "body": {
          "annotated": {
            "body": {
              "lambda": {
                "parameter": "x",
                "domain": {"variable": "hydra.core.typing.Result"},
                "body": {
                  "inject": {
                    "typeName": "hydra.core.model.Term",
                    "field": {
                      "name": "record",
                      "term": {
                        "record": {
                          "typeName": "hydra.core.model.Record",
                          "fields": [
                            {
                              "name": "typeName",
                              "term": {"wrap": {"typeName": "hydra.core.model.Name", "body": {"literal": {"string": "hydra.core.typing.Result"}}}}},
                            {
                              "name": "fields",
                              "term": {
                                "list": [
                                  {
                                    "record": {
                                      "typeName": "hydra.core.model.Field",
                                      "fields": [
                                        {
                                          "name": "name",
                                          "term": {"wrap": {"typeName": "hydra.core.model.Name", "body": {"literal": {"string": "description"}}}}},
                                        {
                                          "name": "term",
                                          "term": {
                                            "application": {
                                              "function": {
                                                "lambda": {
                                                  "parameter": "opt",
                                                  "domain": {"optional": {"literal": "string"}},
                                                  "body": {
                                                    "inject": {
                                                      "typeName": "hydra.core.model.Term",
                                                      "field": {
                                                        "name": "optional",
                                                        "term": {
                                                          "application": {
                                                            "function": {
                                                              "application": {
                                                                "function": {
                                                                  "typeApplication": {
                                                                    "body": {"typeApplication": {"body": {"variable": "hydra.core.lib.optionals.map"}, "type": {"literal": "string"}}},
                                                                    "type": {"variable": "hydra.core.model.Term"}}},
                                                                "argument": {
                                                                  "lambda": {
                                                                    "parameter": "x",
                                                                    "domain": {"literal": "string"},
                                                                    "body": {
                                                                      "inject": {
                                                                        "typeName": "hydra.core.model.Term",
                                                                        "field": {
                                                                          "name": "literal",
                                                                          "term": {"inject": {"typeName": "hydra.core.model.Literal", "field": {"name": "string", "term": {"variable": "x"}}}}}}}}}}},
                                                            "argument": {"variable": "opt"}}}}}}}},
                                              "argument": {
                                                "application": {
                                                  "function": {"project": {"typeName": "hydra.core.typing.Result", "fieldName": "description"}},
                                                  "argument": {"variable": "x"}}}}}}]}},
                                  {
                                    "record": {
                                      "typeName": "hydra.core.model.Field",
                                      "fields": [
                                        {"name": "name", "term": {"wrap": {"typeName": "hydra.core.model.Name", "body": {"literal": {"string": "type"}}}}},
                                        {
                                          "name": "term",
                                          "term": {
                                            "application": {
                                              "function": {"variable": "hydra.core.encode.model.type"},
                                              "argument": {
                                                "application": {"function": {"project": {"typeName": "hydra.core.typing.Result", "fieldName": "type"}}, "argument": {"variable": "x"}}}}}}]}}]}}]}}}}}}},
            "annotation": {
              "map": [{"key": {"variable": "description"}, "value": {"literal": {"string": "Encoder for hydra.core.typing.Result"}}}]}}}}},
    {
      "term": {
        "name": "hydra.core.encode.typing.termSignature",
        "signature": {
          "typeParameters": [],
          "parameters": [{"name": "arg0", "type": {"variable": "hydra.core.typing.TermSignature"}, "isLazy": false}],
          "result": {"type": {"variable": "hydra.core.model.Term"}}},
        "body": {
          "annotated": {
            "body": {
              "lambda": {
                "parameter": "x",
                "domain": {"variable": "hydra.core.typing.TermSignature"},
                "body": {
                  "inject": {
                    "typeName": "hydra.core.model.Term",
                    "field": {
                      "name": "record",
                      "term": {
                        "record": {
                          "typeName": "hydra.core.model.Record",
                          "fields": [
                            {
                              "name": "typeName",
                              "term": {"wrap": {"typeName": "hydra.core.model.Name", "body": {"literal": {"string": "hydra.core.typing.TermSignature"}}}}},
                            {
                              "name": "fields",
                              "term": {
                                "list": [
                                  {
                                    "record": {
                                      "typeName": "hydra.core.model.Field",
                                      "fields": [
                                        {
                                          "name": "name",
                                          "term": {"wrap": {"typeName": "hydra.core.model.Name", "body": {"literal": {"string": "typeParameters"}}}}},
                                        {
                                          "name": "term",
                                          "term": {
                                            "application": {
                                              "function": {
                                                "lambda": {
                                                  "parameter": "xs",
                                                  "domain": {"list": {"variable": "hydra.core.typing.TypeParameter"}},
                                                  "body": {
                                                    "inject": {
                                                      "typeName": "hydra.core.model.Term",
                                                      "field": {
                                                        "name": "list",
                                                        "term": {
                                                          "application": {
                                                            "function": {
                                                              "application": {
                                                                "function": {
                                                                  "typeApplication": {
                                                                    "body": {
                                                                      "typeApplication": {"body": {"variable": "hydra.core.lib.lists.map"}, "type": {"variable": "hydra.core.typing.TypeParameter"}}},
                                                                    "type": {"variable": "hydra.core.model.Term"}}},
                                                                "argument": {"variable": "hydra.core.encode.typing.typeParameter"}}},
                                                            "argument": {"variable": "xs"}}}}}}}},
                                              "argument": {
                                                "application": {
                                                  "function": {"project": {"typeName": "hydra.core.typing.TermSignature", "fieldName": "typeParameters"}},
                                                  "argument": {"variable": "x"}}}}}}]}},
                                  {
                                    "record": {
                                      "typeName": "hydra.core.model.Field",
                                      "fields": [
                                        {"name": "name", "term": {"wrap": {"typeName": "hydra.core.model.Name", "body": {"literal": {"string": "parameters"}}}}},
                                        {
                                          "name": "term",
                                          "term": {
                                            "application": {
                                              "function": {
                                                "lambda": {
                                                  "parameter": "xs",
                                                  "domain": {"list": {"variable": "hydra.core.typing.Parameter"}},
                                                  "body": {
                                                    "inject": {
                                                      "typeName": "hydra.core.model.Term",
                                                      "field": {
                                                        "name": "list",
                                                        "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.model.Term"}}},
                                                                "argument": {"variable": "hydra.core.encode.typing.parameter"}}},
                                                            "argument": {"variable": "xs"}}}}}}}},
                                              "argument": {
                                                "application": {
                                                  "function": {"project": {"typeName": "hydra.core.typing.TermSignature", "fieldName": "parameters"}},
                                                  "argument": {"variable": "x"}}}}}}]}},
                                  {
                                    "record": {
                                      "typeName": "hydra.core.model.Field",
                                      "fields": [
                                        {"name": "name", "term": {"wrap": {"typeName": "hydra.core.model.Name", "body": {"literal": {"string": "result"}}}}},
                                        {
                                          "name": "term",
                                          "term": {
                                            "application": {
                                              "function": {"variable": "hydra.core.encode.typing.result"},
                                              "argument": {
                                                "application": {
                                                  "function": {"project": {"typeName": "hydra.core.typing.TermSignature", "fieldName": "result"}},
                                                  "argument": {"variable": "x"}}}}}}]}}]}}]}}}}}}},
            "annotation": {
              "map": [{"key": {"variable": "description"}, "value": {"literal": {"string": "Encoder for hydra.core.typing.TermSignature"}}}]}}}}},
    {
      "term": {
        "name": "hydra.core.encode.typing.termSubst",
        "signature": {
          "typeParameters": [],
          "parameters": [{"name": "arg0", "type": {"variable": "hydra.core.typing.TermSubst"}, "isLazy": false}],
          "result": {"type": {"variable": "hydra.core.model.Term"}}},
        "body": {
          "annotated": {
            "body": {
              "lambda": {
                "parameter": "x",
                "domain": {"variable": "hydra.core.typing.TermSubst"},
                "body": {
                  "inject": {
                    "typeName": "hydra.core.model.Term",
                    "field": {
                      "name": "wrap",
                      "term": {
                        "record": {
                          "typeName": "hydra.core.model.WrappedTerm",
                          "fields": [
                            {
                              "name": "typeName",
                              "term": {"wrap": {"typeName": "hydra.core.model.Name", "body": {"literal": {"string": "hydra.core.typing.TermSubst"}}}}},
                            {
                              "name": "body",
                              "term": {
                                "application": {
                                  "function": {
                                    "lambda": {
                                      "parameter": "m",
                                      "domain": {"map": {"keys": {"variable": "hydra.core.model.Name"}, "values": {"variable": "hydra.core.model.Term"}}},
                                      "body": {
                                        "inject": {
                                          "typeName": "hydra.core.model.Term",
                                          "field": {
                                            "name": "map",
                                            "term": {
                                              "application": {
                                                "function": {
                                                  "application": {
                                                    "function": {
                                                      "application": {
                                                        "function": {
                                                          "typeApplication": {
                                                            "body": {
                                                              "typeApplication": {
                                                                "body": {
                                                                  "typeApplication": {
                                                                    "body": {"typeApplication": {"body": {"variable": "hydra.core.lib.maps.bimap"}, "type": {"variable": "hydra.core.model.Name"}}},
                                                                    "type": {"variable": "hydra.core.model.Term"}}},
                                                                "type": {"variable": "hydra.core.model.Term"}}},
                                                            "type": {"variable": "hydra.core.model.Term"}}},
                                                        "argument": {"variable": "hydra.core.encode.model.name"}}},
                                                    "argument": {"variable": "hydra.core.encode.model.term"}}},
                                                "argument": {"variable": "m"}}}}}}}},
                                  "argument": {"application": {"function": {"unwrap": "hydra.core.typing.TermSubst"}, "argument": {"variable": "x"}}}}}}]}}}}}}},
            "annotation": {
              "map": [{"key": {"variable": "description"}, "value": {"literal": {"string": "Encoder for hydra.core.typing.TermSubst"}}}]}}}}},
    {
      "term": {
        "name": "hydra.core.encode.typing.typeClass",
        "signature": {
          "typeParameters": [],
          "parameters": [{"name": "arg0", "type": {"variable": "hydra.core.typing.TypeClass"}, "isLazy": false}],
          "result": {"type": {"variable": "hydra.core.model.Term"}}},
        "body": {
          "annotated": {
            "body": {
              "lambda": {
                "parameter": "x",
                "domain": {"variable": "hydra.core.typing.TypeClass"},
                "body": {
                  "inject": {
                    "typeName": "hydra.core.model.Term",
                    "field": {
                      "name": "record",
                      "term": {
                        "record": {
                          "typeName": "hydra.core.model.Record",
                          "fields": [
                            {
                              "name": "typeName",
                              "term": {"wrap": {"typeName": "hydra.core.model.Name", "body": {"literal": {"string": "hydra.core.typing.TypeClass"}}}}},
                            {
                              "name": "fields",
                              "term": {
                                "list": [
                                  {
                                    "record": {
                                      "typeName": "hydra.core.model.Field",
                                      "fields": [
                                        {
                                          "name": "name",
                                          "term": {"wrap": {"typeName": "hydra.core.model.Name", "body": {"literal": {"string": "description"}}}}},
                                        {
                                          "name": "term",
                                          "term": {
                                            "application": {
                                              "function": {
                                                "lambda": {
                                                  "parameter": "x",
                                                  "domain": {"literal": "string"},
                                                  "body": {
                                                    "inject": {
                                                      "typeName": "hydra.core.model.Term",
                                                      "field": {
                                                        "name": "literal",
                                                        "term": {"inject": {"typeName": "hydra.core.model.Literal", "field": {"name": "string", "term": {"variable": "x"}}}}}}}}},
                                              "argument": {
                                                "application": {
                                                  "function": {"project": {"typeName": "hydra.core.typing.TypeClass", "fieldName": "description"}},
                                                  "argument": {"variable": "x"}}}}}}]}}]}}]}}}}}}},
            "annotation": {
              "map": [{"key": {"variable": "description"}, "value": {"literal": {"string": "Encoder for hydra.core.typing.TypeClass"}}}]}}}}},
    {
      "term": {
        "name": "hydra.core.encode.typing.typeConstraint",
        "signature": {
          "typeParameters": [],
          "parameters": [{"name": "arg0", "type": {"variable": "hydra.core.typing.TypeConstraint"}, "isLazy": false}],
          "result": {"type": {"variable": "hydra.core.model.Term"}}},
        "body": {
          "annotated": {
            "body": {
              "lambda": {
                "parameter": "x",
                "domain": {"variable": "hydra.core.typing.TypeConstraint"},
                "body": {
                  "inject": {
                    "typeName": "hydra.core.model.Term",
                    "field": {
                      "name": "record",
                      "term": {
                        "record": {
                          "typeName": "hydra.core.model.Record",
                          "fields": [
                            {
                              "name": "typeName",
                              "term": {"wrap": {"typeName": "hydra.core.model.Name", "body": {"literal": {"string": "hydra.core.typing.TypeConstraint"}}}}},
                            {
                              "name": "fields",
                              "term": {
                                "list": [
                                  {
                                    "record": {
                                      "typeName": "hydra.core.model.Field",
                                      "fields": [
                                        {"name": "name", "term": {"wrap": {"typeName": "hydra.core.model.Name", "body": {"literal": {"string": "left"}}}}},
                                        {
                                          "name": "term",
                                          "term": {
                                            "application": {
                                              "function": {"variable": "hydra.core.encode.model.type"},
                                              "argument": {
                                                "application": {
                                                  "function": {"project": {"typeName": "hydra.core.typing.TypeConstraint", "fieldName": "left"}},
                                                  "argument": {"variable": "x"}}}}}}]}},
                                  {
                                    "record": {
                                      "typeName": "hydra.core.model.Field",
                                      "fields": [
                                        {"name": "name", "term": {"wrap": {"typeName": "hydra.core.model.Name", "body": {"literal": {"string": "right"}}}}},
                                        {
                                          "name": "term",
                                          "term": {
                                            "application": {
                                              "function": {"variable": "hydra.core.encode.model.type"},
                                              "argument": {
                                                "application": {
                                                  "function": {"project": {"typeName": "hydra.core.typing.TypeConstraint", "fieldName": "right"}},
                                                  "argument": {"variable": "x"}}}}}}]}},
                                  {
                                    "record": {
                                      "typeName": "hydra.core.model.Field",
                                      "fields": [
                                        {"name": "name", "term": {"wrap": {"typeName": "hydra.core.model.Name", "body": {"literal": {"string": "comment"}}}}},
                                        {
                                          "name": "term",
                                          "term": {
                                            "application": {
                                              "function": {
                                                "lambda": {
                                                  "parameter": "x",
                                                  "domain": {"literal": "string"},
                                                  "body": {
                                                    "inject": {
                                                      "typeName": "hydra.core.model.Term",
                                                      "field": {
                                                        "name": "literal",
                                                        "term": {"inject": {"typeName": "hydra.core.model.Literal", "field": {"name": "string", "term": {"variable": "x"}}}}}}}}},
                                              "argument": {
                                                "application": {
                                                  "function": {"project": {"typeName": "hydra.core.typing.TypeConstraint", "fieldName": "comment"}},
                                                  "argument": {"variable": "x"}}}}}}]}}]}}]}}}}}}},
            "annotation": {
              "map": [{"key": {"variable": "description"}, "value": {"literal": {"string": "Encoder for hydra.core.typing.TypeConstraint"}}}]}}}}},
    {
      "term": {
        "name": "hydra.core.encode.typing.typeParameter",
        "signature": {
          "typeParameters": [],
          "parameters": [{"name": "arg0", "type": {"variable": "hydra.core.typing.TypeParameter"}, "isLazy": false}],
          "result": {"type": {"variable": "hydra.core.model.Term"}}},
        "body": {
          "annotated": {
            "body": {
              "lambda": {
                "parameter": "x",
                "domain": {"variable": "hydra.core.typing.TypeParameter"},
                "body": {
                  "inject": {
                    "typeName": "hydra.core.model.Term",
                    "field": {
                      "name": "record",
                      "term": {
                        "record": {
                          "typeName": "hydra.core.model.Record",
                          "fields": [
                            {
                              "name": "typeName",
                              "term": {"wrap": {"typeName": "hydra.core.model.Name", "body": {"literal": {"string": "hydra.core.typing.TypeParameter"}}}}},
                            {
                              "name": "fields",
                              "term": {
                                "list": [
                                  {
                                    "record": {
                                      "typeName": "hydra.core.model.Field",
                                      "fields": [
                                        {"name": "name", "term": {"wrap": {"typeName": "hydra.core.model.Name", "body": {"literal": {"string": "name"}}}}},
                                        {
                                          "name": "term",
                                          "term": {
                                            "application": {
                                              "function": {"variable": "hydra.core.encode.model.name"},
                                              "argument": {
                                                "application": {
                                                  "function": {"project": {"typeName": "hydra.core.typing.TypeParameter", "fieldName": "name"}},
                                                  "argument": {"variable": "x"}}}}}}]}},
                                  {
                                    "record": {
                                      "typeName": "hydra.core.model.Field",
                                      "fields": [
                                        {
                                          "name": "name",
                                          "term": {"wrap": {"typeName": "hydra.core.model.Name", "body": {"literal": {"string": "constraints"}}}}},
                                        {
                                          "name": "term",
                                          "term": {
                                            "application": {
                                              "function": {
                                                "lambda": {
                                                  "parameter": "xs",
                                                  "domain": {"list": {"variable": "hydra.core.model.TypeClassConstraint"}},
                                                  "body": {
                                                    "inject": {
                                                      "typeName": "hydra.core.model.Term",
                                                      "field": {
                                                        "name": "list",
                                                        "term": {
                                                          "application": {
                                                            "function": {
                                                              "application": {
                                                                "function": {
                                                                  "typeApplication": {
                                                                    "body": {
                                                                      "typeApplication": {"body": {"variable": "hydra.core.lib.lists.map"}, "type": {"variable": "hydra.core.model.TypeClassConstraint"}}},
                                                                    "type": {"variable": "hydra.core.model.Term"}}},
                                                                "argument": {"variable": "hydra.core.encode.model.typeClassConstraint"}}},
                                                            "argument": {"variable": "xs"}}}}}}}},
                                              "argument": {
                                                "application": {
                                                  "function": {"project": {"typeName": "hydra.core.typing.TypeParameter", "fieldName": "constraints"}},
                                                  "argument": {"variable": "x"}}}}}}]}}]}}]}}}}}}},
            "annotation": {
              "map": [{"key": {"variable": "description"}, "value": {"literal": {"string": "Encoder for hydra.core.typing.TypeParameter"}}}]}}}}},
    {
      "term": {
        "name": "hydra.core.encode.typing.typeSubst",
        "signature": {
          "typeParameters": [],
          "parameters": [{"name": "arg0", "type": {"variable": "hydra.core.typing.TypeSubst"}, "isLazy": false}],
          "result": {"type": {"variable": "hydra.core.model.Term"}}},
        "body": {
          "annotated": {
            "body": {
              "lambda": {
                "parameter": "x",
                "domain": {"variable": "hydra.core.typing.TypeSubst"},
                "body": {
                  "inject": {
                    "typeName": "hydra.core.model.Term",
                    "field": {
                      "name": "wrap",
                      "term": {
                        "record": {
                          "typeName": "hydra.core.model.WrappedTerm",
                          "fields": [
                            {
                              "name": "typeName",
                              "term": {"wrap": {"typeName": "hydra.core.model.Name", "body": {"literal": {"string": "hydra.core.typing.TypeSubst"}}}}},
                            {
                              "name": "body",
                              "term": {
                                "application": {
                                  "function": {
                                    "lambda": {
                                      "parameter": "m",
                                      "domain": {"map": {"keys": {"variable": "hydra.core.model.Name"}, "values": {"variable": "hydra.core.model.Type"}}},
                                      "body": {
                                        "inject": {
                                          "typeName": "hydra.core.model.Term",
                                          "field": {
                                            "name": "map",
                                            "term": {
                                              "application": {
                                                "function": {
                                                  "application": {
                                                    "function": {
                                                      "application": {
                                                        "function": {
                                                          "typeApplication": {
                                                            "body": {
                                                              "typeApplication": {
                                                                "body": {
                                                                  "typeApplication": {
                                                                    "body": {"typeApplication": {"body": {"variable": "hydra.core.lib.maps.bimap"}, "type": {"variable": "hydra.core.model.Name"}}},
                                                                    "type": {"variable": "hydra.core.model.Term"}}},
                                                                "type": {"variable": "hydra.core.model.Type"}}},
                                                            "type": {"variable": "hydra.core.model.Term"}}},
                                                        "argument": {"variable": "hydra.core.encode.model.name"}}},
                                                    "argument": {"variable": "hydra.core.encode.model.type"}}},
                                                "argument": {"variable": "m"}}}}}}}},
                                  "argument": {"application": {"function": {"unwrap": "hydra.core.typing.TypeSubst"}, "argument": {"variable": "x"}}}}}}]}}}}}}},
            "annotation": {
              "map": [{"key": {"variable": "description"}, "value": {"literal": {"string": "Encoder for hydra.core.typing.TypeSubst"}}}]}}}}}]}