packages feed

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

{
  "name": "hydra.core.extract.model",
  "metadata": {"description": "Extraction and validation for hydra.core.model types", "comments": [], "seeAlso": [], "provisions": []},
  "dependencies": [
    {"module": "hydra.core.errors"},
    {"module": "hydra.core.lexical"},
    {"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.optionals"},
    {"module": "hydra.core.lib.pairs"},
    {"module": "hydra.core.lib.sets"},
    {"module": "hydra.core.lib.strings"},
    {"module": "hydra.core.model"},
    {"module": "hydra.core.print.errors"},
    {"module": "hydra.core.print.model"},
    {"module": "hydra.core.strip"}],
  "definitions": [
    {
      "term": {
        "name": "hydra.core.extract.model.bigint",
        "signature": {
          "typeParameters": [],
          "parameters": [
            {"name": "arg0", "type": {"variable": "hydra.core.graph.Graph"}, "isLazy": false},
            {"name": "arg1", "type": {"variable": "hydra.core.model.Term"}, "isLazy": false}],
          "result": {"type": {"either": {"left": {"variable": "hydra.core.errors.Error"}, "right": {"literal": {"integer": "bigint"}}}}}},
        "body": {
          "annotated": {
            "body": {
              "lambda": {
                "parameter": "graph",
                "domain": {"variable": "hydra.core.graph.Graph"},
                "body": {
                  "lambda": {
                    "parameter": "t",
                    "domain": {"variable": "hydra.core.model.Term"},
                    "body": {
                      "application": {
                        "function": {
                          "application": {
                            "function": {
                              "typeApplication": {
                                "body": {
                                  "typeApplication": {
                                    "body": {
                                      "typeApplication": {"body": {"variable": "hydra.core.lib.eithers.bind"}, "type": {"variable": "hydra.core.errors.Error"}}},
                                    "type": {"variable": "hydra.core.model.Literal"}}},
                                "type": {"literal": {"integer": "bigint"}}}},
                            "argument": {
                              "application": {
                                "function": {"application": {"function": {"variable": "hydra.core.extract.model.literal"}, "argument": {"variable": "graph"}}},
                                "argument": {"variable": "t"}}}}},
                        "argument": {
                          "lambda": {
                            "parameter": "l",
                            "domain": {"variable": "hydra.core.model.Literal"},
                            "body": {
                              "application": {
                                "function": {
                                  "application": {
                                    "function": {
                                      "typeApplication": {
                                        "body": {
                                          "typeApplication": {
                                            "body": {
                                              "typeApplication": {"body": {"variable": "hydra.core.lib.eithers.bind"}, "type": {"variable": "hydra.core.errors.Error"}}},
                                            "type": {"variable": "hydra.core.model.IntegerValue"}}},
                                        "type": {"literal": {"integer": "bigint"}}}},
                                    "argument": {"application": {"function": {"variable": "hydra.core.extract.model.integerLiteral"}, "argument": {"variable": "l"}}}}},
                                "argument": {
                                  "lambda": {
                                    "parameter": "i",
                                    "domain": {"variable": "hydra.core.model.IntegerValue"},
                                    "body": {"application": {"function": {"variable": "hydra.core.extract.model.bigintValue"}, "argument": {"variable": "i"}}}}}}}}}}}}}}},
            "annotation": {
              "map": [
                {
                  "key": {"variable": "description"},
                  "value": {"literal": {"string": "Extract an arbitrary-precision integer value from a term"}}}]}}}}},
    {
      "term": {
        "name": "hydra.core.extract.model.bigintValue",
        "signature": {
          "typeParameters": [],
          "parameters": [{"name": "arg0", "type": {"variable": "hydra.core.model.IntegerValue"}, "isLazy": false}],
          "result": {"type": {"either": {"left": {"variable": "hydra.core.errors.Error"}, "right": {"literal": {"integer": "bigint"}}}}}},
        "body": {
          "annotated": {
            "body": {
              "lambda": {
                "parameter": "v",
                "domain": {"variable": "hydra.core.model.IntegerValue"},
                "body": {
                  "application": {
                    "function": {
                      "cases": {
                        "typeName": "hydra.core.model.IntegerValue",
                        "default": {
                          "typeApplication": {
                            "body": {
                              "typeApplication": {
                                "body": {
                                  "either": {
                                    "left": {
                                      "inject": {
                                        "typeName": "hydra.core.errors.Error",
                                        "field": {
                                          "name": "extraction",
                                          "term": {
                                            "inject": {
                                              "typeName": "hydra.core.errors.ExtractionError",
                                              "field": {
                                                "name": "unexpectedShape",
                                                "term": {
                                                  "record": {
                                                    "typeName": "hydra.core.errors.UnexpectedShapeError",
                                                    "fields": [
                                                      {"name": "expected", "term": {"literal": {"string": "bigint"}}},
                                                      {
                                                        "name": "actual",
                                                        "term": {"application": {"function": {"variable": "hydra.core.print.model.integer"}, "argument": {"variable": "v"}}}}]}}}}}}}}}},
                                "type": {"variable": "hydra.core.errors.Error"}}},
                            "type": {"literal": {"integer": "bigint"}}}},
                        "cases": [
                          {
                            "name": "bigint",
                            "handler": {
                              "lambda": {
                                "parameter": "i",
                                "domain": {"literal": {"integer": "bigint"}},
                                "body": {
                                  "typeApplication": {
                                    "body": {"typeApplication": {"body": {"either": {"right": {"variable": "i"}}}, "type": {"variable": "hydra.core.errors.Error"}}},
                                    "type": {"literal": {"integer": "bigint"}}}}}}}]}},
                    "argument": {"variable": "v"}}}}},
            "annotation": {
              "map": [{"key": {"variable": "description"}, "value": {"literal": {"string": "Extract a bigint value from an IntegerValue"}}}]}}}}},
    {
      "term": {
        "name": "hydra.core.extract.model.binary",
        "signature": {
          "typeParameters": [],
          "parameters": [
            {"name": "arg0", "type": {"variable": "hydra.core.graph.Graph"}, "isLazy": false},
            {"name": "arg1", "type": {"variable": "hydra.core.model.Term"}, "isLazy": false}],
          "result": {"type": {"either": {"left": {"variable": "hydra.core.errors.Error"}, "right": {"literal": "binary"}}}}},
        "body": {
          "annotated": {
            "body": {
              "lambda": {
                "parameter": "graph",
                "domain": {"variable": "hydra.core.graph.Graph"},
                "body": {
                  "lambda": {
                    "parameter": "t",
                    "domain": {"variable": "hydra.core.model.Term"},
                    "body": {
                      "application": {
                        "function": {
                          "application": {
                            "function": {
                              "typeApplication": {
                                "body": {
                                  "typeApplication": {
                                    "body": {
                                      "typeApplication": {"body": {"variable": "hydra.core.lib.eithers.bind"}, "type": {"variable": "hydra.core.errors.Error"}}},
                                    "type": {"variable": "hydra.core.model.Literal"}}},
                                "type": {"literal": "binary"}}},
                            "argument": {
                              "application": {
                                "function": {"application": {"function": {"variable": "hydra.core.extract.model.literal"}, "argument": {"variable": "graph"}}},
                                "argument": {"variable": "t"}}}}},
                        "argument": {
                          "lambda": {
                            "parameter": "l",
                            "domain": {"variable": "hydra.core.model.Literal"},
                            "body": {"application": {"function": {"variable": "hydra.core.extract.model.binaryLiteral"}, "argument": {"variable": "l"}}}}}}}}}}},
            "annotation": {
              "map": [{"key": {"variable": "description"}, "value": {"literal": {"string": "Extract a binary data value from a term"}}}]}}}}},
    {
      "term": {
        "name": "hydra.core.extract.model.binaryLiteral",
        "signature": {
          "typeParameters": [],
          "parameters": [{"name": "arg0", "type": {"variable": "hydra.core.model.Literal"}, "isLazy": false}],
          "result": {"type": {"either": {"left": {"variable": "hydra.core.errors.Error"}, "right": {"literal": "binary"}}}}},
        "body": {
          "annotated": {
            "body": {
              "lambda": {
                "parameter": "v",
                "domain": {"variable": "hydra.core.model.Literal"},
                "body": {
                  "application": {
                    "function": {
                      "cases": {
                        "typeName": "hydra.core.model.Literal",
                        "default": {
                          "typeApplication": {
                            "body": {
                              "typeApplication": {
                                "body": {
                                  "either": {
                                    "left": {
                                      "inject": {
                                        "typeName": "hydra.core.errors.Error",
                                        "field": {
                                          "name": "extraction",
                                          "term": {
                                            "inject": {
                                              "typeName": "hydra.core.errors.ExtractionError",
                                              "field": {
                                                "name": "unexpectedShape",
                                                "term": {
                                                  "record": {
                                                    "typeName": "hydra.core.errors.UnexpectedShapeError",
                                                    "fields": [
                                                      {"name": "expected", "term": {"literal": {"string": "binary"}}},
                                                      {
                                                        "name": "actual",
                                                        "term": {"application": {"function": {"variable": "hydra.core.print.model.literal"}, "argument": {"variable": "v"}}}}]}}}}}}}}}},
                                "type": {"variable": "hydra.core.errors.Error"}}},
                            "type": {"literal": "binary"}}},
                        "cases": [
                          {
                            "name": "binary",
                            "handler": {
                              "lambda": {
                                "parameter": "b",
                                "domain": {"literal": "binary"},
                                "body": {
                                  "typeApplication": {
                                    "body": {"typeApplication": {"body": {"either": {"right": {"variable": "b"}}}, "type": {"variable": "hydra.core.errors.Error"}}},
                                    "type": {"literal": "binary"}}}}}}]}},
                    "argument": {"variable": "v"}}}}},
            "annotation": {
              "map": [
                {"key": {"variable": "description"}, "value": {"literal": {"string": "Extract a binary literal from a Literal value"}}}]}}}}},
    {
      "term": {
        "name": "hydra.core.extract.model.boolean",
        "signature": {
          "typeParameters": [],
          "parameters": [
            {"name": "arg0", "type": {"variable": "hydra.core.graph.Graph"}, "isLazy": false},
            {"name": "arg1", "type": {"variable": "hydra.core.model.Term"}, "isLazy": false}],
          "result": {"type": {"either": {"left": {"variable": "hydra.core.errors.Error"}, "right": {"literal": "boolean"}}}}},
        "body": {
          "annotated": {
            "body": {
              "lambda": {
                "parameter": "graph",
                "domain": {"variable": "hydra.core.graph.Graph"},
                "body": {
                  "lambda": {
                    "parameter": "t",
                    "domain": {"variable": "hydra.core.model.Term"},
                    "body": {
                      "application": {
                        "function": {
                          "application": {
                            "function": {
                              "typeApplication": {
                                "body": {
                                  "typeApplication": {
                                    "body": {
                                      "typeApplication": {"body": {"variable": "hydra.core.lib.eithers.bind"}, "type": {"variable": "hydra.core.errors.Error"}}},
                                    "type": {"variable": "hydra.core.model.Literal"}}},
                                "type": {"literal": "boolean"}}},
                            "argument": {
                              "application": {
                                "function": {"application": {"function": {"variable": "hydra.core.extract.model.literal"}, "argument": {"variable": "graph"}}},
                                "argument": {"variable": "t"}}}}},
                        "argument": {
                          "lambda": {
                            "parameter": "l",
                            "domain": {"variable": "hydra.core.model.Literal"},
                            "body": {"application": {"function": {"variable": "hydra.core.extract.model.booleanLiteral"}, "argument": {"variable": "l"}}}}}}}}}}},
            "annotation": {"map": [{"key": {"variable": "description"}, "value": {"literal": {"string": "Extract a boolean value from a term"}}}]}}}}},
    {
      "term": {
        "name": "hydra.core.extract.model.booleanLiteral",
        "signature": {
          "typeParameters": [],
          "parameters": [{"name": "arg0", "type": {"variable": "hydra.core.model.Literal"}, "isLazy": false}],
          "result": {"type": {"either": {"left": {"variable": "hydra.core.errors.Error"}, "right": {"literal": "boolean"}}}}},
        "body": {
          "annotated": {
            "body": {
              "lambda": {
                "parameter": "v",
                "domain": {"variable": "hydra.core.model.Literal"},
                "body": {
                  "application": {
                    "function": {
                      "cases": {
                        "typeName": "hydra.core.model.Literal",
                        "default": {
                          "typeApplication": {
                            "body": {
                              "typeApplication": {
                                "body": {
                                  "either": {
                                    "left": {
                                      "inject": {
                                        "typeName": "hydra.core.errors.Error",
                                        "field": {
                                          "name": "extraction",
                                          "term": {
                                            "inject": {
                                              "typeName": "hydra.core.errors.ExtractionError",
                                              "field": {
                                                "name": "unexpectedShape",
                                                "term": {
                                                  "record": {
                                                    "typeName": "hydra.core.errors.UnexpectedShapeError",
                                                    "fields": [
                                                      {"name": "expected", "term": {"literal": {"string": "boolean"}}},
                                                      {
                                                        "name": "actual",
                                                        "term": {"application": {"function": {"variable": "hydra.core.print.model.literal"}, "argument": {"variable": "v"}}}}]}}}}}}}}}},
                                "type": {"variable": "hydra.core.errors.Error"}}},
                            "type": {"literal": "boolean"}}},
                        "cases": [
                          {
                            "name": "boolean",
                            "handler": {
                              "lambda": {
                                "parameter": "b",
                                "domain": {"literal": "boolean"},
                                "body": {
                                  "typeApplication": {
                                    "body": {"typeApplication": {"body": {"either": {"right": {"variable": "b"}}}, "type": {"variable": "hydra.core.errors.Error"}}},
                                    "type": {"literal": "boolean"}}}}}}]}},
                    "argument": {"variable": "v"}}}}},
            "annotation": {
              "map": [
                {"key": {"variable": "description"}, "value": {"literal": {"string": "Extract a boolean literal from a Literal value"}}}]}}}}},
    {
      "term": {
        "name": "hydra.core.extract.model.cases",
        "signature": {
          "typeParameters": [],
          "parameters": [
            {"name": "arg0", "type": {"variable": "hydra.core.model.Name"}, "isLazy": false},
            {"name": "arg1", "type": {"variable": "hydra.core.graph.Graph"}, "isLazy": false},
            {"name": "arg2", "type": {"variable": "hydra.core.model.Term"}, "isLazy": false}],
          "result": {
            "type": {"either": {"left": {"variable": "hydra.core.errors.Error"}, "right": {"variable": "hydra.core.model.CaseStatement"}}}}},
        "body": {
          "annotated": {
            "body": {
              "lambda": {
                "parameter": "name",
                "domain": {"variable": "hydra.core.model.Name"},
                "body": {
                  "lambda": {
                    "parameter": "graph",
                    "domain": {"variable": "hydra.core.graph.Graph"},
                    "body": {
                      "lambda": {
                        "parameter": "term0",
                        "domain": {"variable": "hydra.core.model.Term"},
                        "body": {
                          "application": {
                            "function": {
                              "application": {
                                "function": {
                                  "typeApplication": {
                                    "body": {
                                      "typeApplication": {
                                        "body": {
                                          "typeApplication": {"body": {"variable": "hydra.core.lib.eithers.bind"}, "type": {"variable": "hydra.core.errors.Error"}}},
                                        "type": {"variable": "hydra.core.model.Term"}}},
                                    "type": {"variable": "hydra.core.model.CaseStatement"}}},
                                "argument": {
                                  "application": {
                                    "function": {
                                      "application": {"function": {"variable": "hydra.core.lexical.stripAndDereferenceTerm"}, "argument": {"variable": "graph"}}},
                                    "argument": {"variable": "term0"}}}}},
                            "argument": {
                              "lambda": {
                                "parameter": "term",
                                "domain": {"variable": "hydra.core.model.Term"},
                                "body": {
                                  "application": {
                                    "function": {
                                      "cases": {
                                        "typeName": "hydra.core.model.Term",
                                        "default": {
                                          "typeApplication": {
                                            "body": {
                                              "typeApplication": {
                                                "body": {
                                                  "either": {
                                                    "left": {
                                                      "inject": {
                                                        "typeName": "hydra.core.errors.Error",
                                                        "field": {
                                                          "name": "extraction",
                                                          "term": {
                                                            "inject": {
                                                              "typeName": "hydra.core.errors.ExtractionError",
                                                              "field": {
                                                                "name": "unexpectedShape",
                                                                "term": {
                                                                  "record": {
                                                                    "typeName": "hydra.core.errors.UnexpectedShapeError",
                                                                    "fields": [
                                                                      {"name": "expected", "term": {"literal": {"string": "case statement"}}},
                                                                      {
                                                                        "name": "actual",
                                                                        "term": {"application": {"function": {"variable": "hydra.core.print.model.term"}, "argument": {"variable": "term"}}}}]}}}}}}}}}},
                                                "type": {"variable": "hydra.core.errors.Error"}}},
                                            "type": {"variable": "hydra.core.model.CaseStatement"}}},
                                        "cases": [
                                          {
                                            "name": "cases",
                                            "handler": {
                                              "lambda": {
                                                "parameter": "cs",
                                                "domain": {"variable": "hydra.core.model.CaseStatement"},
                                                "body": {
                                                  "application": {
                                                    "function": {
                                                      "application": {
                                                        "function": {
                                                          "application": {
                                                            "function": {
                                                              "typeApplication": {
                                                                "body": {"variable": "hydra.core.lib.logic.ifElse"},
                                                                "type": {"either": {"left": {"variable": "hydra.core.errors.Error"}, "right": {"variable": "hydra.core.model.CaseStatement"}}}}},
                                                            "argument": {
                                                              "application": {
                                                                "function": {
                                                                  "application": {
                                                                    "function": {"typeApplication": {"body": {"variable": "hydra.core.lib.equality.equal"}, "type": {"literal": "string"}}},
                                                                    "argument": {
                                                                      "application": {
                                                                        "function": {"unwrap": "hydra.core.model.Name"},
                                                                        "argument": {
                                                                          "application": {
                                                                            "function": {"project": {"typeName": "hydra.core.model.CaseStatement", "fieldName": "typeName"}},
                                                                            "argument": {"variable": "cs"}}}}}}},
                                                                "argument": {"application": {"function": {"unwrap": "hydra.core.model.Name"}, "argument": {"variable": "name"}}}}}}},
                                                        "argument": {
                                                          "typeApplication": {
                                                            "body": {
                                                              "typeApplication": {"body": {"either": {"right": {"variable": "cs"}}}, "type": {"variable": "hydra.core.errors.Error"}}},
                                                            "type": {"variable": "hydra.core.model.CaseStatement"}}}}},
                                                    "argument": {
                                                      "typeApplication": {
                                                        "body": {
                                                          "typeApplication": {
                                                            "body": {
                                                              "either": {
                                                                "left": {
                                                                  "inject": {
                                                                    "typeName": "hydra.core.errors.Error",
                                                                    "field": {
                                                                      "name": "extraction",
                                                                      "term": {
                                                                        "inject": {
                                                                          "typeName": "hydra.core.errors.ExtractionError",
                                                                          "field": {
                                                                            "name": "unexpectedShape",
                                                                            "term": {
                                                                              "record": {
                                                                                "typeName": "hydra.core.errors.UnexpectedShapeError",
                                                                                "fields": [
                                                                                  {
                                                                                    "name": "expected",
                                                                                    "term": {
                                                                                      "application": {
                                                                                        "function": {
                                                                                          "application": {
                                                                                            "function": {"variable": "hydra.core.lib.strings.concat2"},
                                                                                            "argument": {"literal": {"string": "case statement for type "}}}},
                                                                                        "argument": {"application": {"function": {"unwrap": "hydra.core.model.Name"}, "argument": {"variable": "name"}}}}}},
                                                                                  {
                                                                                    "name": "actual",
                                                                                    "term": {"application": {"function": {"variable": "hydra.core.print.model.term"}, "argument": {"variable": "term"}}}}]}}}}}}}}}},
                                                            "type": {"variable": "hydra.core.errors.Error"}}},
                                                        "type": {"variable": "hydra.core.model.CaseStatement"}}}}}}}}]}},
                                    "argument": {"variable": "term"}}}}}}}}}}}}},
            "annotation": {"map": [{"key": {"variable": "description"}, "value": {"literal": {"string": "Extract case statement from a term"}}}]}}}}},
    {
      "term": {
        "name": "hydra.core.extract.model.decimal",
        "signature": {
          "typeParameters": [],
          "parameters": [
            {"name": "arg0", "type": {"variable": "hydra.core.graph.Graph"}, "isLazy": false},
            {"name": "arg1", "type": {"variable": "hydra.core.model.Term"}, "isLazy": false}],
          "result": {"type": {"either": {"left": {"variable": "hydra.core.errors.Error"}, "right": {"literal": "decimal"}}}}},
        "body": {
          "annotated": {
            "body": {
              "lambda": {
                "parameter": "graph",
                "domain": {"variable": "hydra.core.graph.Graph"},
                "body": {
                  "lambda": {
                    "parameter": "t",
                    "domain": {"variable": "hydra.core.model.Term"},
                    "body": {
                      "application": {
                        "function": {
                          "application": {
                            "function": {
                              "typeApplication": {
                                "body": {
                                  "typeApplication": {
                                    "body": {
                                      "typeApplication": {"body": {"variable": "hydra.core.lib.eithers.bind"}, "type": {"variable": "hydra.core.errors.Error"}}},
                                    "type": {"variable": "hydra.core.model.Literal"}}},
                                "type": {"literal": "decimal"}}},
                            "argument": {
                              "application": {
                                "function": {"application": {"function": {"variable": "hydra.core.extract.model.literal"}, "argument": {"variable": "graph"}}},
                                "argument": {"variable": "t"}}}}},
                        "argument": {
                          "lambda": {
                            "parameter": "l",
                            "domain": {"variable": "hydra.core.model.Literal"},
                            "body": {"application": {"function": {"variable": "hydra.core.extract.model.decimalLiteral"}, "argument": {"variable": "l"}}}}}}}}}}},
            "annotation": {
              "map": [
                {
                  "key": {"variable": "description"},
                  "value": {"literal": {"string": "Extract an arbitrary-precision decimal value from a term"}}}]}}}}},
    {
      "term": {
        "name": "hydra.core.extract.model.decimalLiteral",
        "signature": {
          "typeParameters": [],
          "parameters": [{"name": "arg0", "type": {"variable": "hydra.core.model.Literal"}, "isLazy": false}],
          "result": {"type": {"either": {"left": {"variable": "hydra.core.errors.Error"}, "right": {"literal": "decimal"}}}}},
        "body": {
          "annotated": {
            "body": {
              "lambda": {
                "parameter": "v",
                "domain": {"variable": "hydra.core.model.Literal"},
                "body": {
                  "application": {
                    "function": {
                      "cases": {
                        "typeName": "hydra.core.model.Literal",
                        "default": {
                          "typeApplication": {
                            "body": {
                              "typeApplication": {
                                "body": {
                                  "either": {
                                    "left": {
                                      "inject": {
                                        "typeName": "hydra.core.errors.Error",
                                        "field": {
                                          "name": "extraction",
                                          "term": {
                                            "inject": {
                                              "typeName": "hydra.core.errors.ExtractionError",
                                              "field": {
                                                "name": "unexpectedShape",
                                                "term": {
                                                  "record": {
                                                    "typeName": "hydra.core.errors.UnexpectedShapeError",
                                                    "fields": [
                                                      {"name": "expected", "term": {"literal": {"string": "decimal"}}},
                                                      {
                                                        "name": "actual",
                                                        "term": {"application": {"function": {"variable": "hydra.core.print.model.literal"}, "argument": {"variable": "v"}}}}]}}}}}}}}}},
                                "type": {"variable": "hydra.core.errors.Error"}}},
                            "type": {"literal": "decimal"}}},
                        "cases": [
                          {
                            "name": "decimal",
                            "handler": {
                              "lambda": {
                                "parameter": "d",
                                "domain": {"literal": "decimal"},
                                "body": {
                                  "typeApplication": {
                                    "body": {"typeApplication": {"body": {"either": {"right": {"variable": "d"}}}, "type": {"variable": "hydra.core.errors.Error"}}},
                                    "type": {"literal": "decimal"}}}}}}]}},
                    "argument": {"variable": "v"}}}}},
            "annotation": {
              "map": [
                {"key": {"variable": "description"}, "value": {"literal": {"string": "Extract a decimal literal from a Literal value"}}}]}}}}},
    {
      "term": {
        "name": "hydra.core.extract.model.decodeEither",
        "signature": {
          "typeParameters": [{"name": "t0", "constraints": []}, {"name": "t1", "constraints": []}],
          "parameters": [
            {
              "name": "arg0",
              "type": {
                "function": {
                  "domain": {"variable": "hydra.core.graph.Graph"},
                  "codomain": {
                    "function": {
                      "domain": {"variable": "hydra.core.model.Term"},
                      "codomain": {"either": {"left": {"variable": "hydra.core.errors.DecodingError"}, "right": {"variable": "t0"}}}}}}},
              "isLazy": false},
            {
              "name": "arg1",
              "type": {
                "function": {
                  "domain": {"variable": "hydra.core.graph.Graph"},
                  "codomain": {
                    "function": {
                      "domain": {"variable": "hydra.core.model.Term"},
                      "codomain": {"either": {"left": {"variable": "hydra.core.errors.DecodingError"}, "right": {"variable": "t1"}}}}}}},
              "isLazy": false},
            {"name": "arg2", "type": {"variable": "hydra.core.graph.Graph"}, "isLazy": false},
            {"name": "arg3", "type": {"variable": "hydra.core.model.Term"}, "isLazy": false}],
          "result": {
            "type": {
              "either": {
                "left": {"variable": "hydra.core.errors.DecodingError"},
                "right": {"either": {"left": {"variable": "t0"}, "right": {"variable": "t1"}}}}}}},
        "body": {
          "typeLambda": {
            "parameter": "t0",
            "body": {
              "typeLambda": {
                "parameter": "t1",
                "body": {
                  "annotated": {
                    "body": {
                      "lambda": {
                        "parameter": "leftDecoder",
                        "domain": {
                          "function": {
                            "domain": {"variable": "hydra.core.graph.Graph"},
                            "codomain": {
                              "function": {
                                "domain": {"variable": "hydra.core.model.Term"},
                                "codomain": {"either": {"left": {"variable": "hydra.core.errors.DecodingError"}, "right": {"variable": "t0"}}}}}}},
                        "body": {
                          "lambda": {
                            "parameter": "rightDecoder",
                            "domain": {
                              "function": {
                                "domain": {"variable": "hydra.core.graph.Graph"},
                                "codomain": {
                                  "function": {
                                    "domain": {"variable": "hydra.core.model.Term"},
                                    "codomain": {"either": {"left": {"variable": "hydra.core.errors.DecodingError"}, "right": {"variable": "t1"}}}}}}},
                            "body": {
                              "lambda": {
                                "parameter": "g",
                                "domain": {"variable": "hydra.core.graph.Graph"},
                                "body": {
                                  "lambda": {
                                    "parameter": "term",
                                    "domain": {"variable": "hydra.core.model.Term"},
                                    "body": {
                                      "application": {
                                        "function": {
                                          "application": {
                                            "function": {
                                              "typeApplication": {
                                                "body": {
                                                  "typeApplication": {
                                                    "body": {
                                                      "typeApplication": {"body": {"variable": "hydra.core.lib.eithers.bind"}, "type": {"variable": "hydra.core.errors.DecodingError"}}},
                                                    "type": {"variable": "hydra.core.model.Term"}}},
                                                "type": {"either": {"left": {"variable": "t0"}, "right": {"variable": "t1"}}}}},
                                            "argument": {
                                              "application": {
                                                "function": {
                                                  "application": {"function": {"variable": "hydra.core.extract.model.stripWithDecodingError"}, "argument": {"variable": "g"}}},
                                                "argument": {"variable": "term"}}}}},
                                        "argument": {
                                          "lambda": {
                                            "parameter": "stripped",
                                            "domain": {"variable": "hydra.core.model.Term"},
                                            "body": {
                                              "application": {
                                                "function": {
                                                  "cases": {
                                                    "typeName": "hydra.core.model.Term",
                                                    "default": {
                                                      "typeApplication": {
                                                        "body": {
                                                          "typeApplication": {
                                                            "body": {
                                                              "either": {
                                                                "left": {"wrap": {"typeName": "hydra.core.errors.DecodingError", "body": {"literal": {"string": "expected either value"}}}}}},
                                                            "type": {"variable": "hydra.core.errors.DecodingError"}}},
                                                        "type": {"either": {"left": {"variable": "t0"}, "right": {"variable": "t1"}}}}},
                                                    "cases": [
                                                      {
                                                        "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": {
                                                                      "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": {"variable": "hydra.core.errors.DecodingError"},
                                                                                "right": {"either": {"left": {"variable": "t0"}, "right": {"variable": "t1"}}}}}}},
                                                                        "argument": {
                                                                          "lambda": {
                                                                            "parameter": "lv",
                                                                            "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": "t0"}}},
                                                                                            "type": {"either": {"left": {"variable": "t0"}, "right": {"variable": "t1"}}}}},
                                                                                        "type": {"variable": "hydra.core.errors.DecodingError"}}},
                                                                                    "argument": {
                                                                                      "lambda": {
                                                                                        "parameter": "x",
                                                                                        "domain": {"variable": "t0"},
                                                                                        "body": {
                                                                                          "typeApplication": {
                                                                                            "body": {"typeApplication": {"body": {"either": {"left": {"variable": "x"}}}, "type": {"variable": "t0"}}},
                                                                                            "type": {"variable": "t1"}}}}}}},
                                                                                "argument": {
                                                                                  "application": {
                                                                                    "function": {"application": {"function": {"variable": "leftDecoder"}, "argument": {"variable": "g"}}},
                                                                                    "argument": {"variable": "lv"}}}}}}}}},
                                                                    "argument": {
                                                                      "lambda": {
                                                                        "parameter": "rv",
                                                                        "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": "t1"}}},
                                                                                        "type": {"either": {"left": {"variable": "t0"}, "right": {"variable": "t1"}}}}},
                                                                                    "type": {"variable": "hydra.core.errors.DecodingError"}}},
                                                                                "argument": {
                                                                                  "lambda": {
                                                                                    "parameter": "x",
                                                                                    "domain": {"variable": "t1"},
                                                                                    "body": {
                                                                                      "typeApplication": {
                                                                                        "body": {"typeApplication": {"body": {"either": {"right": {"variable": "x"}}}, "type": {"variable": "t0"}}},
                                                                                        "type": {"variable": "t1"}}}}}}},
                                                                            "argument": {
                                                                              "application": {
                                                                                "function": {"application": {"function": {"variable": "rightDecoder"}, "argument": {"variable": "g"}}},
                                                                                "argument": {"variable": "rv"}}}}}}}}},
                                                                "argument": {"variable": "e"}}}}}}]}},
                                                "argument": {"variable": "stripped"}}}}}}}}}}}}}}},
                    "annotation": {
                      "map": [
                        {
                          "key": {"variable": "description"},
                          "value": {"literal": {"string": "Decode an Either value using the provided left and right decoders"}}}]}}}}}}}}},
    {
      "term": {
        "name": "hydra.core.extract.model.decodeList",
        "signature": {
          "typeParameters": [{"name": "t0", "constraints": []}],
          "parameters": [
            {
              "name": "arg0",
              "type": {
                "function": {
                  "domain": {"variable": "hydra.core.graph.Graph"},
                  "codomain": {
                    "function": {
                      "domain": {"variable": "hydra.core.model.Term"},
                      "codomain": {"either": {"left": {"variable": "hydra.core.errors.DecodingError"}, "right": {"variable": "t0"}}}}}}},
              "isLazy": false},
            {"name": "arg1", "type": {"variable": "hydra.core.graph.Graph"}, "isLazy": false},
            {"name": "arg2", "type": {"variable": "hydra.core.model.Term"}, "isLazy": false}],
          "result": {"type": {"either": {"left": {"variable": "hydra.core.errors.DecodingError"}, "right": {"list": {"variable": "t0"}}}}}},
        "body": {
          "typeLambda": {
            "parameter": "t0",
            "body": {
              "annotated": {
                "body": {
                  "lambda": {
                    "parameter": "elemDecoder",
                    "domain": {
                      "function": {
                        "domain": {"variable": "hydra.core.graph.Graph"},
                        "codomain": {
                          "function": {
                            "domain": {"variable": "hydra.core.model.Term"},
                            "codomain": {"either": {"left": {"variable": "hydra.core.errors.DecodingError"}, "right": {"variable": "t0"}}}}}}},
                    "body": {
                      "lambda": {
                        "parameter": "g",
                        "domain": {"variable": "hydra.core.graph.Graph"},
                        "body": {
                          "lambda": {
                            "parameter": "term",
                            "domain": {"variable": "hydra.core.model.Term"},
                            "body": {
                              "application": {
                                "function": {
                                  "application": {
                                    "function": {
                                      "typeApplication": {
                                        "body": {
                                          "typeApplication": {
                                            "body": {
                                              "typeApplication": {"body": {"variable": "hydra.core.lib.eithers.bind"}, "type": {"variable": "hydra.core.errors.DecodingError"}}},
                                            "type": {"variable": "hydra.core.model.Term"}}},
                                        "type": {"list": {"variable": "t0"}}}},
                                    "argument": {
                                      "application": {
                                        "function": {
                                          "application": {"function": {"variable": "hydra.core.extract.model.stripWithDecodingError"}, "argument": {"variable": "g"}}},
                                        "argument": {"variable": "term"}}}}},
                                "argument": {
                                  "lambda": {
                                    "parameter": "stripped",
                                    "domain": {"variable": "hydra.core.model.Term"},
                                    "body": {
                                      "application": {
                                        "function": {
                                          "cases": {
                                            "typeName": "hydra.core.model.Term",
                                            "default": {
                                              "typeApplication": {
                                                "body": {
                                                  "typeApplication": {
                                                    "body": {
                                                      "either": {"left": {"wrap": {"typeName": "hydra.core.errors.DecodingError", "body": {"literal": {"string": "expected list"}}}}}},
                                                    "type": {"variable": "hydra.core.errors.DecodingError"}}},
                                                "type": {"list": {"variable": "t0"}}}},
                                            "cases": [
                                              {
                                                "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.mapList"}, "type": {"variable": "hydra.core.model.Term"}}},
                                                                    "type": {"variable": "t0"}}},
                                                                "type": {"variable": "hydra.core.errors.DecodingError"}}},
                                                            "argument": {"application": {"function": {"variable": "elemDecoder"}, "argument": {"variable": "g"}}}}},
                                                        "argument": {"variable": "els"}}}}}}]}},
                                        "argument": {"variable": "stripped"}}}}}}}}}}}}},
                "annotation": {
                  "map": [
                    {
                      "key": {"variable": "description"},
                      "value": {"literal": {"string": "Decode a list of elements using the provided element decoder"}}}]}}}}}}},
    {
      "term": {
        "name": "hydra.core.extract.model.decodeMap",
        "signature": {
          "typeParameters": [{"name": "t0", "constraints": [{"simple": "ordering"}]}, {"name": "t1", "constraints": []}],
          "parameters": [
            {
              "name": "arg0",
              "type": {
                "function": {
                  "domain": {"variable": "hydra.core.graph.Graph"},
                  "codomain": {
                    "function": {
                      "domain": {"variable": "hydra.core.model.Term"},
                      "codomain": {"either": {"left": {"variable": "hydra.core.errors.DecodingError"}, "right": {"variable": "t0"}}}}}}},
              "isLazy": false},
            {
              "name": "arg1",
              "type": {
                "function": {
                  "domain": {"variable": "hydra.core.graph.Graph"},
                  "codomain": {
                    "function": {
                      "domain": {"variable": "hydra.core.model.Term"},
                      "codomain": {"either": {"left": {"variable": "hydra.core.errors.DecodingError"}, "right": {"variable": "t1"}}}}}}},
              "isLazy": false},
            {"name": "arg2", "type": {"variable": "hydra.core.graph.Graph"}, "isLazy": false},
            {"name": "arg3", "type": {"variable": "hydra.core.model.Term"}, "isLazy": false}],
          "result": {
            "type": {
              "either": {
                "left": {"variable": "hydra.core.errors.DecodingError"},
                "right": {"map": {"keys": {"variable": "t0"}, "values": {"variable": "t1"}}}}}}},
        "body": {
          "typeLambda": {
            "parameter": "t0",
            "body": {
              "typeLambda": {
                "parameter": "t1",
                "body": {
                  "annotated": {
                    "body": {
                      "lambda": {
                        "parameter": "keyDecoder",
                        "domain": {
                          "function": {
                            "domain": {"variable": "hydra.core.graph.Graph"},
                            "codomain": {
                              "function": {
                                "domain": {"variable": "hydra.core.model.Term"},
                                "codomain": {"either": {"left": {"variable": "hydra.core.errors.DecodingError"}, "right": {"variable": "t0"}}}}}}},
                        "body": {
                          "lambda": {
                            "parameter": "valDecoder",
                            "domain": {
                              "function": {
                                "domain": {"variable": "hydra.core.graph.Graph"},
                                "codomain": {
                                  "function": {
                                    "domain": {"variable": "hydra.core.model.Term"},
                                    "codomain": {"either": {"left": {"variable": "hydra.core.errors.DecodingError"}, "right": {"variable": "t1"}}}}}}},
                            "body": {
                              "lambda": {
                                "parameter": "g",
                                "domain": {"variable": "hydra.core.graph.Graph"},
                                "body": {
                                  "lambda": {
                                    "parameter": "term",
                                    "domain": {"variable": "hydra.core.model.Term"},
                                    "body": {
                                      "application": {
                                        "function": {
                                          "application": {
                                            "function": {
                                              "typeApplication": {
                                                "body": {
                                                  "typeApplication": {
                                                    "body": {
                                                      "typeApplication": {"body": {"variable": "hydra.core.lib.eithers.bind"}, "type": {"variable": "hydra.core.errors.DecodingError"}}},
                                                    "type": {"variable": "hydra.core.model.Term"}}},
                                                "type": {"map": {"keys": {"variable": "t0"}, "values": {"variable": "t1"}}}}},
                                            "argument": {
                                              "application": {
                                                "function": {
                                                  "application": {"function": {"variable": "hydra.core.extract.model.stripWithDecodingError"}, "argument": {"variable": "g"}}},
                                                "argument": {"variable": "term"}}}}},
                                        "argument": {
                                          "lambda": {
                                            "parameter": "stripped",
                                            "domain": {"variable": "hydra.core.model.Term"},
                                            "body": {
                                              "application": {
                                                "function": {
                                                  "cases": {
                                                    "typeName": "hydra.core.model.Term",
                                                    "default": {
                                                      "typeApplication": {
                                                        "body": {
                                                          "typeApplication": {
                                                            "body": {
                                                              "either": {"left": {"wrap": {"typeName": "hydra.core.errors.DecodingError", "body": {"literal": {"string": "expected map"}}}}}},
                                                            "type": {"variable": "hydra.core.errors.DecodingError"}}},
                                                        "type": {"map": {"keys": {"variable": "t0"}, "values": {"variable": "t1"}}}}},
                                                    "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": "t0"}, "second": {"variable": "t1"}}}}}},
                                                                            "type": {"map": {"keys": {"variable": "t0"}, "values": {"variable": "t1"}}}}},
                                                                        "type": {"variable": "hydra.core.errors.DecodingError"}}},
                                                                    "argument": {
                                                                      "typeApplication": {
                                                                        "body": {"typeApplication": {"body": {"variable": "hydra.core.lib.maps.fromList"}, "type": {"variable": "t0"}}},
                                                                        "type": {"variable": "t1"}}}}},
                                                                "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": "t0"}, "second": {"variable": "t1"}}}}},
                                                                            "type": {"variable": "hydra.core.errors.DecodingError"}}},
                                                                        "argument": {
                                                                          "lambda": {
                                                                            "parameter": "kv",
                                                                            "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": {"variable": "hydra.core.errors.DecodingError"}}},
                                                                                            "type": {"variable": "t0"}}},
                                                                                        "type": {"pair": {"first": {"variable": "t0"}, "second": {"variable": "t1"}}}}},
                                                                                    "argument": {
                                                                                      "application": {
                                                                                        "function": {"application": {"function": {"variable": "keyDecoder"}, "argument": {"variable": "g"}}},
                                                                                        "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": "kv"}}}}}}},
                                                                                "argument": {
                                                                                  "lambda": {
                                                                                    "parameter": "k",
                                                                                    "domain": {"variable": "t0"},
                                                                                    "body": {
                                                                                      "application": {
                                                                                        "function": {
                                                                                          "application": {
                                                                                            "function": {
                                                                                              "typeApplication": {
                                                                                                "body": {
                                                                                                  "typeApplication": {
                                                                                                    "body": {"typeApplication": {"body": {"variable": "hydra.core.lib.eithers.map"}, "type": {"variable": "t1"}}},
                                                                                                    "type": {"pair": {"first": {"variable": "t0"}, "second": {"variable": "t1"}}}}},
                                                                                                "type": {"variable": "hydra.core.errors.DecodingError"}}},
                                                                                            "argument": {
                                                                                              "lambda": {
                                                                                                "parameter": "v",
                                                                                                "domain": {"variable": "t1"},
                                                                                                "body": {
                                                                                                  "typeApplication": {
                                                                                                    "body": {
                                                                                                      "typeApplication": {"body": {"pair": {"first": {"variable": "k"}, "second": {"variable": "v"}}}, "type": {"variable": "t0"}}},
                                                                                                    "type": {"variable": "t1"}}}}}}},
                                                                                        "argument": {
                                                                                          "application": {
                                                                                            "function": {"application": {"function": {"variable": "valDecoder"}, "argument": {"variable": "g"}}},
                                                                                            "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": "kv"}}}}}}}}}}}}}}},
                                                                    "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": "stripped"}}}}}}}}}}}}}}},
                    "annotation": {
                      "map": [
                        {
                          "key": {"variable": "description"},
                          "value": {"literal": {"string": "Decode a Map using the provided key and value decoders"}}}]}}}}}}}}},
    {
      "term": {
        "name": "hydra.core.extract.model.decodeMaybe",
        "signature": {
          "typeParameters": [{"name": "t0", "constraints": []}],
          "parameters": [
            {
              "name": "arg0",
              "type": {
                "function": {
                  "domain": {"variable": "hydra.core.graph.Graph"},
                  "codomain": {
                    "function": {
                      "domain": {"variable": "hydra.core.model.Term"},
                      "codomain": {"either": {"left": {"variable": "hydra.core.errors.DecodingError"}, "right": {"variable": "t0"}}}}}}},
              "isLazy": false},
            {"name": "arg1", "type": {"variable": "hydra.core.graph.Graph"}, "isLazy": false},
            {"name": "arg2", "type": {"variable": "hydra.core.model.Term"}, "isLazy": false}],
          "result": {
            "type": {"either": {"left": {"variable": "hydra.core.errors.DecodingError"}, "right": {"optional": {"variable": "t0"}}}}}},
        "body": {
          "typeLambda": {
            "parameter": "t0",
            "body": {
              "annotated": {
                "body": {
                  "lambda": {
                    "parameter": "elemDecoder",
                    "domain": {
                      "function": {
                        "domain": {"variable": "hydra.core.graph.Graph"},
                        "codomain": {
                          "function": {
                            "domain": {"variable": "hydra.core.model.Term"},
                            "codomain": {"either": {"left": {"variable": "hydra.core.errors.DecodingError"}, "right": {"variable": "t0"}}}}}}},
                    "body": {
                      "lambda": {
                        "parameter": "g",
                        "domain": {"variable": "hydra.core.graph.Graph"},
                        "body": {
                          "lambda": {
                            "parameter": "term",
                            "domain": {"variable": "hydra.core.model.Term"},
                            "body": {
                              "application": {
                                "function": {
                                  "application": {
                                    "function": {
                                      "typeApplication": {
                                        "body": {
                                          "typeApplication": {
                                            "body": {
                                              "typeApplication": {"body": {"variable": "hydra.core.lib.eithers.bind"}, "type": {"variable": "hydra.core.errors.DecodingError"}}},
                                            "type": {"variable": "hydra.core.model.Term"}}},
                                        "type": {"optional": {"variable": "t0"}}}},
                                    "argument": {
                                      "application": {
                                        "function": {
                                          "application": {"function": {"variable": "hydra.core.extract.model.stripWithDecodingError"}, "argument": {"variable": "g"}}},
                                        "argument": {"variable": "term"}}}}},
                                "argument": {
                                  "lambda": {
                                    "parameter": "stripped",
                                    "domain": {"variable": "hydra.core.model.Term"},
                                    "body": {
                                      "application": {
                                        "function": {
                                          "cases": {
                                            "typeName": "hydra.core.model.Term",
                                            "default": {
                                              "typeApplication": {
                                                "body": {
                                                  "typeApplication": {
                                                    "body": {
                                                      "either": {
                                                        "left": {"wrap": {"typeName": "hydra.core.errors.DecodingError", "body": {"literal": {"string": "expected optional value"}}}}}},
                                                    "type": {"variable": "hydra.core.errors.DecodingError"}}},
                                                "type": {"optional": {"variable": "t0"}}}},
                                            "cases": [
                                              {
                                                "name": "optional",
                                                "handler": {
                                                  "lambda": {
                                                    "parameter": "opt",
                                                    "domain": {"optional": {"variable": "hydra.core.model.Term"}},
                                                    "body": {
                                                      "application": {
                                                        "function": {
                                                          "application": {
                                                            "function": {
                                                              "typeApplication": {
                                                                "body": {
                                                                  "typeApplication": {
                                                                    "body": {
                                                                      "typeApplication": {"body": {"variable": "hydra.core.lib.eithers.mapOptional"}, "type": {"variable": "hydra.core.model.Term"}}},
                                                                    "type": {"variable": "t0"}}},
                                                                "type": {"variable": "hydra.core.errors.DecodingError"}}},
                                                            "argument": {"application": {"function": {"variable": "elemDecoder"}, "argument": {"variable": "g"}}}}},
                                                        "argument": {"variable": "opt"}}}}}}]}},
                                        "argument": {"variable": "stripped"}}}}}}}}}}}}},
                "annotation": {
                  "map": [
                    {
                      "key": {"variable": "description"},
                      "value": {"literal": {"string": "Decode a Maybe value using the provided element decoder"}}}]}}}}}}},
    {
      "term": {
        "name": "hydra.core.extract.model.decodePair",
        "signature": {
          "typeParameters": [{"name": "t0", "constraints": []}, {"name": "t1", "constraints": []}],
          "parameters": [
            {
              "name": "arg0",
              "type": {
                "function": {
                  "domain": {"variable": "hydra.core.graph.Graph"},
                  "codomain": {
                    "function": {
                      "domain": {"variable": "hydra.core.model.Term"},
                      "codomain": {"either": {"left": {"variable": "hydra.core.errors.DecodingError"}, "right": {"variable": "t0"}}}}}}},
              "isLazy": false},
            {
              "name": "arg1",
              "type": {
                "function": {
                  "domain": {"variable": "hydra.core.graph.Graph"},
                  "codomain": {
                    "function": {
                      "domain": {"variable": "hydra.core.model.Term"},
                      "codomain": {"either": {"left": {"variable": "hydra.core.errors.DecodingError"}, "right": {"variable": "t1"}}}}}}},
              "isLazy": false},
            {"name": "arg2", "type": {"variable": "hydra.core.graph.Graph"}, "isLazy": false},
            {"name": "arg3", "type": {"variable": "hydra.core.model.Term"}, "isLazy": false}],
          "result": {
            "type": {
              "either": {
                "left": {"variable": "hydra.core.errors.DecodingError"},
                "right": {"pair": {"first": {"variable": "t0"}, "second": {"variable": "t1"}}}}}}},
        "body": {
          "typeLambda": {
            "parameter": "t0",
            "body": {
              "typeLambda": {
                "parameter": "t1",
                "body": {
                  "annotated": {
                    "body": {
                      "lambda": {
                        "parameter": "firstDecoder",
                        "domain": {
                          "function": {
                            "domain": {"variable": "hydra.core.graph.Graph"},
                            "codomain": {
                              "function": {
                                "domain": {"variable": "hydra.core.model.Term"},
                                "codomain": {"either": {"left": {"variable": "hydra.core.errors.DecodingError"}, "right": {"variable": "t0"}}}}}}},
                        "body": {
                          "lambda": {
                            "parameter": "secondDecoder",
                            "domain": {
                              "function": {
                                "domain": {"variable": "hydra.core.graph.Graph"},
                                "codomain": {
                                  "function": {
                                    "domain": {"variable": "hydra.core.model.Term"},
                                    "codomain": {"either": {"left": {"variable": "hydra.core.errors.DecodingError"}, "right": {"variable": "t1"}}}}}}},
                            "body": {
                              "lambda": {
                                "parameter": "g",
                                "domain": {"variable": "hydra.core.graph.Graph"},
                                "body": {
                                  "lambda": {
                                    "parameter": "term",
                                    "domain": {"variable": "hydra.core.model.Term"},
                                    "body": {
                                      "application": {
                                        "function": {
                                          "application": {
                                            "function": {
                                              "typeApplication": {
                                                "body": {
                                                  "typeApplication": {
                                                    "body": {
                                                      "typeApplication": {"body": {"variable": "hydra.core.lib.eithers.bind"}, "type": {"variable": "hydra.core.errors.DecodingError"}}},
                                                    "type": {"variable": "hydra.core.model.Term"}}},
                                                "type": {"pair": {"first": {"variable": "t0"}, "second": {"variable": "t1"}}}}},
                                            "argument": {
                                              "application": {
                                                "function": {
                                                  "application": {"function": {"variable": "hydra.core.extract.model.stripWithDecodingError"}, "argument": {"variable": "g"}}},
                                                "argument": {"variable": "term"}}}}},
                                        "argument": {
                                          "lambda": {
                                            "parameter": "stripped",
                                            "domain": {"variable": "hydra.core.model.Term"},
                                            "body": {
                                              "application": {
                                                "function": {
                                                  "cases": {
                                                    "typeName": "hydra.core.model.Term",
                                                    "default": {
                                                      "typeApplication": {
                                                        "body": {
                                                          "typeApplication": {
                                                            "body": {
                                                              "either": {"left": {"wrap": {"typeName": "hydra.core.errors.DecodingError", "body": {"literal": {"string": "expected pair"}}}}}},
                                                            "type": {"variable": "hydra.core.errors.DecodingError"}}},
                                                        "type": {"pair": {"first": {"variable": "t0"}, "second": {"variable": "t1"}}}}},
                                                    "cases": [
                                                      {
                                                        "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": {"variable": "hydra.core.errors.DecodingError"}}},
                                                                            "type": {"variable": "t0"}}},
                                                                        "type": {"pair": {"first": {"variable": "t0"}, "second": {"variable": "t1"}}}}},
                                                                    "argument": {
                                                                      "application": {
                                                                        "function": {"application": {"function": {"variable": "firstDecoder"}, "argument": {"variable": "g"}}},
                                                                        "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": "t0"},
                                                                    "body": {
                                                                      "application": {
                                                                        "function": {
                                                                          "application": {
                                                                            "function": {
                                                                              "typeApplication": {
                                                                                "body": {
                                                                                  "typeApplication": {
                                                                                    "body": {"typeApplication": {"body": {"variable": "hydra.core.lib.eithers.map"}, "type": {"variable": "t1"}}},
                                                                                    "type": {"pair": {"first": {"variable": "t0"}, "second": {"variable": "t1"}}}}},
                                                                                "type": {"variable": "hydra.core.errors.DecodingError"}}},
                                                                            "argument": {
                                                                              "lambda": {
                                                                                "parameter": "s",
                                                                                "domain": {"variable": "t1"},
                                                                                "body": {
                                                                                  "typeApplication": {
                                                                                    "body": {
                                                                                      "typeApplication": {"body": {"pair": {"first": {"variable": "f"}, "second": {"variable": "s"}}}, "type": {"variable": "t0"}}},
                                                                                    "type": {"variable": "t1"}}}}}}},
                                                                        "argument": {
                                                                          "application": {
                                                                            "function": {"application": {"function": {"variable": "secondDecoder"}, "argument": {"variable": "g"}}},
                                                                            "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"}}}}}}}}}}}}}}]}},
                                                "argument": {"variable": "stripped"}}}}}}}}}}}}}}},
                    "annotation": {
                      "map": [
                        {
                          "key": {"variable": "description"},
                          "value": {"literal": {"string": "Decode a Pair using the provided first and second decoders"}}}]}}}}}}}}},
    {
      "term": {
        "name": "hydra.core.extract.model.decodeSet",
        "signature": {
          "typeParameters": [{"name": "t0", "constraints": [{"simple": "ordering"}]}],
          "parameters": [
            {
              "name": "arg0",
              "type": {
                "function": {
                  "domain": {"variable": "hydra.core.graph.Graph"},
                  "codomain": {
                    "function": {
                      "domain": {"variable": "hydra.core.model.Term"},
                      "codomain": {"either": {"left": {"variable": "hydra.core.errors.DecodingError"}, "right": {"variable": "t0"}}}}}}},
              "isLazy": false},
            {"name": "arg1", "type": {"variable": "hydra.core.graph.Graph"}, "isLazy": false},
            {"name": "arg2", "type": {"variable": "hydra.core.model.Term"}, "isLazy": false}],
          "result": {"type": {"either": {"left": {"variable": "hydra.core.errors.DecodingError"}, "right": {"set": {"variable": "t0"}}}}}},
        "body": {
          "typeLambda": {
            "parameter": "t0",
            "body": {
              "annotated": {
                "body": {
                  "lambda": {
                    "parameter": "elemDecoder",
                    "domain": {
                      "function": {
                        "domain": {"variable": "hydra.core.graph.Graph"},
                        "codomain": {
                          "function": {
                            "domain": {"variable": "hydra.core.model.Term"},
                            "codomain": {"either": {"left": {"variable": "hydra.core.errors.DecodingError"}, "right": {"variable": "t0"}}}}}}},
                    "body": {
                      "lambda": {
                        "parameter": "g",
                        "domain": {"variable": "hydra.core.graph.Graph"},
                        "body": {
                          "lambda": {
                            "parameter": "term",
                            "domain": {"variable": "hydra.core.model.Term"},
                            "body": {
                              "application": {
                                "function": {
                                  "application": {
                                    "function": {
                                      "typeApplication": {
                                        "body": {
                                          "typeApplication": {
                                            "body": {
                                              "typeApplication": {"body": {"variable": "hydra.core.lib.eithers.bind"}, "type": {"variable": "hydra.core.errors.DecodingError"}}},
                                            "type": {"variable": "hydra.core.model.Term"}}},
                                        "type": {"set": {"variable": "t0"}}}},
                                    "argument": {
                                      "application": {
                                        "function": {
                                          "application": {"function": {"variable": "hydra.core.extract.model.stripWithDecodingError"}, "argument": {"variable": "g"}}},
                                        "argument": {"variable": "term"}}}}},
                                "argument": {
                                  "lambda": {
                                    "parameter": "stripped",
                                    "domain": {"variable": "hydra.core.model.Term"},
                                    "body": {
                                      "application": {
                                        "function": {
                                          "cases": {
                                            "typeName": "hydra.core.model.Term",
                                            "default": {
                                              "typeApplication": {
                                                "body": {
                                                  "typeApplication": {
                                                    "body": {
                                                      "either": {"left": {"wrap": {"typeName": "hydra.core.errors.DecodingError", "body": {"literal": {"string": "expected set"}}}}}},
                                                    "type": {"variable": "hydra.core.errors.DecodingError"}}},
                                                "type": {"set": {"variable": "t0"}}}},
                                            "cases": [
                                              {
                                                "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": "t0"}}}},
                                                                    "type": {"set": {"variable": "t0"}}}},
                                                                "type": {"variable": "hydra.core.errors.DecodingError"}}},
                                                            "argument": {"typeApplication": {"body": {"variable": "hydra.core.lib.sets.fromList"}, "type": {"variable": "t0"}}}}},
                                                        "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": "t0"}}},
                                                                    "type": {"variable": "hydra.core.errors.DecodingError"}}},
                                                                "argument": {"application": {"function": {"variable": "elemDecoder"}, "argument": {"variable": "g"}}}}},
                                                            "argument": {
                                                              "application": {
                                                                "function": {"typeApplication": {"body": {"variable": "hydra.core.lib.sets.toList"}, "type": {"variable": "hydra.core.model.Term"}}},
                                                                "argument": {"variable": "s"}}}}}}}}}}]}},
                                        "argument": {"variable": "stripped"}}}}}}}}}}}}},
                "annotation": {
                  "map": [
                    {
                      "key": {"variable": "description"},
                      "value": {"literal": {"string": "Decode a Set using the provided element decoder"}}}]}}}}}}},
    {
      "term": {
        "name": "hydra.core.extract.model.decodeUnit",
        "signature": {
          "typeParameters": [],
          "parameters": [
            {"name": "arg0", "type": {"variable": "hydra.core.graph.Graph"}, "isLazy": false},
            {"name": "arg1", "type": {"variable": "hydra.core.model.Term"}, "isLazy": false}],
          "result": {"type": {"either": {"left": {"variable": "hydra.core.errors.DecodingError"}, "right": "unit"}}}},
        "body": {
          "annotated": {
            "body": {
              "lambda": {
                "parameter": "g",
                "domain": {"variable": "hydra.core.graph.Graph"},
                "body": {
                  "lambda": {
                    "parameter": "term",
                    "domain": {"variable": "hydra.core.model.Term"},
                    "body": {
                      "application": {
                        "function": {
                          "application": {
                            "function": {
                              "typeApplication": {
                                "body": {
                                  "typeApplication": {
                                    "body": {
                                      "typeApplication": {"body": {"variable": "hydra.core.lib.eithers.bind"}, "type": {"variable": "hydra.core.errors.DecodingError"}}},
                                    "type": {"variable": "hydra.core.model.Term"}}},
                                "type": "unit"}},
                            "argument": {
                              "application": {
                                "function": {
                                  "application": {"function": {"variable": "hydra.core.extract.model.stripWithDecodingError"}, "argument": {"variable": "g"}}},
                                "argument": {"variable": "term"}}}}},
                        "argument": {
                          "lambda": {
                            "parameter": "stripped",
                            "domain": {"variable": "hydra.core.model.Term"},
                            "body": {
                              "application": {
                                "function": {
                                  "cases": {
                                    "typeName": "hydra.core.model.Term",
                                    "default": {
                                      "typeApplication": {
                                        "body": {
                                          "typeApplication": {
                                            "body": {
                                              "either": {
                                                "left": {"wrap": {"typeName": "hydra.core.errors.DecodingError", "body": {"literal": {"string": "expected a unit value"}}}}}},
                                            "type": {"variable": "hydra.core.errors.DecodingError"}}},
                                        "type": "unit"}},
                                    "cases": [
                                      {
                                        "name": "unit",
                                        "handler": {
                                          "lambda": {
                                            "parameter": "_",
                                            "domain": "unit",
                                            "body": {
                                              "typeApplication": {
                                                "body": {"typeApplication": {"body": {"either": {"right": "unit"}}, "type": {"variable": "hydra.core.errors.DecodingError"}}},
                                                "type": "unit"}}}}}]}},
                                "argument": {"variable": "stripped"}}}}}}}}}}},
            "annotation": {"map": [{"key": {"variable": "description"}, "value": {"literal": {"string": "Decode a unit value"}}}]}}}}},
    {
      "term": {
        "name": "hydra.core.extract.model.eitherTerm",
        "signature": {
          "typeParameters": [{"name": "t0", "constraints": []}, {"name": "t1", "constraints": []}],
          "parameters": [
            {
              "name": "arg0",
              "type": {
                "function": {
                  "domain": {"variable": "hydra.core.model.Term"},
                  "codomain": {"either": {"left": {"variable": "hydra.core.errors.Error"}, "right": {"variable": "t0"}}}}},
              "isLazy": false},
            {
              "name": "arg1",
              "type": {
                "function": {
                  "domain": {"variable": "hydra.core.model.Term"},
                  "codomain": {"either": {"left": {"variable": "hydra.core.errors.Error"}, "right": {"variable": "t1"}}}}},
              "isLazy": false},
            {"name": "arg2", "type": {"variable": "hydra.core.graph.Graph"}, "isLazy": false},
            {"name": "arg3", "type": {"variable": "hydra.core.model.Term"}, "isLazy": false}],
          "result": {
            "type": {
              "either": {
                "left": {"variable": "hydra.core.errors.Error"},
                "right": {"either": {"left": {"variable": "t0"}, "right": {"variable": "t1"}}}}}}},
        "body": {
          "typeLambda": {
            "parameter": "t0",
            "body": {
              "typeLambda": {
                "parameter": "t1",
                "body": {
                  "annotated": {
                    "body": {
                      "lambda": {
                        "parameter": "leftFun",
                        "domain": {
                          "function": {
                            "domain": {"variable": "hydra.core.model.Term"},
                            "codomain": {"either": {"left": {"variable": "hydra.core.errors.Error"}, "right": {"variable": "t0"}}}}},
                        "body": {
                          "lambda": {
                            "parameter": "rightFun",
                            "domain": {
                              "function": {
                                "domain": {"variable": "hydra.core.model.Term"},
                                "codomain": {"either": {"left": {"variable": "hydra.core.errors.Error"}, "right": {"variable": "t1"}}}}},
                            "body": {
                              "lambda": {
                                "parameter": "graph",
                                "domain": {"variable": "hydra.core.graph.Graph"},
                                "body": {
                                  "lambda": {
                                    "parameter": "term0",
                                    "domain": {"variable": "hydra.core.model.Term"},
                                    "body": {
                                      "application": {
                                        "function": {
                                          "application": {
                                            "function": {
                                              "typeApplication": {
                                                "body": {
                                                  "typeApplication": {
                                                    "body": {
                                                      "typeApplication": {"body": {"variable": "hydra.core.lib.eithers.bind"}, "type": {"variable": "hydra.core.errors.Error"}}},
                                                    "type": {"variable": "hydra.core.model.Term"}}},
                                                "type": {"either": {"left": {"variable": "t0"}, "right": {"variable": "t1"}}}}},
                                            "argument": {
                                              "application": {
                                                "function": {
                                                  "application": {"function": {"variable": "hydra.core.lexical.stripAndDereferenceTerm"}, "argument": {"variable": "graph"}}},
                                                "argument": {"variable": "term0"}}}}},
                                        "argument": {
                                          "lambda": {
                                            "parameter": "term",
                                            "domain": {"variable": "hydra.core.model.Term"},
                                            "body": {
                                              "application": {
                                                "function": {
                                                  "cases": {
                                                    "typeName": "hydra.core.model.Term",
                                                    "default": {
                                                      "typeApplication": {
                                                        "body": {
                                                          "typeApplication": {
                                                            "body": {
                                                              "either": {
                                                                "left": {
                                                                  "inject": {
                                                                    "typeName": "hydra.core.errors.Error",
                                                                    "field": {
                                                                      "name": "extraction",
                                                                      "term": {
                                                                        "inject": {
                                                                          "typeName": "hydra.core.errors.ExtractionError",
                                                                          "field": {
                                                                            "name": "unexpectedShape",
                                                                            "term": {
                                                                              "record": {
                                                                                "typeName": "hydra.core.errors.UnexpectedShapeError",
                                                                                "fields": [
                                                                                  {"name": "expected", "term": {"literal": {"string": "either value"}}},
                                                                                  {
                                                                                    "name": "actual",
                                                                                    "term": {"application": {"function": {"variable": "hydra.core.print.model.term"}, "argument": {"variable": "term"}}}}]}}}}}}}}}},
                                                            "type": {"variable": "hydra.core.errors.Error"}}},
                                                        "type": {"either": {"left": {"variable": "t0"}, "right": {"variable": "t1"}}}}},
                                                    "cases": [
                                                      {
                                                        "name": "either",
                                                        "handler": {
                                                          "lambda": {
                                                            "parameter": "et",
                                                            "domain": {"either": {"left": {"variable": "hydra.core.model.Term"}, "right": {"variable": "hydra.core.model.Term"}}},
                                                            "body": {
                                                              "application": {
                                                                "function": {
                                                                  "application": {
                                                                    "function": {
                                                                      "application": {
                                                                        "function": {
                                                                          "typeApplication": {
                                                                            "body": {
                                                                              "typeApplication": {
                                                                                "body": {
                                                                                  "typeApplication": {"body": {"variable": "hydra.core.lib.eithers.either"}, "type": {"variable": "hydra.core.model.Term"}}},
                                                                                "type": {"variable": "hydra.core.model.Term"}}},
                                                                            "type": {
                                                                              "either": {
                                                                                "left": {"variable": "hydra.core.errors.Error"},
                                                                                "right": {"either": {"left": {"variable": "t0"}, "right": {"variable": "t1"}}}}}}},
                                                                        "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": "t0"}}},
                                                                                            "type": {"either": {"left": {"variable": "t0"}, "right": {"variable": "t1"}}}}},
                                                                                        "type": {"variable": "hydra.core.errors.Error"}}},
                                                                                    "argument": {
                                                                                      "lambda": {
                                                                                        "parameter": "x",
                                                                                        "domain": {"variable": "t0"},
                                                                                        "body": {
                                                                                          "typeApplication": {
                                                                                            "body": {"typeApplication": {"body": {"either": {"left": {"variable": "x"}}}, "type": {"variable": "t0"}}},
                                                                                            "type": {"variable": "t1"}}}}}}},
                                                                                "argument": {"application": {"function": {"variable": "leftFun"}, "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": "t1"}}},
                                                                                        "type": {"either": {"left": {"variable": "t0"}, "right": {"variable": "t1"}}}}},
                                                                                    "type": {"variable": "hydra.core.errors.Error"}}},
                                                                                "argument": {
                                                                                  "lambda": {
                                                                                    "parameter": "x",
                                                                                    "domain": {"variable": "t1"},
                                                                                    "body": {
                                                                                      "typeApplication": {
                                                                                        "body": {"typeApplication": {"body": {"either": {"right": {"variable": "x"}}}, "type": {"variable": "t0"}}},
                                                                                        "type": {"variable": "t1"}}}}}}},
                                                                            "argument": {"application": {"function": {"variable": "rightFun"}, "argument": {"variable": "r"}}}}}}}}},
                                                                "argument": {"variable": "et"}}}}}}]}},
                                                "argument": {"variable": "term"}}}}}}}}}}}}}}},
                    "annotation": {
                      "map": [
                        {
                          "key": {"variable": "description"},
                          "value": {"literal": {"string": "Extract an either value from a term, applying functions to the left and right values"}}}]}}}}}}}}},
    {
      "term": {
        "name": "hydra.core.extract.model.eitherType",
        "signature": {
          "typeParameters": [],
          "parameters": [{"name": "arg0", "type": {"variable": "hydra.core.model.Type"}, "isLazy": false}],
          "result": {
            "type": {"either": {"left": {"variable": "hydra.core.errors.Error"}, "right": {"variable": "hydra.core.model.EitherType"}}}}},
        "body": {
          "annotated": {
            "body": {
              "lambda": {
                "parameter": "typ",
                "domain": {"variable": "hydra.core.model.Type"},
                "body": {
                  "let": {
                    "bindings": [
                      {
                        "name": "stripped",
                        "term": {"application": {"function": {"variable": "hydra.core.strip.deannotateType"}, "argument": {"variable": "typ"}}},
                        "typeScheme": {"variables": [], "body": {"variable": "hydra.core.model.Type"}, "constraints": []}}],
                    "body": {
                      "application": {
                        "function": {
                          "cases": {
                            "typeName": "hydra.core.model.Type",
                            "default": {
                              "typeApplication": {
                                "body": {
                                  "typeApplication": {
                                    "body": {
                                      "either": {
                                        "left": {
                                          "inject": {
                                            "typeName": "hydra.core.errors.Error",
                                            "field": {
                                              "name": "extraction",
                                              "term": {
                                                "inject": {
                                                  "typeName": "hydra.core.errors.ExtractionError",
                                                  "field": {
                                                    "name": "unexpectedShape",
                                                    "term": {
                                                      "record": {
                                                        "typeName": "hydra.core.errors.UnexpectedShapeError",
                                                        "fields": [
                                                          {"name": "expected", "term": {"literal": {"string": "either type"}}},
                                                          {
                                                            "name": "actual",
                                                            "term": {"application": {"function": {"variable": "hydra.core.print.model.type"}, "argument": {"variable": "typ"}}}}]}}}}}}}}}},
                                    "type": {"variable": "hydra.core.errors.Error"}}},
                                "type": {"variable": "hydra.core.model.EitherType"}}},
                            "cases": [
                              {
                                "name": "either",
                                "handler": {
                                  "lambda": {
                                    "parameter": "et",
                                    "domain": {"variable": "hydra.core.model.EitherType"},
                                    "body": {
                                      "typeApplication": {
                                        "body": {
                                          "typeApplication": {"body": {"either": {"right": {"variable": "et"}}}, "type": {"variable": "hydra.core.errors.Error"}}},
                                        "type": {"variable": "hydra.core.model.EitherType"}}}}}}]}},
                        "argument": {"variable": "stripped"}}}}}}},
            "annotation": {
              "map": [
                {
                  "key": {"variable": "description"},
                  "value": {"literal": {"string": "Extract the left and right types from an either type"}}}]}}}}},
    {
      "term": {
        "name": "hydra.core.extract.model.field",
        "signature": {
          "typeParameters": [{"name": "t0", "constraints": []}],
          "parameters": [
            {"name": "arg0", "type": {"variable": "hydra.core.model.Name"}, "isLazy": false},
            {
              "name": "arg1",
              "type": {
                "function": {
                  "domain": {"variable": "hydra.core.model.Term"},
                  "codomain": {"either": {"left": {"variable": "hydra.core.errors.Error"}, "right": {"variable": "t0"}}}}},
              "isLazy": false},
            {"name": "arg2", "type": {"variable": "hydra.core.graph.Graph"}, "isLazy": false},
            {"name": "arg3", "type": {"list": {"variable": "hydra.core.model.Field"}}, "isLazy": false}],
          "result": {"type": {"either": {"left": {"variable": "hydra.core.errors.Error"}, "right": {"variable": "t0"}}}}},
        "body": {
          "typeLambda": {
            "parameter": "t0",
            "body": {
              "annotated": {
                "body": {
                  "lambda": {
                    "parameter": "fname",
                    "domain": {"variable": "hydra.core.model.Name"},
                    "body": {
                      "lambda": {
                        "parameter": "mapping",
                        "domain": {
                          "function": {
                            "domain": {"variable": "hydra.core.model.Term"},
                            "codomain": {"either": {"left": {"variable": "hydra.core.errors.Error"}, "right": {"variable": "t0"}}}}},
                        "body": {
                          "lambda": {
                            "parameter": "graph",
                            "domain": {"variable": "hydra.core.graph.Graph"},
                            "body": {
                              "lambda": {
                                "parameter": "fields",
                                "domain": {"list": {"variable": "hydra.core.model.Field"}},
                                "body": {
                                  "let": {
                                    "bindings": [
                                      {
                                        "name": "matchingFields",
                                        "term": {
                                          "application": {
                                            "function": {
                                              "application": {
                                                "function": {
                                                  "typeApplication": {"body": {"variable": "hydra.core.lib.lists.filter"}, "type": {"variable": "hydra.core.model.Field"}}},
                                                "argument": {
                                                  "lambda": {
                                                    "parameter": "f",
                                                    "domain": {"variable": "hydra.core.model.Field"},
                                                    "body": {
                                                      "application": {
                                                        "function": {
                                                          "application": {
                                                            "function": {"typeApplication": {"body": {"variable": "hydra.core.lib.equality.equal"}, "type": {"literal": "string"}}},
                                                            "argument": {
                                                              "application": {
                                                                "function": {"unwrap": "hydra.core.model.Name"},
                                                                "argument": {
                                                                  "application": {"function": {"project": {"typeName": "hydra.core.model.Field", "fieldName": "name"}}, "argument": {"variable": "f"}}}}}}},
                                                        "argument": {"application": {"function": {"unwrap": "hydra.core.model.Name"}, "argument": {"variable": "fname"}}}}}}}}},
                                            "argument": {"variable": "fields"}}},
                                        "typeScheme": {"variables": [], "body": {"list": {"variable": "hydra.core.model.Field"}}, "constraints": []}}],
                                    "body": {
                                      "let": {
                                        "bindings": [
                                          {
                                            "name": "noMatchErr",
                                            "term": {
                                              "typeLambda": {
                                                "parameter": "t1",
                                                "body": {
                                                  "typeApplication": {
                                                    "body": {
                                                      "typeApplication": {
                                                        "body": {
                                                          "either": {
                                                            "left": {
                                                              "inject": {
                                                                "typeName": "hydra.core.errors.Error",
                                                                "field": {
                                                                  "name": "extraction",
                                                                  "term": {
                                                                    "inject": {
                                                                      "typeName": "hydra.core.errors.ExtractionError",
                                                                      "field": {
                                                                        "name": "unexpectedShape",
                                                                        "term": {
                                                                          "record": {
                                                                            "typeName": "hydra.core.errors.UnexpectedShapeError",
                                                                            "fields": [
                                                                              {
                                                                                "name": "expected",
                                                                                "term": {
                                                                                  "application": {
                                                                                    "function": {
                                                                                      "application": {"function": {"variable": "hydra.core.lib.strings.concat2"}, "argument": {"literal": {"string": "field "}}}},
                                                                                    "argument": {"application": {"function": {"unwrap": "hydra.core.model.Name"}, "argument": {"variable": "fname"}}}}}},
                                                                              {"name": "actual", "term": {"literal": {"string": "no matching field"}}}]}}}}}}}}}},
                                                        "type": {"variable": "hydra.core.errors.Error"}}},
                                                    "type": {"variable": "t1"}}}}},
                                            "typeScheme": {
                                              "variables": ["t1"],
                                              "body": {"either": {"left": {"variable": "hydra.core.errors.Error"}, "right": {"variable": "t1"}}},
                                              "constraints": []}}],
                                        "body": {
                                          "application": {
                                            "function": {
                                              "application": {
                                                "function": {
                                                  "application": {
                                                    "function": {
                                                      "typeApplication": {
                                                        "body": {"variable": "hydra.core.lib.logic.ifElse"},
                                                        "type": {"either": {"left": {"variable": "hydra.core.errors.Error"}, "right": {"variable": "t0"}}}}},
                                                    "argument": {
                                                      "application": {
                                                        "function": {
                                                          "typeApplication": {"body": {"variable": "hydra.core.lib.lists.isEmpty"}, "type": {"variable": "hydra.core.model.Field"}}},
                                                        "argument": {"variable": "matchingFields"}}}}},
                                                "argument": {"typeApplication": {"body": {"variable": "noMatchErr"}, "type": {"variable": "t0"}}}}},
                                            "argument": {
                                              "application": {
                                                "function": {
                                                  "application": {
                                                    "function": {
                                                      "application": {
                                                        "function": {
                                                          "typeApplication": {
                                                            "body": {"variable": "hydra.core.lib.logic.ifElse"},
                                                            "type": {"either": {"left": {"variable": "hydra.core.errors.Error"}, "right": {"variable": "t0"}}}}},
                                                        "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": "matchingFields"}}}}},
                                                            "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": {"either": {"left": {"variable": "hydra.core.errors.Error"}, "right": {"variable": "t0"}}}}},
                                                                "argument": {
                                                                  "application": {
                                                                    "function": {"typeApplication": {"body": {"variable": "hydra.core.lib.lists.head"}, "type": {"variable": "hydra.core.model.Field"}}},
                                                                    "argument": {"variable": "matchingFields"}}}}},
                                                            "argument": {"typeApplication": {"body": {"variable": "noMatchErr"}, "type": {"variable": "t0"}}}}},
                                                        "argument": {
                                                          "lambda": {
                                                            "parameter": "mf",
                                                            "domain": {"variable": "hydra.core.model.Field"},
                                                            "body": {
                                                              "application": {
                                                                "function": {
                                                                  "application": {
                                                                    "function": {
                                                                      "typeApplication": {
                                                                        "body": {
                                                                          "typeApplication": {
                                                                            "body": {
                                                                              "typeApplication": {"body": {"variable": "hydra.core.lib.eithers.bind"}, "type": {"variable": "hydra.core.errors.Error"}}},
                                                                            "type": {"variable": "hydra.core.model.Term"}}},
                                                                        "type": {"variable": "t0"}}},
                                                                    "argument": {
                                                                      "application": {
                                                                        "function": {
                                                                          "application": {"function": {"variable": "hydra.core.lexical.stripAndDereferenceTerm"}, "argument": {"variable": "graph"}}},
                                                                        "argument": {
                                                                          "application": {"function": {"project": {"typeName": "hydra.core.model.Field", "fieldName": "term"}}, "argument": {"variable": "mf"}}}}}}},
                                                                "argument": {
                                                                  "lambda": {
                                                                    "parameter": "stripped",
                                                                    "domain": {"variable": "hydra.core.model.Term"},
                                                                    "body": {"application": {"function": {"variable": "mapping"}, "argument": {"variable": "stripped"}}}}}}}}}}}}},
                                                "argument": {
                                                  "typeApplication": {
                                                    "body": {
                                                      "typeApplication": {
                                                        "body": {
                                                          "either": {
                                                            "left": {
                                                              "inject": {
                                                                "typeName": "hydra.core.errors.Error",
                                                                "field": {
                                                                  "name": "extraction",
                                                                  "term": {
                                                                    "inject": {
                                                                      "typeName": "hydra.core.errors.ExtractionError",
                                                                      "field": {
                                                                        "name": "unexpectedShape",
                                                                        "term": {
                                                                          "record": {
                                                                            "typeName": "hydra.core.errors.UnexpectedShapeError",
                                                                            "fields": [
                                                                              {"name": "expected", "term": {"literal": {"string": "single field"}}},
                                                                              {
                                                                                "name": "actual",
                                                                                "term": {
                                                                                  "application": {
                                                                                    "function": {
                                                                                      "application": {
                                                                                        "function": {"variable": "hydra.core.lib.strings.concat2"},
                                                                                        "argument": {"literal": {"string": "multiple fields named "}}}},
                                                                                    "argument": {"application": {"function": {"unwrap": "hydra.core.model.Name"}, "argument": {"variable": "fname"}}}}}}]}}}}}}}}}},
                                                        "type": {"variable": "hydra.core.errors.Error"}}},
                                                    "type": {"variable": "t0"}}}}}}}}}}}}}}}}}}},
                "annotation": {
                  "map": [{"key": {"variable": "description"}, "value": {"literal": {"string": "Extract a field value from a list of fields"}}}]}}}}}}},
    {
      "term": {
        "name": "hydra.core.extract.model.float32",
        "signature": {
          "typeParameters": [],
          "parameters": [
            {"name": "arg0", "type": {"variable": "hydra.core.graph.Graph"}, "isLazy": false},
            {"name": "arg1", "type": {"variable": "hydra.core.model.Term"}, "isLazy": false}],
          "result": {"type": {"either": {"left": {"variable": "hydra.core.errors.Error"}, "right": {"literal": {"float": "float32"}}}}}},
        "body": {
          "annotated": {
            "body": {
              "lambda": {
                "parameter": "graph",
                "domain": {"variable": "hydra.core.graph.Graph"},
                "body": {
                  "lambda": {
                    "parameter": "t",
                    "domain": {"variable": "hydra.core.model.Term"},
                    "body": {
                      "application": {
                        "function": {
                          "application": {
                            "function": {
                              "typeApplication": {
                                "body": {
                                  "typeApplication": {
                                    "body": {
                                      "typeApplication": {"body": {"variable": "hydra.core.lib.eithers.bind"}, "type": {"variable": "hydra.core.errors.Error"}}},
                                    "type": {"variable": "hydra.core.model.Literal"}}},
                                "type": {"literal": {"float": "float32"}}}},
                            "argument": {
                              "application": {
                                "function": {"application": {"function": {"variable": "hydra.core.extract.model.literal"}, "argument": {"variable": "graph"}}},
                                "argument": {"variable": "t"}}}}},
                        "argument": {
                          "lambda": {
                            "parameter": "l",
                            "domain": {"variable": "hydra.core.model.Literal"},
                            "body": {
                              "application": {
                                "function": {
                                  "application": {
                                    "function": {
                                      "typeApplication": {
                                        "body": {
                                          "typeApplication": {
                                            "body": {
                                              "typeApplication": {"body": {"variable": "hydra.core.lib.eithers.bind"}, "type": {"variable": "hydra.core.errors.Error"}}},
                                            "type": {"variable": "hydra.core.model.FloatValue"}}},
                                        "type": {"literal": {"float": "float32"}}}},
                                    "argument": {"application": {"function": {"variable": "hydra.core.extract.model.floatLiteral"}, "argument": {"variable": "l"}}}}},
                                "argument": {
                                  "lambda": {
                                    "parameter": "f",
                                    "domain": {"variable": "hydra.core.model.FloatValue"},
                                    "body": {"application": {"function": {"variable": "hydra.core.extract.model.float32Value"}, "argument": {"variable": "f"}}}}}}}}}}}}}}},
            "annotation": {
              "map": [
                {
                  "key": {"variable": "description"},
                  "value": {"literal": {"string": "Extract a 32-bit floating-point value from a term"}}}]}}}}},
    {
      "term": {
        "name": "hydra.core.extract.model.float32Value",
        "signature": {
          "typeParameters": [],
          "parameters": [{"name": "arg0", "type": {"variable": "hydra.core.model.FloatValue"}, "isLazy": false}],
          "result": {"type": {"either": {"left": {"variable": "hydra.core.errors.Error"}, "right": {"literal": {"float": "float32"}}}}}},
        "body": {
          "annotated": {
            "body": {
              "lambda": {
                "parameter": "v",
                "domain": {"variable": "hydra.core.model.FloatValue"},
                "body": {
                  "application": {
                    "function": {
                      "cases": {
                        "typeName": "hydra.core.model.FloatValue",
                        "default": {
                          "typeApplication": {
                            "body": {
                              "typeApplication": {
                                "body": {
                                  "either": {
                                    "left": {
                                      "inject": {
                                        "typeName": "hydra.core.errors.Error",
                                        "field": {
                                          "name": "extraction",
                                          "term": {
                                            "inject": {
                                              "typeName": "hydra.core.errors.ExtractionError",
                                              "field": {
                                                "name": "unexpectedShape",
                                                "term": {
                                                  "record": {
                                                    "typeName": "hydra.core.errors.UnexpectedShapeError",
                                                    "fields": [
                                                      {"name": "expected", "term": {"literal": {"string": "float32"}}},
                                                      {
                                                        "name": "actual",
                                                        "term": {"application": {"function": {"variable": "hydra.core.print.model.float"}, "argument": {"variable": "v"}}}}]}}}}}}}}}},
                                "type": {"variable": "hydra.core.errors.Error"}}},
                            "type": {"literal": {"float": "float32"}}}},
                        "cases": [
                          {
                            "name": "float32",
                            "handler": {
                              "lambda": {
                                "parameter": "f",
                                "domain": {"literal": {"float": "float32"}},
                                "body": {
                                  "typeApplication": {
                                    "body": {"typeApplication": {"body": {"either": {"right": {"variable": "f"}}}, "type": {"variable": "hydra.core.errors.Error"}}},
                                    "type": {"literal": {"float": "float32"}}}}}}}]}},
                    "argument": {"variable": "v"}}}}},
            "annotation": {
              "map": [{"key": {"variable": "description"}, "value": {"literal": {"string": "Extract a float32 value from a FloatValue"}}}]}}}}},
    {
      "term": {
        "name": "hydra.core.extract.model.float64",
        "signature": {
          "typeParameters": [],
          "parameters": [
            {"name": "arg0", "type": {"variable": "hydra.core.graph.Graph"}, "isLazy": false},
            {"name": "arg1", "type": {"variable": "hydra.core.model.Term"}, "isLazy": false}],
          "result": {"type": {"either": {"left": {"variable": "hydra.core.errors.Error"}, "right": {"literal": {"float": "float64"}}}}}},
        "body": {
          "annotated": {
            "body": {
              "lambda": {
                "parameter": "graph",
                "domain": {"variable": "hydra.core.graph.Graph"},
                "body": {
                  "lambda": {
                    "parameter": "t",
                    "domain": {"variable": "hydra.core.model.Term"},
                    "body": {
                      "application": {
                        "function": {
                          "application": {
                            "function": {
                              "typeApplication": {
                                "body": {
                                  "typeApplication": {
                                    "body": {
                                      "typeApplication": {"body": {"variable": "hydra.core.lib.eithers.bind"}, "type": {"variable": "hydra.core.errors.Error"}}},
                                    "type": {"variable": "hydra.core.model.Literal"}}},
                                "type": {"literal": {"float": "float64"}}}},
                            "argument": {
                              "application": {
                                "function": {"application": {"function": {"variable": "hydra.core.extract.model.literal"}, "argument": {"variable": "graph"}}},
                                "argument": {"variable": "t"}}}}},
                        "argument": {
                          "lambda": {
                            "parameter": "l",
                            "domain": {"variable": "hydra.core.model.Literal"},
                            "body": {
                              "application": {
                                "function": {
                                  "application": {
                                    "function": {
                                      "typeApplication": {
                                        "body": {
                                          "typeApplication": {
                                            "body": {
                                              "typeApplication": {"body": {"variable": "hydra.core.lib.eithers.bind"}, "type": {"variable": "hydra.core.errors.Error"}}},
                                            "type": {"variable": "hydra.core.model.FloatValue"}}},
                                        "type": {"literal": {"float": "float64"}}}},
                                    "argument": {"application": {"function": {"variable": "hydra.core.extract.model.floatLiteral"}, "argument": {"variable": "l"}}}}},
                                "argument": {
                                  "lambda": {
                                    "parameter": "f",
                                    "domain": {"variable": "hydra.core.model.FloatValue"},
                                    "body": {"application": {"function": {"variable": "hydra.core.extract.model.float64Value"}, "argument": {"variable": "f"}}}}}}}}}}}}}}},
            "annotation": {
              "map": [
                {
                  "key": {"variable": "description"},
                  "value": {"literal": {"string": "Extract a 64-bit floating-point value from a term"}}}]}}}}},
    {
      "term": {
        "name": "hydra.core.extract.model.float64Value",
        "signature": {
          "typeParameters": [],
          "parameters": [{"name": "arg0", "type": {"variable": "hydra.core.model.FloatValue"}, "isLazy": false}],
          "result": {"type": {"either": {"left": {"variable": "hydra.core.errors.Error"}, "right": {"literal": {"float": "float64"}}}}}},
        "body": {
          "annotated": {
            "body": {
              "lambda": {
                "parameter": "v",
                "domain": {"variable": "hydra.core.model.FloatValue"},
                "body": {
                  "application": {
                    "function": {
                      "cases": {
                        "typeName": "hydra.core.model.FloatValue",
                        "default": {
                          "typeApplication": {
                            "body": {
                              "typeApplication": {
                                "body": {
                                  "either": {
                                    "left": {
                                      "inject": {
                                        "typeName": "hydra.core.errors.Error",
                                        "field": {
                                          "name": "extraction",
                                          "term": {
                                            "inject": {
                                              "typeName": "hydra.core.errors.ExtractionError",
                                              "field": {
                                                "name": "unexpectedShape",
                                                "term": {
                                                  "record": {
                                                    "typeName": "hydra.core.errors.UnexpectedShapeError",
                                                    "fields": [
                                                      {"name": "expected", "term": {"literal": {"string": "float64"}}},
                                                      {
                                                        "name": "actual",
                                                        "term": {"application": {"function": {"variable": "hydra.core.print.model.float"}, "argument": {"variable": "v"}}}}]}}}}}}}}}},
                                "type": {"variable": "hydra.core.errors.Error"}}},
                            "type": {"literal": {"float": "float64"}}}},
                        "cases": [
                          {
                            "name": "float64",
                            "handler": {
                              "lambda": {
                                "parameter": "f",
                                "domain": {"literal": {"float": "float64"}},
                                "body": {
                                  "typeApplication": {
                                    "body": {"typeApplication": {"body": {"either": {"right": {"variable": "f"}}}, "type": {"variable": "hydra.core.errors.Error"}}},
                                    "type": {"literal": {"float": "float64"}}}}}}}]}},
                    "argument": {"variable": "v"}}}}},
            "annotation": {
              "map": [{"key": {"variable": "description"}, "value": {"literal": {"string": "Extract a float64 value from a FloatValue"}}}]}}}}},
    {
      "term": {
        "name": "hydra.core.extract.model.floatLiteral",
        "signature": {
          "typeParameters": [],
          "parameters": [{"name": "arg0", "type": {"variable": "hydra.core.model.Literal"}, "isLazy": false}],
          "result": {
            "type": {"either": {"left": {"variable": "hydra.core.errors.Error"}, "right": {"variable": "hydra.core.model.FloatValue"}}}}},
        "body": {
          "annotated": {
            "body": {
              "lambda": {
                "parameter": "lit",
                "domain": {"variable": "hydra.core.model.Literal"},
                "body": {
                  "application": {
                    "function": {
                      "cases": {
                        "typeName": "hydra.core.model.Literal",
                        "default": {
                          "typeApplication": {
                            "body": {
                              "typeApplication": {
                                "body": {
                                  "either": {
                                    "left": {
                                      "inject": {
                                        "typeName": "hydra.core.errors.Error",
                                        "field": {
                                          "name": "extraction",
                                          "term": {
                                            "inject": {
                                              "typeName": "hydra.core.errors.ExtractionError",
                                              "field": {
                                                "name": "unexpectedShape",
                                                "term": {
                                                  "record": {
                                                    "typeName": "hydra.core.errors.UnexpectedShapeError",
                                                    "fields": [
                                                      {"name": "expected", "term": {"literal": {"string": "floating-point value"}}},
                                                      {
                                                        "name": "actual",
                                                        "term": {"application": {"function": {"variable": "hydra.core.print.model.literal"}, "argument": {"variable": "lit"}}}}]}}}}}}}}}},
                                "type": {"variable": "hydra.core.errors.Error"}}},
                            "type": {"variable": "hydra.core.model.FloatValue"}}},
                        "cases": [
                          {
                            "name": "float",
                            "handler": {
                              "lambda": {
                                "parameter": "v",
                                "domain": {"variable": "hydra.core.model.FloatValue"},
                                "body": {
                                  "typeApplication": {
                                    "body": {"typeApplication": {"body": {"either": {"right": {"variable": "v"}}}, "type": {"variable": "hydra.core.errors.Error"}}},
                                    "type": {"variable": "hydra.core.model.FloatValue"}}}}}}]}},
                    "argument": {"variable": "lit"}}}}},
            "annotation": {
              "map": [
                {
                  "key": {"variable": "description"},
                  "value": {"literal": {"string": "Extract a floating-point literal from a Literal value"}}}]}}}}},
    {
      "term": {
        "name": "hydra.core.extract.model.floatValue",
        "signature": {
          "typeParameters": [],
          "parameters": [
            {"name": "arg0", "type": {"variable": "hydra.core.graph.Graph"}, "isLazy": false},
            {"name": "arg1", "type": {"variable": "hydra.core.model.Term"}, "isLazy": false}],
          "result": {
            "type": {"either": {"left": {"variable": "hydra.core.errors.Error"}, "right": {"variable": "hydra.core.model.FloatValue"}}}}},
        "body": {
          "annotated": {
            "body": {
              "lambda": {
                "parameter": "graph",
                "domain": {"variable": "hydra.core.graph.Graph"},
                "body": {
                  "lambda": {
                    "parameter": "t",
                    "domain": {"variable": "hydra.core.model.Term"},
                    "body": {
                      "application": {
                        "function": {
                          "application": {
                            "function": {
                              "typeApplication": {
                                "body": {
                                  "typeApplication": {
                                    "body": {
                                      "typeApplication": {"body": {"variable": "hydra.core.lib.eithers.bind"}, "type": {"variable": "hydra.core.errors.Error"}}},
                                    "type": {"variable": "hydra.core.model.Literal"}}},
                                "type": {"variable": "hydra.core.model.FloatValue"}}},
                            "argument": {
                              "application": {
                                "function": {"application": {"function": {"variable": "hydra.core.extract.model.literal"}, "argument": {"variable": "graph"}}},
                                "argument": {"variable": "t"}}}}},
                        "argument": {
                          "lambda": {
                            "parameter": "l",
                            "domain": {"variable": "hydra.core.model.Literal"},
                            "body": {"application": {"function": {"variable": "hydra.core.extract.model.floatLiteral"}, "argument": {"variable": "l"}}}}}}}}}}},
            "annotation": {"map": [{"key": {"variable": "description"}, "value": {"literal": {"string": "Extract a float value from a term"}}}]}}}}},
    {
      "term": {
        "name": "hydra.core.extract.model.functionType",
        "signature": {
          "typeParameters": [],
          "parameters": [{"name": "arg0", "type": {"variable": "hydra.core.model.Type"}, "isLazy": false}],
          "result": {
            "type": {"either": {"left": {"variable": "hydra.core.errors.Error"}, "right": {"variable": "hydra.core.model.FunctionType"}}}}},
        "body": {
          "annotated": {
            "body": {
              "lambda": {
                "parameter": "typ",
                "domain": {"variable": "hydra.core.model.Type"},
                "body": {
                  "let": {
                    "bindings": [
                      {
                        "name": "stripped",
                        "term": {"application": {"function": {"variable": "hydra.core.strip.deannotateType"}, "argument": {"variable": "typ"}}},
                        "typeScheme": {"variables": [], "body": {"variable": "hydra.core.model.Type"}, "constraints": []}}],
                    "body": {
                      "application": {
                        "function": {
                          "cases": {
                            "typeName": "hydra.core.model.Type",
                            "default": {
                              "typeApplication": {
                                "body": {
                                  "typeApplication": {
                                    "body": {
                                      "either": {
                                        "left": {
                                          "inject": {
                                            "typeName": "hydra.core.errors.Error",
                                            "field": {
                                              "name": "extraction",
                                              "term": {
                                                "inject": {
                                                  "typeName": "hydra.core.errors.ExtractionError",
                                                  "field": {
                                                    "name": "unexpectedShape",
                                                    "term": {
                                                      "record": {
                                                        "typeName": "hydra.core.errors.UnexpectedShapeError",
                                                        "fields": [
                                                          {"name": "expected", "term": {"literal": {"string": "function type"}}},
                                                          {
                                                            "name": "actual",
                                                            "term": {"application": {"function": {"variable": "hydra.core.print.model.type"}, "argument": {"variable": "typ"}}}}]}}}}}}}}}},
                                    "type": {"variable": "hydra.core.errors.Error"}}},
                                "type": {"variable": "hydra.core.model.FunctionType"}}},
                            "cases": [
                              {
                                "name": "function",
                                "handler": {
                                  "lambda": {
                                    "parameter": "ft",
                                    "domain": {"variable": "hydra.core.model.FunctionType"},
                                    "body": {
                                      "typeApplication": {
                                        "body": {
                                          "typeApplication": {"body": {"either": {"right": {"variable": "ft"}}}, "type": {"variable": "hydra.core.errors.Error"}}},
                                        "type": {"variable": "hydra.core.model.FunctionType"}}}}}}]}},
                        "argument": {"variable": "stripped"}}}}}}},
            "annotation": {"map": [{"key": {"variable": "description"}, "value": {"literal": {"string": "Extract a function type from a type"}}}]}}}}},
    {
      "term": {
        "name": "hydra.core.extract.model.injection",
        "signature": {
          "typeParameters": [],
          "parameters": [
            {"name": "arg0", "type": {"variable": "hydra.core.model.Name"}, "isLazy": false},
            {"name": "arg1", "type": {"variable": "hydra.core.graph.Graph"}, "isLazy": false},
            {"name": "arg2", "type": {"variable": "hydra.core.model.Term"}, "isLazy": false}],
          "result": {"type": {"either": {"left": {"variable": "hydra.core.errors.Error"}, "right": {"variable": "hydra.core.model.Field"}}}}},
        "body": {
          "annotated": {
            "body": {
              "lambda": {
                "parameter": "expected",
                "domain": {"variable": "hydra.core.model.Name"},
                "body": {
                  "lambda": {
                    "parameter": "graph",
                    "domain": {"variable": "hydra.core.graph.Graph"},
                    "body": {
                      "lambda": {
                        "parameter": "term0",
                        "domain": {"variable": "hydra.core.model.Term"},
                        "body": {
                          "application": {
                            "function": {
                              "application": {
                                "function": {
                                  "typeApplication": {
                                    "body": {
                                      "typeApplication": {
                                        "body": {
                                          "typeApplication": {"body": {"variable": "hydra.core.lib.eithers.bind"}, "type": {"variable": "hydra.core.errors.Error"}}},
                                        "type": {"variable": "hydra.core.model.Term"}}},
                                    "type": {"variable": "hydra.core.model.Field"}}},
                                "argument": {
                                  "application": {
                                    "function": {
                                      "application": {"function": {"variable": "hydra.core.lexical.stripAndDereferenceTerm"}, "argument": {"variable": "graph"}}},
                                    "argument": {"variable": "term0"}}}}},
                            "argument": {
                              "lambda": {
                                "parameter": "term",
                                "domain": {"variable": "hydra.core.model.Term"},
                                "body": {
                                  "application": {
                                    "function": {
                                      "cases": {
                                        "typeName": "hydra.core.model.Term",
                                        "default": {
                                          "typeApplication": {
                                            "body": {
                                              "typeApplication": {
                                                "body": {
                                                  "either": {
                                                    "left": {
                                                      "inject": {
                                                        "typeName": "hydra.core.errors.Error",
                                                        "field": {
                                                          "name": "extraction",
                                                          "term": {
                                                            "inject": {
                                                              "typeName": "hydra.core.errors.ExtractionError",
                                                              "field": {
                                                                "name": "unexpectedShape",
                                                                "term": {
                                                                  "record": {
                                                                    "typeName": "hydra.core.errors.UnexpectedShapeError",
                                                                    "fields": [
                                                                      {"name": "expected", "term": {"literal": {"string": "injection"}}},
                                                                      {
                                                                        "name": "actual",
                                                                        "term": {"application": {"function": {"variable": "hydra.core.print.model.term"}, "argument": {"variable": "term"}}}}]}}}}}}}}}},
                                                "type": {"variable": "hydra.core.errors.Error"}}},
                                            "type": {"variable": "hydra.core.model.Field"}}},
                                        "cases": [
                                          {
                                            "name": "inject",
                                            "handler": {
                                              "lambda": {
                                                "parameter": "injection",
                                                "domain": {"variable": "hydra.core.model.Injection"},
                                                "body": {
                                                  "application": {
                                                    "function": {
                                                      "application": {
                                                        "function": {
                                                          "application": {
                                                            "function": {
                                                              "typeApplication": {
                                                                "body": {"variable": "hydra.core.lib.logic.ifElse"},
                                                                "type": {"either": {"left": {"variable": "hydra.core.errors.Error"}, "right": {"variable": "hydra.core.model.Field"}}}}},
                                                            "argument": {
                                                              "application": {
                                                                "function": {
                                                                  "application": {
                                                                    "function": {"typeApplication": {"body": {"variable": "hydra.core.lib.equality.equal"}, "type": {"literal": "string"}}},
                                                                    "argument": {
                                                                      "application": {
                                                                        "function": {"unwrap": "hydra.core.model.Name"},
                                                                        "argument": {
                                                                          "application": {
                                                                            "function": {"project": {"typeName": "hydra.core.model.Injection", "fieldName": "typeName"}},
                                                                            "argument": {"variable": "injection"}}}}}}},
                                                                "argument": {"application": {"function": {"unwrap": "hydra.core.model.Name"}, "argument": {"variable": "expected"}}}}}}},
                                                        "argument": {
                                                          "typeApplication": {
                                                            "body": {
                                                              "typeApplication": {
                                                                "body": {
                                                                  "either": {
                                                                    "right": {
                                                                      "application": {
                                                                        "function": {"project": {"typeName": "hydra.core.model.Injection", "fieldName": "field"}},
                                                                        "argument": {"variable": "injection"}}}}},
                                                                "type": {"variable": "hydra.core.errors.Error"}}},
                                                            "type": {"variable": "hydra.core.model.Field"}}}}},
                                                    "argument": {
                                                      "typeApplication": {
                                                        "body": {
                                                          "typeApplication": {
                                                            "body": {
                                                              "either": {
                                                                "left": {
                                                                  "inject": {
                                                                    "typeName": "hydra.core.errors.Error",
                                                                    "field": {
                                                                      "name": "extraction",
                                                                      "term": {
                                                                        "inject": {
                                                                          "typeName": "hydra.core.errors.ExtractionError",
                                                                          "field": {
                                                                            "name": "unexpectedShape",
                                                                            "term": {
                                                                              "record": {
                                                                                "typeName": "hydra.core.errors.UnexpectedShapeError",
                                                                                "fields": [
                                                                                  {
                                                                                    "name": "expected",
                                                                                    "term": {
                                                                                      "application": {
                                                                                        "function": {
                                                                                          "application": {"function": {"variable": "hydra.core.lib.strings.concat2"}, "argument": {"literal": {"string": "injection of type "}}}},
                                                                                        "argument": {"application": {"function": {"unwrap": "hydra.core.model.Name"}, "argument": {"variable": "expected"}}}}}},
                                                                                  {
                                                                                    "name": "actual",
                                                                                    "term": {
                                                                                      "application": {
                                                                                        "function": {"unwrap": "hydra.core.model.Name"},
                                                                                        "argument": {
                                                                                          "application": {
                                                                                            "function": {"project": {"typeName": "hydra.core.model.Injection", "fieldName": "typeName"}},
                                                                                            "argument": {"variable": "injection"}}}}}}]}}}}}}}}}},
                                                            "type": {"variable": "hydra.core.errors.Error"}}},
                                                        "type": {"variable": "hydra.core.model.Field"}}}}}}}}]}},
                                    "argument": {"variable": "term"}}}}}}}}}}}}},
            "annotation": {"map": [{"key": {"variable": "description"}, "value": {"literal": {"string": "Extract a field from a union term"}}}]}}}}},
    {
      "term": {
        "name": "hydra.core.extract.model.int16",
        "signature": {
          "typeParameters": [],
          "parameters": [
            {"name": "arg0", "type": {"variable": "hydra.core.graph.Graph"}, "isLazy": false},
            {"name": "arg1", "type": {"variable": "hydra.core.model.Term"}, "isLazy": false}],
          "result": {"type": {"either": {"left": {"variable": "hydra.core.errors.Error"}, "right": {"literal": {"integer": "int16"}}}}}},
        "body": {
          "annotated": {
            "body": {
              "lambda": {
                "parameter": "graph",
                "domain": {"variable": "hydra.core.graph.Graph"},
                "body": {
                  "lambda": {
                    "parameter": "t",
                    "domain": {"variable": "hydra.core.model.Term"},
                    "body": {
                      "application": {
                        "function": {
                          "application": {
                            "function": {
                              "typeApplication": {
                                "body": {
                                  "typeApplication": {
                                    "body": {
                                      "typeApplication": {"body": {"variable": "hydra.core.lib.eithers.bind"}, "type": {"variable": "hydra.core.errors.Error"}}},
                                    "type": {"variable": "hydra.core.model.Literal"}}},
                                "type": {"literal": {"integer": "int16"}}}},
                            "argument": {
                              "application": {
                                "function": {"application": {"function": {"variable": "hydra.core.extract.model.literal"}, "argument": {"variable": "graph"}}},
                                "argument": {"variable": "t"}}}}},
                        "argument": {
                          "lambda": {
                            "parameter": "l",
                            "domain": {"variable": "hydra.core.model.Literal"},
                            "body": {
                              "application": {
                                "function": {
                                  "application": {
                                    "function": {
                                      "typeApplication": {
                                        "body": {
                                          "typeApplication": {
                                            "body": {
                                              "typeApplication": {"body": {"variable": "hydra.core.lib.eithers.bind"}, "type": {"variable": "hydra.core.errors.Error"}}},
                                            "type": {"variable": "hydra.core.model.IntegerValue"}}},
                                        "type": {"literal": {"integer": "int16"}}}},
                                    "argument": {"application": {"function": {"variable": "hydra.core.extract.model.integerLiteral"}, "argument": {"variable": "l"}}}}},
                                "argument": {
                                  "lambda": {
                                    "parameter": "i",
                                    "domain": {"variable": "hydra.core.model.IntegerValue"},
                                    "body": {"application": {"function": {"variable": "hydra.core.extract.model.int16Value"}, "argument": {"variable": "i"}}}}}}}}}}}}}}},
            "annotation": {
              "map": [
                {
                  "key": {"variable": "description"},
                  "value": {"literal": {"string": "Extract a 16-bit signed integer value from a term"}}}]}}}}},
    {
      "term": {
        "name": "hydra.core.extract.model.int16Value",
        "signature": {
          "typeParameters": [],
          "parameters": [{"name": "arg0", "type": {"variable": "hydra.core.model.IntegerValue"}, "isLazy": false}],
          "result": {"type": {"either": {"left": {"variable": "hydra.core.errors.Error"}, "right": {"literal": {"integer": "int16"}}}}}},
        "body": {
          "annotated": {
            "body": {
              "lambda": {
                "parameter": "v",
                "domain": {"variable": "hydra.core.model.IntegerValue"},
                "body": {
                  "application": {
                    "function": {
                      "cases": {
                        "typeName": "hydra.core.model.IntegerValue",
                        "default": {
                          "typeApplication": {
                            "body": {
                              "typeApplication": {
                                "body": {
                                  "either": {
                                    "left": {
                                      "inject": {
                                        "typeName": "hydra.core.errors.Error",
                                        "field": {
                                          "name": "extraction",
                                          "term": {
                                            "inject": {
                                              "typeName": "hydra.core.errors.ExtractionError",
                                              "field": {
                                                "name": "unexpectedShape",
                                                "term": {
                                                  "record": {
                                                    "typeName": "hydra.core.errors.UnexpectedShapeError",
                                                    "fields": [
                                                      {"name": "expected", "term": {"literal": {"string": "int16"}}},
                                                      {
                                                        "name": "actual",
                                                        "term": {"application": {"function": {"variable": "hydra.core.print.model.integer"}, "argument": {"variable": "v"}}}}]}}}}}}}}}},
                                "type": {"variable": "hydra.core.errors.Error"}}},
                            "type": {"literal": {"integer": "int16"}}}},
                        "cases": [
                          {
                            "name": "int16",
                            "handler": {
                              "lambda": {
                                "parameter": "i",
                                "domain": {"literal": {"integer": "int16"}},
                                "body": {
                                  "typeApplication": {
                                    "body": {"typeApplication": {"body": {"either": {"right": {"variable": "i"}}}, "type": {"variable": "hydra.core.errors.Error"}}},
                                    "type": {"literal": {"integer": "int16"}}}}}}}]}},
                    "argument": {"variable": "v"}}}}},
            "annotation": {
              "map": [{"key": {"variable": "description"}, "value": {"literal": {"string": "Extract an int16 value from an IntegerValue"}}}]}}}}},
    {
      "term": {
        "name": "hydra.core.extract.model.int32",
        "signature": {
          "typeParameters": [],
          "parameters": [
            {"name": "arg0", "type": {"variable": "hydra.core.graph.Graph"}, "isLazy": false},
            {"name": "arg1", "type": {"variable": "hydra.core.model.Term"}, "isLazy": false}],
          "result": {"type": {"either": {"left": {"variable": "hydra.core.errors.Error"}, "right": {"literal": {"integer": "int32"}}}}}},
        "body": {
          "annotated": {
            "body": {
              "lambda": {
                "parameter": "graph",
                "domain": {"variable": "hydra.core.graph.Graph"},
                "body": {
                  "lambda": {
                    "parameter": "t",
                    "domain": {"variable": "hydra.core.model.Term"},
                    "body": {
                      "application": {
                        "function": {
                          "application": {
                            "function": {
                              "typeApplication": {
                                "body": {
                                  "typeApplication": {
                                    "body": {
                                      "typeApplication": {"body": {"variable": "hydra.core.lib.eithers.bind"}, "type": {"variable": "hydra.core.errors.Error"}}},
                                    "type": {"variable": "hydra.core.model.Literal"}}},
                                "type": {"literal": {"integer": "int32"}}}},
                            "argument": {
                              "application": {
                                "function": {"application": {"function": {"variable": "hydra.core.extract.model.literal"}, "argument": {"variable": "graph"}}},
                                "argument": {"variable": "t"}}}}},
                        "argument": {
                          "lambda": {
                            "parameter": "l",
                            "domain": {"variable": "hydra.core.model.Literal"},
                            "body": {
                              "application": {
                                "function": {
                                  "application": {
                                    "function": {
                                      "typeApplication": {
                                        "body": {
                                          "typeApplication": {
                                            "body": {
                                              "typeApplication": {"body": {"variable": "hydra.core.lib.eithers.bind"}, "type": {"variable": "hydra.core.errors.Error"}}},
                                            "type": {"variable": "hydra.core.model.IntegerValue"}}},
                                        "type": {"literal": {"integer": "int32"}}}},
                                    "argument": {"application": {"function": {"variable": "hydra.core.extract.model.integerLiteral"}, "argument": {"variable": "l"}}}}},
                                "argument": {
                                  "lambda": {
                                    "parameter": "i",
                                    "domain": {"variable": "hydra.core.model.IntegerValue"},
                                    "body": {"application": {"function": {"variable": "hydra.core.extract.model.int32Value"}, "argument": {"variable": "i"}}}}}}}}}}}}}}},
            "annotation": {
              "map": [
                {
                  "key": {"variable": "description"},
                  "value": {"literal": {"string": "Extract a 32-bit signed integer value from a term"}}}]}}}}},
    {
      "term": {
        "name": "hydra.core.extract.model.int32Value",
        "signature": {
          "typeParameters": [],
          "parameters": [{"name": "arg0", "type": {"variable": "hydra.core.model.IntegerValue"}, "isLazy": false}],
          "result": {"type": {"either": {"left": {"variable": "hydra.core.errors.Error"}, "right": {"literal": {"integer": "int32"}}}}}},
        "body": {
          "annotated": {
            "body": {
              "lambda": {
                "parameter": "v",
                "domain": {"variable": "hydra.core.model.IntegerValue"},
                "body": {
                  "application": {
                    "function": {
                      "cases": {
                        "typeName": "hydra.core.model.IntegerValue",
                        "default": {
                          "typeApplication": {
                            "body": {
                              "typeApplication": {
                                "body": {
                                  "either": {
                                    "left": {
                                      "inject": {
                                        "typeName": "hydra.core.errors.Error",
                                        "field": {
                                          "name": "extraction",
                                          "term": {
                                            "inject": {
                                              "typeName": "hydra.core.errors.ExtractionError",
                                              "field": {
                                                "name": "unexpectedShape",
                                                "term": {
                                                  "record": {
                                                    "typeName": "hydra.core.errors.UnexpectedShapeError",
                                                    "fields": [
                                                      {"name": "expected", "term": {"literal": {"string": "int32"}}},
                                                      {
                                                        "name": "actual",
                                                        "term": {"application": {"function": {"variable": "hydra.core.print.model.integer"}, "argument": {"variable": "v"}}}}]}}}}}}}}}},
                                "type": {"variable": "hydra.core.errors.Error"}}},
                            "type": {"literal": {"integer": "int32"}}}},
                        "cases": [
                          {
                            "name": "int32",
                            "handler": {
                              "lambda": {
                                "parameter": "i",
                                "domain": {"literal": {"integer": "int32"}},
                                "body": {
                                  "typeApplication": {
                                    "body": {"typeApplication": {"body": {"either": {"right": {"variable": "i"}}}, "type": {"variable": "hydra.core.errors.Error"}}},
                                    "type": {"literal": {"integer": "int32"}}}}}}}]}},
                    "argument": {"variable": "v"}}}}},
            "annotation": {
              "map": [{"key": {"variable": "description"}, "value": {"literal": {"string": "Extract an int32 value from an IntegerValue"}}}]}}}}},
    {
      "term": {
        "name": "hydra.core.extract.model.int64",
        "signature": {
          "typeParameters": [],
          "parameters": [
            {"name": "arg0", "type": {"variable": "hydra.core.graph.Graph"}, "isLazy": false},
            {"name": "arg1", "type": {"variable": "hydra.core.model.Term"}, "isLazy": false}],
          "result": {"type": {"either": {"left": {"variable": "hydra.core.errors.Error"}, "right": {"literal": {"integer": "int64"}}}}}},
        "body": {
          "annotated": {
            "body": {
              "lambda": {
                "parameter": "graph",
                "domain": {"variable": "hydra.core.graph.Graph"},
                "body": {
                  "lambda": {
                    "parameter": "t",
                    "domain": {"variable": "hydra.core.model.Term"},
                    "body": {
                      "application": {
                        "function": {
                          "application": {
                            "function": {
                              "typeApplication": {
                                "body": {
                                  "typeApplication": {
                                    "body": {
                                      "typeApplication": {"body": {"variable": "hydra.core.lib.eithers.bind"}, "type": {"variable": "hydra.core.errors.Error"}}},
                                    "type": {"variable": "hydra.core.model.Literal"}}},
                                "type": {"literal": {"integer": "int64"}}}},
                            "argument": {
                              "application": {
                                "function": {"application": {"function": {"variable": "hydra.core.extract.model.literal"}, "argument": {"variable": "graph"}}},
                                "argument": {"variable": "t"}}}}},
                        "argument": {
                          "lambda": {
                            "parameter": "l",
                            "domain": {"variable": "hydra.core.model.Literal"},
                            "body": {
                              "application": {
                                "function": {
                                  "application": {
                                    "function": {
                                      "typeApplication": {
                                        "body": {
                                          "typeApplication": {
                                            "body": {
                                              "typeApplication": {"body": {"variable": "hydra.core.lib.eithers.bind"}, "type": {"variable": "hydra.core.errors.Error"}}},
                                            "type": {"variable": "hydra.core.model.IntegerValue"}}},
                                        "type": {"literal": {"integer": "int64"}}}},
                                    "argument": {"application": {"function": {"variable": "hydra.core.extract.model.integerLiteral"}, "argument": {"variable": "l"}}}}},
                                "argument": {
                                  "lambda": {
                                    "parameter": "i",
                                    "domain": {"variable": "hydra.core.model.IntegerValue"},
                                    "body": {"application": {"function": {"variable": "hydra.core.extract.model.int64Value"}, "argument": {"variable": "i"}}}}}}}}}}}}}}},
            "annotation": {
              "map": [
                {
                  "key": {"variable": "description"},
                  "value": {"literal": {"string": "Extract a 64-bit signed integer value from a term"}}}]}}}}},
    {
      "term": {
        "name": "hydra.core.extract.model.int64Value",
        "signature": {
          "typeParameters": [],
          "parameters": [{"name": "arg0", "type": {"variable": "hydra.core.model.IntegerValue"}, "isLazy": false}],
          "result": {"type": {"either": {"left": {"variable": "hydra.core.errors.Error"}, "right": {"literal": {"integer": "int64"}}}}}},
        "body": {
          "annotated": {
            "body": {
              "lambda": {
                "parameter": "v",
                "domain": {"variable": "hydra.core.model.IntegerValue"},
                "body": {
                  "application": {
                    "function": {
                      "cases": {
                        "typeName": "hydra.core.model.IntegerValue",
                        "default": {
                          "typeApplication": {
                            "body": {
                              "typeApplication": {
                                "body": {
                                  "either": {
                                    "left": {
                                      "inject": {
                                        "typeName": "hydra.core.errors.Error",
                                        "field": {
                                          "name": "extraction",
                                          "term": {
                                            "inject": {
                                              "typeName": "hydra.core.errors.ExtractionError",
                                              "field": {
                                                "name": "unexpectedShape",
                                                "term": {
                                                  "record": {
                                                    "typeName": "hydra.core.errors.UnexpectedShapeError",
                                                    "fields": [
                                                      {"name": "expected", "term": {"literal": {"string": "int64"}}},
                                                      {
                                                        "name": "actual",
                                                        "term": {"application": {"function": {"variable": "hydra.core.print.model.integer"}, "argument": {"variable": "v"}}}}]}}}}}}}}}},
                                "type": {"variable": "hydra.core.errors.Error"}}},
                            "type": {"literal": {"integer": "int64"}}}},
                        "cases": [
                          {
                            "name": "int64",
                            "handler": {
                              "lambda": {
                                "parameter": "i",
                                "domain": {"literal": {"integer": "int64"}},
                                "body": {
                                  "typeApplication": {
                                    "body": {"typeApplication": {"body": {"either": {"right": {"variable": "i"}}}, "type": {"variable": "hydra.core.errors.Error"}}},
                                    "type": {"literal": {"integer": "int64"}}}}}}}]}},
                    "argument": {"variable": "v"}}}}},
            "annotation": {
              "map": [{"key": {"variable": "description"}, "value": {"literal": {"string": "Extract an int64 value from an IntegerValue"}}}]}}}}},
    {
      "term": {
        "name": "hydra.core.extract.model.int8",
        "signature": {
          "typeParameters": [],
          "parameters": [
            {"name": "arg0", "type": {"variable": "hydra.core.graph.Graph"}, "isLazy": false},
            {"name": "arg1", "type": {"variable": "hydra.core.model.Term"}, "isLazy": false}],
          "result": {"type": {"either": {"left": {"variable": "hydra.core.errors.Error"}, "right": {"literal": {"integer": "int8"}}}}}},
        "body": {
          "annotated": {
            "body": {
              "lambda": {
                "parameter": "graph",
                "domain": {"variable": "hydra.core.graph.Graph"},
                "body": {
                  "lambda": {
                    "parameter": "t",
                    "domain": {"variable": "hydra.core.model.Term"},
                    "body": {
                      "application": {
                        "function": {
                          "application": {
                            "function": {
                              "typeApplication": {
                                "body": {
                                  "typeApplication": {
                                    "body": {
                                      "typeApplication": {"body": {"variable": "hydra.core.lib.eithers.bind"}, "type": {"variable": "hydra.core.errors.Error"}}},
                                    "type": {"variable": "hydra.core.model.Literal"}}},
                                "type": {"literal": {"integer": "int8"}}}},
                            "argument": {
                              "application": {
                                "function": {"application": {"function": {"variable": "hydra.core.extract.model.literal"}, "argument": {"variable": "graph"}}},
                                "argument": {"variable": "t"}}}}},
                        "argument": {
                          "lambda": {
                            "parameter": "l",
                            "domain": {"variable": "hydra.core.model.Literal"},
                            "body": {
                              "application": {
                                "function": {
                                  "application": {
                                    "function": {
                                      "typeApplication": {
                                        "body": {
                                          "typeApplication": {
                                            "body": {
                                              "typeApplication": {"body": {"variable": "hydra.core.lib.eithers.bind"}, "type": {"variable": "hydra.core.errors.Error"}}},
                                            "type": {"variable": "hydra.core.model.IntegerValue"}}},
                                        "type": {"literal": {"integer": "int8"}}}},
                                    "argument": {"application": {"function": {"variable": "hydra.core.extract.model.integerLiteral"}, "argument": {"variable": "l"}}}}},
                                "argument": {
                                  "lambda": {
                                    "parameter": "i",
                                    "domain": {"variable": "hydra.core.model.IntegerValue"},
                                    "body": {"application": {"function": {"variable": "hydra.core.extract.model.int8Value"}, "argument": {"variable": "i"}}}}}}}}}}}}}}},
            "annotation": {
              "map": [
                {
                  "key": {"variable": "description"},
                  "value": {"literal": {"string": "Extract an 8-bit signed integer value from a term"}}}]}}}}},
    {
      "term": {
        "name": "hydra.core.extract.model.int8Value",
        "signature": {
          "typeParameters": [],
          "parameters": [{"name": "arg0", "type": {"variable": "hydra.core.model.IntegerValue"}, "isLazy": false}],
          "result": {"type": {"either": {"left": {"variable": "hydra.core.errors.Error"}, "right": {"literal": {"integer": "int8"}}}}}},
        "body": {
          "annotated": {
            "body": {
              "lambda": {
                "parameter": "v",
                "domain": {"variable": "hydra.core.model.IntegerValue"},
                "body": {
                  "application": {
                    "function": {
                      "cases": {
                        "typeName": "hydra.core.model.IntegerValue",
                        "default": {
                          "typeApplication": {
                            "body": {
                              "typeApplication": {
                                "body": {
                                  "either": {
                                    "left": {
                                      "inject": {
                                        "typeName": "hydra.core.errors.Error",
                                        "field": {
                                          "name": "extraction",
                                          "term": {
                                            "inject": {
                                              "typeName": "hydra.core.errors.ExtractionError",
                                              "field": {
                                                "name": "unexpectedShape",
                                                "term": {
                                                  "record": {
                                                    "typeName": "hydra.core.errors.UnexpectedShapeError",
                                                    "fields": [
                                                      {"name": "expected", "term": {"literal": {"string": "int8"}}},
                                                      {
                                                        "name": "actual",
                                                        "term": {"application": {"function": {"variable": "hydra.core.print.model.integer"}, "argument": {"variable": "v"}}}}]}}}}}}}}}},
                                "type": {"variable": "hydra.core.errors.Error"}}},
                            "type": {"literal": {"integer": "int8"}}}},
                        "cases": [
                          {
                            "name": "int8",
                            "handler": {
                              "lambda": {
                                "parameter": "i",
                                "domain": {"literal": {"integer": "int8"}},
                                "body": {
                                  "typeApplication": {
                                    "body": {"typeApplication": {"body": {"either": {"right": {"variable": "i"}}}, "type": {"variable": "hydra.core.errors.Error"}}},
                                    "type": {"literal": {"integer": "int8"}}}}}}}]}},
                    "argument": {"variable": "v"}}}}},
            "annotation": {
              "map": [{"key": {"variable": "description"}, "value": {"literal": {"string": "Extract an int8 value from an IntegerValue"}}}]}}}}},
    {
      "term": {
        "name": "hydra.core.extract.model.integerLiteral",
        "signature": {
          "typeParameters": [],
          "parameters": [{"name": "arg0", "type": {"variable": "hydra.core.model.Literal"}, "isLazy": false}],
          "result": {
            "type": {"either": {"left": {"variable": "hydra.core.errors.Error"}, "right": {"variable": "hydra.core.model.IntegerValue"}}}}},
        "body": {
          "annotated": {
            "body": {
              "lambda": {
                "parameter": "lit",
                "domain": {"variable": "hydra.core.model.Literal"},
                "body": {
                  "application": {
                    "function": {
                      "cases": {
                        "typeName": "hydra.core.model.Literal",
                        "default": {
                          "typeApplication": {
                            "body": {
                              "typeApplication": {
                                "body": {
                                  "either": {
                                    "left": {
                                      "inject": {
                                        "typeName": "hydra.core.errors.Error",
                                        "field": {
                                          "name": "extraction",
                                          "term": {
                                            "inject": {
                                              "typeName": "hydra.core.errors.ExtractionError",
                                              "field": {
                                                "name": "unexpectedShape",
                                                "term": {
                                                  "record": {
                                                    "typeName": "hydra.core.errors.UnexpectedShapeError",
                                                    "fields": [
                                                      {"name": "expected", "term": {"literal": {"string": "integer value"}}},
                                                      {
                                                        "name": "actual",
                                                        "term": {"application": {"function": {"variable": "hydra.core.print.model.literal"}, "argument": {"variable": "lit"}}}}]}}}}}}}}}},
                                "type": {"variable": "hydra.core.errors.Error"}}},
                            "type": {"variable": "hydra.core.model.IntegerValue"}}},
                        "cases": [
                          {
                            "name": "integer",
                            "handler": {
                              "lambda": {
                                "parameter": "v",
                                "domain": {"variable": "hydra.core.model.IntegerValue"},
                                "body": {
                                  "typeApplication": {
                                    "body": {"typeApplication": {"body": {"either": {"right": {"variable": "v"}}}, "type": {"variable": "hydra.core.errors.Error"}}},
                                    "type": {"variable": "hydra.core.model.IntegerValue"}}}}}}]}},
                    "argument": {"variable": "lit"}}}}},
            "annotation": {
              "map": [
                {
                  "key": {"variable": "description"},
                  "value": {"literal": {"string": "Extract an integer literal from a Literal value"}}}]}}}}},
    {
      "term": {
        "name": "hydra.core.extract.model.integerValue",
        "signature": {
          "typeParameters": [],
          "parameters": [
            {"name": "arg0", "type": {"variable": "hydra.core.graph.Graph"}, "isLazy": false},
            {"name": "arg1", "type": {"variable": "hydra.core.model.Term"}, "isLazy": false}],
          "result": {
            "type": {"either": {"left": {"variable": "hydra.core.errors.Error"}, "right": {"variable": "hydra.core.model.IntegerValue"}}}}},
        "body": {
          "annotated": {
            "body": {
              "lambda": {
                "parameter": "graph",
                "domain": {"variable": "hydra.core.graph.Graph"},
                "body": {
                  "lambda": {
                    "parameter": "t",
                    "domain": {"variable": "hydra.core.model.Term"},
                    "body": {
                      "application": {
                        "function": {
                          "application": {
                            "function": {
                              "typeApplication": {
                                "body": {
                                  "typeApplication": {
                                    "body": {
                                      "typeApplication": {"body": {"variable": "hydra.core.lib.eithers.bind"}, "type": {"variable": "hydra.core.errors.Error"}}},
                                    "type": {"variable": "hydra.core.model.Literal"}}},
                                "type": {"variable": "hydra.core.model.IntegerValue"}}},
                            "argument": {
                              "application": {
                                "function": {"application": {"function": {"variable": "hydra.core.extract.model.literal"}, "argument": {"variable": "graph"}}},
                                "argument": {"variable": "t"}}}}},
                        "argument": {
                          "lambda": {
                            "parameter": "l",
                            "domain": {"variable": "hydra.core.model.Literal"},
                            "body": {"application": {"function": {"variable": "hydra.core.extract.model.integerLiteral"}, "argument": {"variable": "l"}}}}}}}}}}},
            "annotation": {
              "map": [{"key": {"variable": "description"}, "value": {"literal": {"string": "Extract an integer value from a term"}}}]}}}}},
    {
      "term": {
        "name": "hydra.core.extract.model.lambda",
        "signature": {
          "typeParameters": [],
          "parameters": [
            {"name": "arg0", "type": {"variable": "hydra.core.graph.Graph"}, "isLazy": false},
            {"name": "arg1", "type": {"variable": "hydra.core.model.Term"}, "isLazy": false}],
          "result": {
            "type": {"either": {"left": {"variable": "hydra.core.errors.Error"}, "right": {"variable": "hydra.core.model.Lambda"}}}}},
        "body": {
          "annotated": {
            "body": {
              "lambda": {
                "parameter": "graph",
                "domain": {"variable": "hydra.core.graph.Graph"},
                "body": {
                  "lambda": {
                    "parameter": "term0",
                    "domain": {"variable": "hydra.core.model.Term"},
                    "body": {
                      "application": {
                        "function": {
                          "application": {
                            "function": {
                              "typeApplication": {
                                "body": {
                                  "typeApplication": {
                                    "body": {
                                      "typeApplication": {"body": {"variable": "hydra.core.lib.eithers.bind"}, "type": {"variable": "hydra.core.errors.Error"}}},
                                    "type": {"variable": "hydra.core.model.Term"}}},
                                "type": {"variable": "hydra.core.model.Lambda"}}},
                            "argument": {
                              "application": {
                                "function": {
                                  "application": {"function": {"variable": "hydra.core.lexical.stripAndDereferenceTerm"}, "argument": {"variable": "graph"}}},
                                "argument": {"variable": "term0"}}}}},
                        "argument": {
                          "lambda": {
                            "parameter": "term",
                            "domain": {"variable": "hydra.core.model.Term"},
                            "body": {
                              "application": {
                                "function": {
                                  "cases": {
                                    "typeName": "hydra.core.model.Term",
                                    "default": {
                                      "typeApplication": {
                                        "body": {
                                          "typeApplication": {
                                            "body": {
                                              "either": {
                                                "left": {
                                                  "inject": {
                                                    "typeName": "hydra.core.errors.Error",
                                                    "field": {
                                                      "name": "extraction",
                                                      "term": {
                                                        "inject": {
                                                          "typeName": "hydra.core.errors.ExtractionError",
                                                          "field": {
                                                            "name": "unexpectedShape",
                                                            "term": {
                                                              "record": {
                                                                "typeName": "hydra.core.errors.UnexpectedShapeError",
                                                                "fields": [
                                                                  {"name": "expected", "term": {"literal": {"string": "lambda"}}},
                                                                  {
                                                                    "name": "actual",
                                                                    "term": {"application": {"function": {"variable": "hydra.core.print.model.term"}, "argument": {"variable": "term"}}}}]}}}}}}}}}},
                                            "type": {"variable": "hydra.core.errors.Error"}}},
                                        "type": {"variable": "hydra.core.model.Lambda"}}},
                                    "cases": [
                                      {
                                        "name": "lambda",
                                        "handler": {
                                          "lambda": {
                                            "parameter": "l",
                                            "domain": {"variable": "hydra.core.model.Lambda"},
                                            "body": {
                                              "typeApplication": {
                                                "body": {"typeApplication": {"body": {"either": {"right": {"variable": "l"}}}, "type": {"variable": "hydra.core.errors.Error"}}},
                                                "type": {"variable": "hydra.core.model.Lambda"}}}}}}]}},
                                "argument": {"variable": "term"}}}}}}}}}}},
            "annotation": {"map": [{"key": {"variable": "description"}, "value": {"literal": {"string": "Extract a lambda from a term"}}}]}}}}},
    {
      "term": {
        "name": "hydra.core.extract.model.lambdaBody",
        "signature": {
          "typeParameters": [],
          "parameters": [
            {"name": "arg0", "type": {"variable": "hydra.core.graph.Graph"}, "isLazy": false},
            {"name": "arg1", "type": {"variable": "hydra.core.model.Term"}, "isLazy": false}],
          "result": {"type": {"either": {"left": {"variable": "hydra.core.errors.Error"}, "right": {"variable": "hydra.core.model.Term"}}}}},
        "body": {
          "annotated": {
            "body": {
              "lambda": {
                "parameter": "graph",
                "domain": {"variable": "hydra.core.graph.Graph"},
                "body": {
                  "lambda": {
                    "parameter": "term",
                    "domain": {"variable": "hydra.core.model.Term"},
                    "body": {
                      "application": {
                        "function": {
                          "application": {
                            "function": {
                              "typeApplication": {
                                "body": {
                                  "typeApplication": {
                                    "body": {
                                      "typeApplication": {"body": {"variable": "hydra.core.lib.eithers.map"}, "type": {"variable": "hydra.core.model.Lambda"}}},
                                    "type": {"variable": "hydra.core.model.Term"}}},
                                "type": {"variable": "hydra.core.errors.Error"}}},
                            "argument": {"project": {"typeName": "hydra.core.model.Lambda", "fieldName": "body"}}}},
                        "argument": {
                          "application": {
                            "function": {"application": {"function": {"variable": "hydra.core.extract.model.lambda"}, "argument": {"variable": "graph"}}},
                            "argument": {"variable": "term"}}}}}}}}},
            "annotation": {"map": [{"key": {"variable": "description"}, "value": {"literal": {"string": "Extract the body of a lambda term"}}}]}}}}},
    {
      "term": {
        "name": "hydra.core.extract.model.let",
        "signature": {
          "typeParameters": [],
          "parameters": [
            {"name": "arg0", "type": {"variable": "hydra.core.graph.Graph"}, "isLazy": false},
            {"name": "arg1", "type": {"variable": "hydra.core.model.Term"}, "isLazy": false}],
          "result": {"type": {"either": {"left": {"variable": "hydra.core.errors.Error"}, "right": {"variable": "hydra.core.model.Let"}}}}},
        "body": {
          "annotated": {
            "body": {
              "lambda": {
                "parameter": "graph",
                "domain": {"variable": "hydra.core.graph.Graph"},
                "body": {
                  "lambda": {
                    "parameter": "term0",
                    "domain": {"variable": "hydra.core.model.Term"},
                    "body": {
                      "application": {
                        "function": {
                          "application": {
                            "function": {
                              "typeApplication": {
                                "body": {
                                  "typeApplication": {
                                    "body": {
                                      "typeApplication": {"body": {"variable": "hydra.core.lib.eithers.bind"}, "type": {"variable": "hydra.core.errors.Error"}}},
                                    "type": {"variable": "hydra.core.model.Term"}}},
                                "type": {"variable": "hydra.core.model.Let"}}},
                            "argument": {
                              "application": {
                                "function": {
                                  "application": {"function": {"variable": "hydra.core.lexical.stripAndDereferenceTerm"}, "argument": {"variable": "graph"}}},
                                "argument": {"variable": "term0"}}}}},
                        "argument": {
                          "lambda": {
                            "parameter": "term",
                            "domain": {"variable": "hydra.core.model.Term"},
                            "body": {
                              "application": {
                                "function": {
                                  "cases": {
                                    "typeName": "hydra.core.model.Term",
                                    "default": {
                                      "typeApplication": {
                                        "body": {
                                          "typeApplication": {
                                            "body": {
                                              "either": {
                                                "left": {
                                                  "inject": {
                                                    "typeName": "hydra.core.errors.Error",
                                                    "field": {
                                                      "name": "extraction",
                                                      "term": {
                                                        "inject": {
                                                          "typeName": "hydra.core.errors.ExtractionError",
                                                          "field": {
                                                            "name": "unexpectedShape",
                                                            "term": {
                                                              "record": {
                                                                "typeName": "hydra.core.errors.UnexpectedShapeError",
                                                                "fields": [
                                                                  {"name": "expected", "term": {"literal": {"string": "let term"}}},
                                                                  {
                                                                    "name": "actual",
                                                                    "term": {"application": {"function": {"variable": "hydra.core.print.model.term"}, "argument": {"variable": "term"}}}}]}}}}}}}}}},
                                            "type": {"variable": "hydra.core.errors.Error"}}},
                                        "type": {"variable": "hydra.core.model.Let"}}},
                                    "cases": [
                                      {
                                        "name": "let",
                                        "handler": {
                                          "lambda": {
                                            "parameter": "lt",
                                            "domain": {"variable": "hydra.core.model.Let"},
                                            "body": {
                                              "typeApplication": {
                                                "body": {
                                                  "typeApplication": {"body": {"either": {"right": {"variable": "lt"}}}, "type": {"variable": "hydra.core.errors.Error"}}},
                                                "type": {"variable": "hydra.core.model.Let"}}}}}}]}},
                                "argument": {"variable": "term"}}}}}}}}}}},
            "annotation": {
              "map": [{"key": {"variable": "description"}, "value": {"literal": {"string": "Extract a let expression from a term"}}}]}}}}},
    {
      "term": {
        "name": "hydra.core.extract.model.letBinding",
        "signature": {
          "typeParameters": [],
          "parameters": [
            {"name": "arg0", "type": {"literal": "string"}, "isLazy": false},
            {"name": "arg1", "type": {"variable": "hydra.core.graph.Graph"}, "isLazy": false},
            {"name": "arg2", "type": {"variable": "hydra.core.model.Term"}, "isLazy": false}],
          "result": {"type": {"either": {"left": {"variable": "hydra.core.errors.Error"}, "right": {"variable": "hydra.core.model.Term"}}}}},
        "body": {
          "annotated": {
            "body": {
              "lambda": {
                "parameter": "n",
                "domain": {"literal": "string"},
                "body": {
                  "lambda": {
                    "parameter": "graph",
                    "domain": {"variable": "hydra.core.graph.Graph"},
                    "body": {
                      "lambda": {
                        "parameter": "term",
                        "domain": {"variable": "hydra.core.model.Term"},
                        "body": {
                          "let": {
                            "bindings": [
                              {
                                "name": "name",
                                "term": {"wrap": {"typeName": "hydra.core.model.Name", "body": {"variable": "n"}}},
                                "typeScheme": {"variables": [], "body": {"variable": "hydra.core.model.Name"}, "constraints": []}}],
                            "body": {
                              "application": {
                                "function": {
                                  "application": {
                                    "function": {
                                      "typeApplication": {
                                        "body": {
                                          "typeApplication": {
                                            "body": {
                                              "typeApplication": {"body": {"variable": "hydra.core.lib.eithers.bind"}, "type": {"variable": "hydra.core.errors.Error"}}},
                                            "type": {"variable": "hydra.core.model.Let"}}},
                                        "type": {"variable": "hydra.core.model.Term"}}},
                                    "argument": {
                                      "application": {
                                        "function": {"application": {"function": {"variable": "hydra.core.extract.model.let"}, "argument": {"variable": "graph"}}},
                                        "argument": {"variable": "term"}}}}},
                                "argument": {
                                  "lambda": {
                                    "parameter": "letExpr",
                                    "domain": {"variable": "hydra.core.model.Let"},
                                    "body": {
                                      "let": {
                                        "bindings": [
                                          {
                                            "name": "matchingBindings",
                                            "term": {
                                              "application": {
                                                "function": {
                                                  "application": {
                                                    "function": {
                                                      "typeApplication": {"body": {"variable": "hydra.core.lib.lists.filter"}, "type": {"variable": "hydra.core.model.Binding"}}},
                                                    "argument": {
                                                      "lambda": {
                                                        "parameter": "b",
                                                        "domain": {"variable": "hydra.core.model.Binding"},
                                                        "body": {
                                                          "application": {
                                                            "function": {
                                                              "application": {
                                                                "function": {"typeApplication": {"body": {"variable": "hydra.core.lib.equality.equal"}, "type": {"literal": "string"}}},
                                                                "argument": {
                                                                  "application": {
                                                                    "function": {"unwrap": "hydra.core.model.Name"},
                                                                    "argument": {
                                                                      "application": {"function": {"project": {"typeName": "hydra.core.model.Binding", "fieldName": "name"}}, "argument": {"variable": "b"}}}}}}},
                                                            "argument": {"application": {"function": {"unwrap": "hydra.core.model.Name"}, "argument": {"variable": "name"}}}}}}}}},
                                                "argument": {
                                                  "application": {
                                                    "function": {"project": {"typeName": "hydra.core.model.Let", "fieldName": "bindings"}},
                                                    "argument": {"variable": "letExpr"}}}}},
                                            "typeScheme": {"variables": [], "body": {"list": {"variable": "hydra.core.model.Binding"}}, "constraints": []}}],
                                        "body": {
                                          "let": {
                                            "bindings": [
                                              {
                                                "name": "noBindingErr",
                                                "term": {
                                                  "typeLambda": {
                                                    "parameter": "t0",
                                                    "body": {
                                                      "typeApplication": {
                                                        "body": {
                                                          "typeApplication": {
                                                            "body": {
                                                              "either": {
                                                                "left": {
                                                                  "inject": {
                                                                    "typeName": "hydra.core.errors.Error",
                                                                    "field": {
                                                                      "name": "extraction",
                                                                      "term": {
                                                                        "inject": {
                                                                          "typeName": "hydra.core.errors.ExtractionError",
                                                                          "field": {
                                                                            "name": "noSuchBinding",
                                                                            "term": {
                                                                              "record": {"typeName": "hydra.core.errors.NoSuchBindingError", "fields": [{"name": "name", "term": {"variable": "name"}}]}}}}}}}}}},
                                                            "type": {"variable": "hydra.core.errors.Error"}}},
                                                        "type": {"variable": "t0"}}}}},
                                                "typeScheme": {
                                                  "variables": ["t0"],
                                                  "body": {"either": {"left": {"variable": "hydra.core.errors.Error"}, "right": {"variable": "t0"}}},
                                                  "constraints": []}}],
                                            "body": {
                                              "application": {
                                                "function": {
                                                  "application": {
                                                    "function": {
                                                      "application": {
                                                        "function": {
                                                          "typeApplication": {
                                                            "body": {"variable": "hydra.core.lib.logic.ifElse"},
                                                            "type": {"either": {"left": {"variable": "hydra.core.errors.Error"}, "right": {"variable": "hydra.core.model.Term"}}}}},
                                                        "argument": {
                                                          "application": {
                                                            "function": {
                                                              "typeApplication": {"body": {"variable": "hydra.core.lib.lists.isEmpty"}, "type": {"variable": "hydra.core.model.Binding"}}},
                                                            "argument": {"variable": "matchingBindings"}}}}},
                                                    "argument": {"typeApplication": {"body": {"variable": "noBindingErr"}, "type": {"variable": "hydra.core.model.Term"}}}}},
                                                "argument": {
                                                  "application": {
                                                    "function": {
                                                      "application": {
                                                        "function": {
                                                          "application": {
                                                            "function": {
                                                              "typeApplication": {
                                                                "body": {"variable": "hydra.core.lib.logic.ifElse"},
                                                                "type": {"either": {"left": {"variable": "hydra.core.errors.Error"}, "right": {"variable": "hydra.core.model.Term"}}}}},
                                                            "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.Binding"}}},
                                                                        "argument": {"variable": "matchingBindings"}}}}},
                                                                "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.Binding"}}},
                                                                        "type": {"either": {"left": {"variable": "hydra.core.errors.Error"}, "right": {"variable": "hydra.core.model.Term"}}}}},
                                                                    "argument": {
                                                                      "application": {
                                                                        "function": {
                                                                          "typeApplication": {"body": {"variable": "hydra.core.lib.lists.head"}, "type": {"variable": "hydra.core.model.Binding"}}},
                                                                        "argument": {"variable": "matchingBindings"}}}}},
                                                                "argument": {"typeApplication": {"body": {"variable": "noBindingErr"}, "type": {"variable": "hydra.core.model.Term"}}}}},
                                                            "argument": {
                                                              "lambda": {
                                                                "parameter": "b",
                                                                "domain": {"variable": "hydra.core.model.Binding"},
                                                                "body": {
                                                                  "typeApplication": {
                                                                    "body": {
                                                                      "typeApplication": {
                                                                        "body": {
                                                                          "either": {
                                                                            "right": {
                                                                              "application": {"function": {"project": {"typeName": "hydra.core.model.Binding", "fieldName": "term"}}, "argument": {"variable": "b"}}}}},
                                                                        "type": {"variable": "hydra.core.errors.Error"}}},
                                                                    "type": {"variable": "hydra.core.model.Term"}}}}}}}}},
                                                    "argument": {
                                                      "typeApplication": {
                                                        "body": {
                                                          "typeApplication": {
                                                            "body": {
                                                              "either": {
                                                                "left": {
                                                                  "inject": {
                                                                    "typeName": "hydra.core.errors.Error",
                                                                    "field": {
                                                                      "name": "extraction",
                                                                      "term": {
                                                                        "inject": {
                                                                          "typeName": "hydra.core.errors.ExtractionError",
                                                                          "field": {
                                                                            "name": "multipleBindings",
                                                                            "term": {
                                                                              "record": {"typeName": "hydra.core.errors.MultipleBindingsError", "fields": [{"name": "name", "term": {"variable": "name"}}]}}}}}}}}}},
                                                            "type": {"variable": "hydra.core.errors.Error"}}},
                                                        "type": {"variable": "hydra.core.model.Term"}}}}}}}}}}}}}}}}}}}}}}},
            "annotation": {
              "map": [
                {
                  "key": {"variable": "description"},
                  "value": {"literal": {"string": "Extract a binding with the given name from a let term"}}}]}}}}},
    {
      "term": {
        "name": "hydra.core.extract.model.list",
        "signature": {
          "typeParameters": [],
          "parameters": [
            {"name": "arg0", "type": {"variable": "hydra.core.graph.Graph"}, "isLazy": false},
            {"name": "arg1", "type": {"variable": "hydra.core.model.Term"}, "isLazy": false}],
          "result": {
            "type": {"either": {"left": {"variable": "hydra.core.errors.Error"}, "right": {"list": {"variable": "hydra.core.model.Term"}}}}}},
        "body": {
          "annotated": {
            "body": {
              "lambda": {
                "parameter": "graph",
                "domain": {"variable": "hydra.core.graph.Graph"},
                "body": {
                  "lambda": {
                    "parameter": "term",
                    "domain": {"variable": "hydra.core.model.Term"},
                    "body": {
                      "application": {
                        "function": {
                          "application": {
                            "function": {
                              "typeApplication": {
                                "body": {
                                  "typeApplication": {
                                    "body": {
                                      "typeApplication": {"body": {"variable": "hydra.core.lib.eithers.bind"}, "type": {"variable": "hydra.core.errors.Error"}}},
                                    "type": {"variable": "hydra.core.model.Term"}}},
                                "type": {"list": {"variable": "hydra.core.model.Term"}}}},
                            "argument": {
                              "application": {
                                "function": {
                                  "application": {"function": {"variable": "hydra.core.lexical.stripAndDereferenceTerm"}, "argument": {"variable": "graph"}}},
                                "argument": {"variable": "term"}}}}},
                        "argument": {
                          "lambda": {
                            "parameter": "stripped",
                            "domain": {"variable": "hydra.core.model.Term"},
                            "body": {
                              "application": {
                                "function": {
                                  "cases": {
                                    "typeName": "hydra.core.model.Term",
                                    "default": {
                                      "typeApplication": {
                                        "body": {
                                          "typeApplication": {
                                            "body": {
                                              "either": {
                                                "left": {
                                                  "inject": {
                                                    "typeName": "hydra.core.errors.Error",
                                                    "field": {
                                                      "name": "extraction",
                                                      "term": {
                                                        "inject": {
                                                          "typeName": "hydra.core.errors.ExtractionError",
                                                          "field": {
                                                            "name": "unexpectedShape",
                                                            "term": {
                                                              "record": {
                                                                "typeName": "hydra.core.errors.UnexpectedShapeError",
                                                                "fields": [
                                                                  {"name": "expected", "term": {"literal": {"string": "list"}}},
                                                                  {
                                                                    "name": "actual",
                                                                    "term": {"application": {"function": {"variable": "hydra.core.print.model.term"}, "argument": {"variable": "stripped"}}}}]}}}}}}}}}},
                                            "type": {"variable": "hydra.core.errors.Error"}}},
                                        "type": {"list": {"variable": "hydra.core.model.Term"}}}},
                                    "cases": [
                                      {
                                        "name": "list",
                                        "handler": {
                                          "lambda": {
                                            "parameter": "l",
                                            "domain": {"list": {"variable": "hydra.core.model.Term"}},
                                            "body": {
                                              "typeApplication": {
                                                "body": {"typeApplication": {"body": {"either": {"right": {"variable": "l"}}}, "type": {"variable": "hydra.core.errors.Error"}}},
                                                "type": {"list": {"variable": "hydra.core.model.Term"}}}}}}}]}},
                                "argument": {"variable": "stripped"}}}}}}}}}}},
            "annotation": {"map": [{"key": {"variable": "description"}, "value": {"literal": {"string": "Extract a list of terms from a term"}}}]}}}}},
    {
      "term": {
        "name": "hydra.core.extract.model.listOf",
        "signature": {
          "typeParameters": [{"name": "t0", "constraints": []}],
          "parameters": [
            {
              "name": "arg0",
              "type": {
                "function": {
                  "domain": {"variable": "hydra.core.model.Term"},
                  "codomain": {"either": {"left": {"variable": "hydra.core.errors.Error"}, "right": {"variable": "t0"}}}}},
              "isLazy": false},
            {"name": "arg1", "type": {"variable": "hydra.core.graph.Graph"}, "isLazy": false},
            {"name": "arg2", "type": {"variable": "hydra.core.model.Term"}, "isLazy": false}],
          "result": {"type": {"either": {"left": {"variable": "hydra.core.errors.Error"}, "right": {"list": {"variable": "t0"}}}}}},
        "body": {
          "typeLambda": {
            "parameter": "t0",
            "body": {
              "annotated": {
                "body": {
                  "lambda": {
                    "parameter": "f",
                    "domain": {
                      "function": {
                        "domain": {"variable": "hydra.core.model.Term"},
                        "codomain": {"either": {"left": {"variable": "hydra.core.errors.Error"}, "right": {"variable": "t0"}}}}},
                    "body": {
                      "lambda": {
                        "parameter": "graph",
                        "domain": {"variable": "hydra.core.graph.Graph"},
                        "body": {
                          "lambda": {
                            "parameter": "term",
                            "domain": {"variable": "hydra.core.model.Term"},
                            "body": {
                              "application": {
                                "function": {
                                  "application": {
                                    "function": {
                                      "typeApplication": {
                                        "body": {
                                          "typeApplication": {
                                            "body": {
                                              "typeApplication": {"body": {"variable": "hydra.core.lib.eithers.bind"}, "type": {"variable": "hydra.core.errors.Error"}}},
                                            "type": {"list": {"variable": "hydra.core.model.Term"}}}},
                                        "type": {"list": {"variable": "t0"}}}},
                                    "argument": {
                                      "application": {
                                        "function": {"application": {"function": {"variable": "hydra.core.extract.model.list"}, "argument": {"variable": "graph"}}},
                                        "argument": {"variable": "term"}}}}},
                                "argument": {
                                  "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.mapList"}, "type": {"variable": "hydra.core.model.Term"}}},
                                                    "type": {"variable": "t0"}}},
                                                "type": {"variable": "hydra.core.errors.Error"}}},
                                            "argument": {"variable": "f"}}},
                                        "argument": {"variable": "els"}}}}}}}}}}}}},
                "annotation": {
                  "map": [
                    {
                      "key": {"variable": "description"},
                      "value": {"literal": {"string": "Extract a list of values from a term, mapping a function over each element"}}}]}}}}}}},
    {
      "term": {
        "name": "hydra.core.extract.model.listType",
        "signature": {
          "typeParameters": [],
          "parameters": [{"name": "arg0", "type": {"variable": "hydra.core.model.Type"}, "isLazy": false}],
          "result": {"type": {"either": {"left": {"variable": "hydra.core.errors.Error"}, "right": {"variable": "hydra.core.model.Type"}}}}},
        "body": {
          "annotated": {
            "body": {
              "lambda": {
                "parameter": "typ",
                "domain": {"variable": "hydra.core.model.Type"},
                "body": {
                  "let": {
                    "bindings": [
                      {
                        "name": "stripped",
                        "term": {"application": {"function": {"variable": "hydra.core.strip.deannotateType"}, "argument": {"variable": "typ"}}},
                        "typeScheme": {"variables": [], "body": {"variable": "hydra.core.model.Type"}, "constraints": []}}],
                    "body": {
                      "application": {
                        "function": {
                          "cases": {
                            "typeName": "hydra.core.model.Type",
                            "default": {
                              "typeApplication": {
                                "body": {
                                  "typeApplication": {
                                    "body": {
                                      "either": {
                                        "left": {
                                          "inject": {
                                            "typeName": "hydra.core.errors.Error",
                                            "field": {
                                              "name": "extraction",
                                              "term": {
                                                "inject": {
                                                  "typeName": "hydra.core.errors.ExtractionError",
                                                  "field": {
                                                    "name": "unexpectedShape",
                                                    "term": {
                                                      "record": {
                                                        "typeName": "hydra.core.errors.UnexpectedShapeError",
                                                        "fields": [
                                                          {"name": "expected", "term": {"literal": {"string": "list type"}}},
                                                          {
                                                            "name": "actual",
                                                            "term": {"application": {"function": {"variable": "hydra.core.print.model.type"}, "argument": {"variable": "typ"}}}}]}}}}}}}}}},
                                    "type": {"variable": "hydra.core.errors.Error"}}},
                                "type": {"variable": "hydra.core.model.Type"}}},
                            "cases": [
                              {
                                "name": "list",
                                "handler": {
                                  "lambda": {
                                    "parameter": "t",
                                    "domain": {"variable": "hydra.core.model.Type"},
                                    "body": {
                                      "typeApplication": {
                                        "body": {"typeApplication": {"body": {"either": {"right": {"variable": "t"}}}, "type": {"variable": "hydra.core.errors.Error"}}},
                                        "type": {"variable": "hydra.core.model.Type"}}}}}}]}},
                        "argument": {"variable": "stripped"}}}}}}},
            "annotation": {
              "map": [{"key": {"variable": "description"}, "value": {"literal": {"string": "Extract the element type from a list type"}}}]}}}}},
    {
      "term": {
        "name": "hydra.core.extract.model.literal",
        "signature": {
          "typeParameters": [],
          "parameters": [
            {"name": "arg0", "type": {"variable": "hydra.core.graph.Graph"}, "isLazy": false},
            {"name": "arg1", "type": {"variable": "hydra.core.model.Term"}, "isLazy": false}],
          "result": {
            "type": {"either": {"left": {"variable": "hydra.core.errors.Error"}, "right": {"variable": "hydra.core.model.Literal"}}}}},
        "body": {
          "annotated": {
            "body": {
              "lambda": {
                "parameter": "graph",
                "domain": {"variable": "hydra.core.graph.Graph"},
                "body": {
                  "lambda": {
                    "parameter": "term0",
                    "domain": {"variable": "hydra.core.model.Term"},
                    "body": {
                      "application": {
                        "function": {
                          "application": {
                            "function": {
                              "typeApplication": {
                                "body": {
                                  "typeApplication": {
                                    "body": {
                                      "typeApplication": {"body": {"variable": "hydra.core.lib.eithers.bind"}, "type": {"variable": "hydra.core.errors.Error"}}},
                                    "type": {"variable": "hydra.core.model.Term"}}},
                                "type": {"variable": "hydra.core.model.Literal"}}},
                            "argument": {
                              "application": {
                                "function": {
                                  "application": {"function": {"variable": "hydra.core.lexical.stripAndDereferenceTerm"}, "argument": {"variable": "graph"}}},
                                "argument": {"variable": "term0"}}}}},
                        "argument": {
                          "lambda": {
                            "parameter": "term",
                            "domain": {"variable": "hydra.core.model.Term"},
                            "body": {
                              "application": {
                                "function": {
                                  "cases": {
                                    "typeName": "hydra.core.model.Term",
                                    "default": {
                                      "typeApplication": {
                                        "body": {
                                          "typeApplication": {
                                            "body": {
                                              "either": {
                                                "left": {
                                                  "inject": {
                                                    "typeName": "hydra.core.errors.Error",
                                                    "field": {
                                                      "name": "extraction",
                                                      "term": {
                                                        "inject": {
                                                          "typeName": "hydra.core.errors.ExtractionError",
                                                          "field": {
                                                            "name": "unexpectedShape",
                                                            "term": {
                                                              "record": {
                                                                "typeName": "hydra.core.errors.UnexpectedShapeError",
                                                                "fields": [
                                                                  {"name": "expected", "term": {"literal": {"string": "literal"}}},
                                                                  {
                                                                    "name": "actual",
                                                                    "term": {"application": {"function": {"variable": "hydra.core.print.model.term"}, "argument": {"variable": "term"}}}}]}}}}}}}}}},
                                            "type": {"variable": "hydra.core.errors.Error"}}},
                                        "type": {"variable": "hydra.core.model.Literal"}}},
                                    "cases": [
                                      {
                                        "name": "literal",
                                        "handler": {
                                          "lambda": {
                                            "parameter": "lit",
                                            "domain": {"variable": "hydra.core.model.Literal"},
                                            "body": {
                                              "typeApplication": {
                                                "body": {
                                                  "typeApplication": {"body": {"either": {"right": {"variable": "lit"}}}, "type": {"variable": "hydra.core.errors.Error"}}},
                                                "type": {"variable": "hydra.core.model.Literal"}}}}}}]}},
                                "argument": {"variable": "term"}}}}}}}}}}},
            "annotation": {"map": [{"key": {"variable": "description"}, "value": {"literal": {"string": "Extract a literal value from a term"}}}]}}}}},
    {
      "term": {
        "name": "hydra.core.extract.model.map",
        "signature": {
          "typeParameters": [{"name": "t0", "constraints": [{"simple": "ordering"}]}, {"name": "t1", "constraints": []}],
          "parameters": [
            {
              "name": "arg0",
              "type": {
                "function": {
                  "domain": {"variable": "hydra.core.model.Term"},
                  "codomain": {"either": {"left": {"variable": "hydra.core.errors.Error"}, "right": {"variable": "t0"}}}}},
              "isLazy": false},
            {
              "name": "arg1",
              "type": {
                "function": {
                  "domain": {"variable": "hydra.core.model.Term"},
                  "codomain": {"either": {"left": {"variable": "hydra.core.errors.Error"}, "right": {"variable": "t1"}}}}},
              "isLazy": false},
            {"name": "arg2", "type": {"variable": "hydra.core.graph.Graph"}, "isLazy": false},
            {"name": "arg3", "type": {"variable": "hydra.core.model.Term"}, "isLazy": false}],
          "result": {
            "type": {
              "either": {
                "left": {"variable": "hydra.core.errors.Error"},
                "right": {"map": {"keys": {"variable": "t0"}, "values": {"variable": "t1"}}}}}}},
        "body": {
          "typeLambda": {
            "parameter": "t0",
            "body": {
              "typeLambda": {
                "parameter": "t1",
                "body": {
                  "annotated": {
                    "body": {
                      "lambda": {
                        "parameter": "fk",
                        "domain": {
                          "function": {
                            "domain": {"variable": "hydra.core.model.Term"},
                            "codomain": {"either": {"left": {"variable": "hydra.core.errors.Error"}, "right": {"variable": "t0"}}}}},
                        "body": {
                          "lambda": {
                            "parameter": "fv",
                            "domain": {
                              "function": {
                                "domain": {"variable": "hydra.core.model.Term"},
                                "codomain": {"either": {"left": {"variable": "hydra.core.errors.Error"}, "right": {"variable": "t1"}}}}},
                            "body": {
                              "lambda": {
                                "parameter": "graph",
                                "domain": {"variable": "hydra.core.graph.Graph"},
                                "body": {
                                  "lambda": {
                                    "parameter": "term0",
                                    "domain": {"variable": "hydra.core.model.Term"},
                                    "body": {
                                      "let": {
                                        "bindings": [
                                          {
                                            "name": "pair",
                                            "term": {
                                              "lambda": {
                                                "parameter": "kvPair",
                                                "domain": {"pair": {"first": {"variable": "hydra.core.model.Term"}, "second": {"variable": "hydra.core.model.Term"}}},
                                                "body": {
                                                  "let": {
                                                    "bindings": [
                                                      {
                                                        "name": "kterm",
                                                        "term": {
                                                          "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": "kvPair"}}},
                                                        "typeScheme": {"variables": [], "body": {"variable": "hydra.core.model.Term"}, "constraints": []}}],
                                                    "body": {
                                                      "let": {
                                                        "bindings": [
                                                          {
                                                            "name": "vterm",
                                                            "term": {
                                                              "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": "kvPair"}}},
                                                            "typeScheme": {"variables": [], "body": {"variable": "hydra.core.model.Term"}, "constraints": []}}],
                                                        "body": {
                                                          "application": {
                                                            "function": {
                                                              "application": {
                                                                "function": {
                                                                  "typeApplication": {
                                                                    "body": {
                                                                      "typeApplication": {
                                                                        "body": {
                                                                          "typeApplication": {"body": {"variable": "hydra.core.lib.eithers.bind"}, "type": {"variable": "hydra.core.errors.Error"}}},
                                                                        "type": {"variable": "t0"}}},
                                                                    "type": {"pair": {"first": {"variable": "t0"}, "second": {"variable": "t1"}}}}},
                                                                "argument": {"application": {"function": {"variable": "fk"}, "argument": {"variable": "kterm"}}}}},
                                                            "argument": {
                                                              "lambda": {
                                                                "parameter": "kval",
                                                                "domain": {"variable": "t0"},
                                                                "body": {
                                                                  "application": {
                                                                    "function": {
                                                                      "application": {
                                                                        "function": {
                                                                          "typeApplication": {
                                                                            "body": {
                                                                              "typeApplication": {
                                                                                "body": {
                                                                                  "typeApplication": {"body": {"variable": "hydra.core.lib.eithers.bind"}, "type": {"variable": "hydra.core.errors.Error"}}},
                                                                                "type": {"variable": "t1"}}},
                                                                            "type": {"pair": {"first": {"variable": "t0"}, "second": {"variable": "t1"}}}}},
                                                                        "argument": {"application": {"function": {"variable": "fv"}, "argument": {"variable": "vterm"}}}}},
                                                                    "argument": {
                                                                      "lambda": {
                                                                        "parameter": "vval",
                                                                        "domain": {"variable": "t1"},
                                                                        "body": {
                                                                          "typeApplication": {
                                                                            "body": {
                                                                              "typeApplication": {
                                                                                "body": {
                                                                                  "either": {
                                                                                    "right": {
                                                                                      "typeApplication": {
                                                                                        "body": {
                                                                                          "typeApplication": {"body": {"pair": {"first": {"variable": "kval"}, "second": {"variable": "vval"}}}, "type": {"variable": "t0"}}},
                                                                                        "type": {"variable": "t1"}}}}},
                                                                                "type": {"variable": "hydra.core.errors.Error"}}},
                                                                            "type": {"pair": {"first": {"variable": "t0"}, "second": {"variable": "t1"}}}}}}}}}}}}}}}}}}},
                                            "typeScheme": {
                                              "variables": [],
                                              "body": {
                                                "function": {
                                                  "domain": {"pair": {"first": {"variable": "hydra.core.model.Term"}, "second": {"variable": "hydra.core.model.Term"}}},
                                                  "codomain": {
                                                    "either": {
                                                      "left": {"variable": "hydra.core.errors.Error"},
                                                      "right": {"pair": {"first": {"variable": "t0"}, "second": {"variable": "t1"}}}}}}},
                                              "constraints": []}}],
                                        "body": {
                                          "application": {
                                            "function": {
                                              "application": {
                                                "function": {
                                                  "typeApplication": {
                                                    "body": {
                                                      "typeApplication": {
                                                        "body": {
                                                          "typeApplication": {"body": {"variable": "hydra.core.lib.eithers.bind"}, "type": {"variable": "hydra.core.errors.Error"}}},
                                                        "type": {"variable": "hydra.core.model.Term"}}},
                                                    "type": {"map": {"keys": {"variable": "t0"}, "values": {"variable": "t1"}}}}},
                                                "argument": {
                                                  "application": {
                                                    "function": {
                                                      "application": {"function": {"variable": "hydra.core.lexical.stripAndDereferenceTerm"}, "argument": {"variable": "graph"}}},
                                                    "argument": {"variable": "term0"}}}}},
                                            "argument": {
                                              "lambda": {
                                                "parameter": "term",
                                                "domain": {"variable": "hydra.core.model.Term"},
                                                "body": {
                                                  "application": {
                                                    "function": {
                                                      "cases": {
                                                        "typeName": "hydra.core.model.Term",
                                                        "default": {
                                                          "typeApplication": {
                                                            "body": {
                                                              "typeApplication": {
                                                                "body": {
                                                                  "either": {
                                                                    "left": {
                                                                      "inject": {
                                                                        "typeName": "hydra.core.errors.Error",
                                                                        "field": {
                                                                          "name": "extraction",
                                                                          "term": {
                                                                            "inject": {
                                                                              "typeName": "hydra.core.errors.ExtractionError",
                                                                              "field": {
                                                                                "name": "unexpectedShape",
                                                                                "term": {
                                                                                  "record": {
                                                                                    "typeName": "hydra.core.errors.UnexpectedShapeError",
                                                                                    "fields": [
                                                                                      {"name": "expected", "term": {"literal": {"string": "map"}}},
                                                                                      {
                                                                                        "name": "actual",
                                                                                        "term": {"application": {"function": {"variable": "hydra.core.print.model.term"}, "argument": {"variable": "term"}}}}]}}}}}}}}}},
                                                                "type": {"variable": "hydra.core.errors.Error"}}},
                                                            "type": {"map": {"keys": {"variable": "t0"}, "values": {"variable": "t1"}}}}},
                                                        "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": "t0"}, "second": {"variable": "t1"}}}}}},
                                                                                "type": {"map": {"keys": {"variable": "t0"}, "values": {"variable": "t1"}}}}},
                                                                            "type": {"variable": "hydra.core.errors.Error"}}},
                                                                        "argument": {
                                                                          "typeApplication": {
                                                                            "body": {"typeApplication": {"body": {"variable": "hydra.core.lib.maps.fromList"}, "type": {"variable": "t0"}}},
                                                                            "type": {"variable": "t1"}}}}},
                                                                    "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": "t0"}, "second": {"variable": "t1"}}}}},
                                                                                "type": {"variable": "hydra.core.errors.Error"}}},
                                                                            "argument": {"variable": "pair"}}},
                                                                        "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": "term"}}}}}}}}}}}}}}}}},
                    "annotation": {
                      "map": [
                        {
                          "key": {"variable": "description"},
                          "value": {"literal": {"string": "Extract a map of key-value pairs from a term, mapping functions over each key and value"}}}]}}}}}}}}},
    {
      "term": {
        "name": "hydra.core.extract.model.mapType",
        "signature": {
          "typeParameters": [],
          "parameters": [{"name": "arg0", "type": {"variable": "hydra.core.model.Type"}, "isLazy": false}],
          "result": {
            "type": {"either": {"left": {"variable": "hydra.core.errors.Error"}, "right": {"variable": "hydra.core.model.MapType"}}}}},
        "body": {
          "annotated": {
            "body": {
              "lambda": {
                "parameter": "typ",
                "domain": {"variable": "hydra.core.model.Type"},
                "body": {
                  "let": {
                    "bindings": [
                      {
                        "name": "stripped",
                        "term": {"application": {"function": {"variable": "hydra.core.strip.deannotateType"}, "argument": {"variable": "typ"}}},
                        "typeScheme": {"variables": [], "body": {"variable": "hydra.core.model.Type"}, "constraints": []}}],
                    "body": {
                      "application": {
                        "function": {
                          "cases": {
                            "typeName": "hydra.core.model.Type",
                            "default": {
                              "typeApplication": {
                                "body": {
                                  "typeApplication": {
                                    "body": {
                                      "either": {
                                        "left": {
                                          "inject": {
                                            "typeName": "hydra.core.errors.Error",
                                            "field": {
                                              "name": "extraction",
                                              "term": {
                                                "inject": {
                                                  "typeName": "hydra.core.errors.ExtractionError",
                                                  "field": {
                                                    "name": "unexpectedShape",
                                                    "term": {
                                                      "record": {
                                                        "typeName": "hydra.core.errors.UnexpectedShapeError",
                                                        "fields": [
                                                          {"name": "expected", "term": {"literal": {"string": "map type"}}},
                                                          {
                                                            "name": "actual",
                                                            "term": {"application": {"function": {"variable": "hydra.core.print.model.type"}, "argument": {"variable": "typ"}}}}]}}}}}}}}}},
                                    "type": {"variable": "hydra.core.errors.Error"}}},
                                "type": {"variable": "hydra.core.model.MapType"}}},
                            "cases": [
                              {
                                "name": "map",
                                "handler": {
                                  "lambda": {
                                    "parameter": "mt",
                                    "domain": {"variable": "hydra.core.model.MapType"},
                                    "body": {
                                      "typeApplication": {
                                        "body": {
                                          "typeApplication": {"body": {"either": {"right": {"variable": "mt"}}}, "type": {"variable": "hydra.core.errors.Error"}}},
                                        "type": {"variable": "hydra.core.model.MapType"}}}}}}]}},
                        "argument": {"variable": "stripped"}}}}}}},
            "annotation": {
              "map": [
                {
                  "key": {"variable": "description"},
                  "value": {"literal": {"string": "Extract the key and value types from a map type"}}}]}}}}},
    {
      "term": {
        "name": "hydra.core.extract.model.nArgs",
        "signature": {
          "typeParameters": [{"name": "t0", "constraints": []}],
          "parameters": [
            {"name": "arg0", "type": {"variable": "hydra.core.model.Name"}, "isLazy": false},
            {"name": "arg1", "type": {"literal": {"integer": "int32"}}, "isLazy": false},
            {"name": "arg2", "type": {"list": {"variable": "t0"}}, "isLazy": false}],
          "result": {"type": {"either": {"left": {"variable": "hydra.core.errors.Error"}, "right": "unit"}}}},
        "body": {
          "typeLambda": {
            "parameter": "t0",
            "body": {
              "annotated": {
                "body": {
                  "lambda": {
                    "parameter": "name",
                    "domain": {"variable": "hydra.core.model.Name"},
                    "body": {
                      "lambda": {
                        "parameter": "n",
                        "domain": {"literal": {"integer": "int32"}},
                        "body": {
                          "lambda": {
                            "parameter": "args",
                            "domain": {"list": {"variable": "t0"}},
                            "body": {
                              "application": {
                                "function": {
                                  "application": {
                                    "function": {
                                      "application": {
                                        "function": {
                                          "typeApplication": {
                                            "body": {"variable": "hydra.core.lib.logic.ifElse"},
                                            "type": {"either": {"left": {"variable": "hydra.core.errors.Error"}, "right": "unit"}}}},
                                        "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": "t0"}}},
                                                    "argument": {"variable": "args"}}}}},
                                            "argument": {"variable": "n"}}}}},
                                    "argument": {
                                      "typeApplication": {
                                        "body": {"typeApplication": {"body": {"either": {"right": "unit"}}, "type": {"variable": "hydra.core.errors.Error"}}},
                                        "type": "unit"}}}},
                                "argument": {
                                  "typeApplication": {
                                    "body": {
                                      "typeApplication": {
                                        "body": {
                                          "either": {
                                            "left": {
                                              "inject": {
                                                "typeName": "hydra.core.errors.Error",
                                                "field": {
                                                  "name": "extraction",
                                                  "term": {
                                                    "inject": {
                                                      "typeName": "hydra.core.errors.ExtractionError",
                                                      "field": {
                                                        "name": "unexpectedShape",
                                                        "term": {
                                                          "record": {
                                                            "typeName": "hydra.core.errors.UnexpectedShapeError",
                                                            "fields": [
                                                              {
                                                                "name": "expected",
                                                                "term": {
                                                                  "application": {
                                                                    "function": {"variable": "hydra.core.lib.strings.concat"},
                                                                    "argument": {
                                                                      "list": [
                                                                        {"application": {"function": {"variable": "hydra.core.lib.literals.printInt32"}, "argument": {"variable": "n"}}},
                                                                        {"literal": {"string": " arguments to primitive "}},
                                                                        {
                                                                          "application": {
                                                                            "function": {"variable": "hydra.core.lib.literals.printString"},
                                                                            "argument": {"application": {"function": {"unwrap": "hydra.core.model.Name"}, "argument": {"variable": "name"}}}}}]}}}},
                                                              {
                                                                "name": "actual",
                                                                "term": {
                                                                  "application": {
                                                                    "function": {"variable": "hydra.core.lib.literals.printInt32"},
                                                                    "argument": {
                                                                      "application": {
                                                                        "function": {"typeApplication": {"body": {"variable": "hydra.core.lib.lists.length"}, "type": {"variable": "t0"}}},
                                                                        "argument": {"variable": "args"}}}}}}]}}}}}}}}}},
                                        "type": {"variable": "hydra.core.errors.Error"}}},
                                    "type": "unit"}}}}}}}}}},
                "annotation": {
                  "map": [
                    {
                      "key": {"variable": "description"},
                      "value": {"literal": {"string": "Ensure a function has the expected number of arguments"}}}]}}}}}}},
    {
      "term": {
        "name": "hydra.core.extract.model.optionalTerm",
        "signature": {
          "typeParameters": [{"name": "t0", "constraints": []}],
          "parameters": [
            {
              "name": "arg0",
              "type": {
                "function": {
                  "domain": {"variable": "hydra.core.model.Term"},
                  "codomain": {"either": {"left": {"variable": "hydra.core.errors.Error"}, "right": {"variable": "t0"}}}}},
              "isLazy": false},
            {"name": "arg1", "type": {"variable": "hydra.core.graph.Graph"}, "isLazy": false},
            {"name": "arg2", "type": {"variable": "hydra.core.model.Term"}, "isLazy": false}],
          "result": {"type": {"either": {"left": {"variable": "hydra.core.errors.Error"}, "right": {"optional": {"variable": "t0"}}}}}},
        "body": {
          "typeLambda": {
            "parameter": "t0",
            "body": {
              "annotated": {
                "body": {
                  "lambda": {
                    "parameter": "f",
                    "domain": {
                      "function": {
                        "domain": {"variable": "hydra.core.model.Term"},
                        "codomain": {"either": {"left": {"variable": "hydra.core.errors.Error"}, "right": {"variable": "t0"}}}}},
                    "body": {
                      "lambda": {
                        "parameter": "graph",
                        "domain": {"variable": "hydra.core.graph.Graph"},
                        "body": {
                          "lambda": {
                            "parameter": "term0",
                            "domain": {"variable": "hydra.core.model.Term"},
                            "body": {
                              "application": {
                                "function": {
                                  "application": {
                                    "function": {
                                      "typeApplication": {
                                        "body": {
                                          "typeApplication": {
                                            "body": {
                                              "typeApplication": {"body": {"variable": "hydra.core.lib.eithers.bind"}, "type": {"variable": "hydra.core.errors.Error"}}},
                                            "type": {"variable": "hydra.core.model.Term"}}},
                                        "type": {"optional": {"variable": "t0"}}}},
                                    "argument": {
                                      "application": {
                                        "function": {
                                          "application": {"function": {"variable": "hydra.core.lexical.stripAndDereferenceTerm"}, "argument": {"variable": "graph"}}},
                                        "argument": {"variable": "term0"}}}}},
                                "argument": {
                                  "lambda": {
                                    "parameter": "term",
                                    "domain": {"variable": "hydra.core.model.Term"},
                                    "body": {
                                      "application": {
                                        "function": {
                                          "cases": {
                                            "typeName": "hydra.core.model.Term",
                                            "default": {
                                              "typeApplication": {
                                                "body": {
                                                  "typeApplication": {
                                                    "body": {
                                                      "either": {
                                                        "left": {
                                                          "inject": {
                                                            "typeName": "hydra.core.errors.Error",
                                                            "field": {
                                                              "name": "extraction",
                                                              "term": {
                                                                "inject": {
                                                                  "typeName": "hydra.core.errors.ExtractionError",
                                                                  "field": {
                                                                    "name": "unexpectedShape",
                                                                    "term": {
                                                                      "record": {
                                                                        "typeName": "hydra.core.errors.UnexpectedShapeError",
                                                                        "fields": [
                                                                          {"name": "expected", "term": {"literal": {"string": "optional value"}}},
                                                                          {
                                                                            "name": "actual",
                                                                            "term": {"application": {"function": {"variable": "hydra.core.print.model.term"}, "argument": {"variable": "term"}}}}]}}}}}}}}}},
                                                    "type": {"variable": "hydra.core.errors.Error"}}},
                                                "type": {"optional": {"variable": "t0"}}}},
                                            "cases": [
                                              {
                                                "name": "optional",
                                                "handler": {
                                                  "lambda": {
                                                    "parameter": "mt",
                                                    "domain": {"optional": {"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.model.Term"}}},
                                                                    "type": {"either": {"left": {"variable": "hydra.core.errors.Error"}, "right": {"optional": {"variable": "t0"}}}}}},
                                                                "argument": {"variable": "mt"}}},
                                                            "argument": {
                                                              "typeApplication": {
                                                                "body": {
                                                                  "typeApplication": {
                                                                    "body": {"either": {"right": {"typeApplication": {"body": {"optional": null}, "type": {"variable": "t0"}}}}},
                                                                    "type": {"variable": "hydra.core.errors.Error"}}},
                                                                "type": {"optional": {"variable": "t0"}}}}}},
                                                        "argument": {
                                                          "lambda": {
                                                            "parameter": "t",
                                                            "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": "t0"}}},
                                                                            "type": {"optional": {"variable": "t0"}}}},
                                                                        "type": {"variable": "hydra.core.errors.Error"}}},
                                                                    "argument": {"typeApplication": {"body": {"variable": "hydra.core.lib.optionals.given"}, "type": {"variable": "t0"}}}}},
                                                                "argument": {"application": {"function": {"variable": "f"}, "argument": {"variable": "t"}}}}}}}}}}}}]}},
                                        "argument": {"variable": "term"}}}}}}}}}}}}},
                "annotation": {
                  "map": [
                    {
                      "key": {"variable": "description"},
                      "value": {"literal": {"string": "Extract an optional value from a term, applying a function to the value if present"}}}]}}}}}}},
    {
      "term": {
        "name": "hydra.core.extract.model.optionalType",
        "signature": {
          "typeParameters": [],
          "parameters": [{"name": "arg0", "type": {"variable": "hydra.core.model.Type"}, "isLazy": false}],
          "result": {"type": {"either": {"left": {"variable": "hydra.core.errors.Error"}, "right": {"variable": "hydra.core.model.Type"}}}}},
        "body": {
          "annotated": {
            "body": {
              "lambda": {
                "parameter": "typ",
                "domain": {"variable": "hydra.core.model.Type"},
                "body": {
                  "let": {
                    "bindings": [
                      {
                        "name": "stripped",
                        "term": {"application": {"function": {"variable": "hydra.core.strip.deannotateType"}, "argument": {"variable": "typ"}}},
                        "typeScheme": {"variables": [], "body": {"variable": "hydra.core.model.Type"}, "constraints": []}}],
                    "body": {
                      "application": {
                        "function": {
                          "cases": {
                            "typeName": "hydra.core.model.Type",
                            "default": {
                              "typeApplication": {
                                "body": {
                                  "typeApplication": {
                                    "body": {
                                      "either": {
                                        "left": {
                                          "inject": {
                                            "typeName": "hydra.core.errors.Error",
                                            "field": {
                                              "name": "extraction",
                                              "term": {
                                                "inject": {
                                                  "typeName": "hydra.core.errors.ExtractionError",
                                                  "field": {
                                                    "name": "unexpectedShape",
                                                    "term": {
                                                      "record": {
                                                        "typeName": "hydra.core.errors.UnexpectedShapeError",
                                                        "fields": [
                                                          {"name": "expected", "term": {"literal": {"string": "optional type"}}},
                                                          {
                                                            "name": "actual",
                                                            "term": {"application": {"function": {"variable": "hydra.core.print.model.type"}, "argument": {"variable": "typ"}}}}]}}}}}}}}}},
                                    "type": {"variable": "hydra.core.errors.Error"}}},
                                "type": {"variable": "hydra.core.model.Type"}}},
                            "cases": [
                              {
                                "name": "optional",
                                "handler": {
                                  "lambda": {
                                    "parameter": "t",
                                    "domain": {"variable": "hydra.core.model.Type"},
                                    "body": {
                                      "typeApplication": {
                                        "body": {"typeApplication": {"body": {"either": {"right": {"variable": "t"}}}, "type": {"variable": "hydra.core.errors.Error"}}},
                                        "type": {"variable": "hydra.core.model.Type"}}}}}}]}},
                        "argument": {"variable": "stripped"}}}}}}},
            "annotation": {
              "map": [{"key": {"variable": "description"}, "value": {"literal": {"string": "Extract the base type from an optional type"}}}]}}}}},
    {
      "term": {
        "name": "hydra.core.extract.model.pair",
        "signature": {
          "typeParameters": [{"name": "t0", "constraints": []}, {"name": "t1", "constraints": []}],
          "parameters": [
            {
              "name": "arg0",
              "type": {
                "function": {
                  "domain": {"variable": "hydra.core.model.Term"},
                  "codomain": {"either": {"left": {"variable": "hydra.core.errors.Error"}, "right": {"variable": "t0"}}}}},
              "isLazy": false},
            {
              "name": "arg1",
              "type": {
                "function": {
                  "domain": {"variable": "hydra.core.model.Term"},
                  "codomain": {"either": {"left": {"variable": "hydra.core.errors.Error"}, "right": {"variable": "t1"}}}}},
              "isLazy": false},
            {"name": "arg2", "type": {"variable": "hydra.core.graph.Graph"}, "isLazy": false},
            {"name": "arg3", "type": {"variable": "hydra.core.model.Term"}, "isLazy": false}],
          "result": {
            "type": {
              "either": {
                "left": {"variable": "hydra.core.errors.Error"},
                "right": {"pair": {"first": {"variable": "t0"}, "second": {"variable": "t1"}}}}}}},
        "body": {
          "typeLambda": {
            "parameter": "t0",
            "body": {
              "typeLambda": {
                "parameter": "t1",
                "body": {
                  "annotated": {
                    "body": {
                      "lambda": {
                        "parameter": "kf",
                        "domain": {
                          "function": {
                            "domain": {"variable": "hydra.core.model.Term"},
                            "codomain": {"either": {"left": {"variable": "hydra.core.errors.Error"}, "right": {"variable": "t0"}}}}},
                        "body": {
                          "lambda": {
                            "parameter": "vf",
                            "domain": {
                              "function": {
                                "domain": {"variable": "hydra.core.model.Term"},
                                "codomain": {"either": {"left": {"variable": "hydra.core.errors.Error"}, "right": {"variable": "t1"}}}}},
                            "body": {
                              "lambda": {
                                "parameter": "graph",
                                "domain": {"variable": "hydra.core.graph.Graph"},
                                "body": {
                                  "lambda": {
                                    "parameter": "term0",
                                    "domain": {"variable": "hydra.core.model.Term"},
                                    "body": {
                                      "application": {
                                        "function": {
                                          "application": {
                                            "function": {
                                              "typeApplication": {
                                                "body": {
                                                  "typeApplication": {
                                                    "body": {
                                                      "typeApplication": {"body": {"variable": "hydra.core.lib.eithers.bind"}, "type": {"variable": "hydra.core.errors.Error"}}},
                                                    "type": {"variable": "hydra.core.model.Term"}}},
                                                "type": {"pair": {"first": {"variable": "t0"}, "second": {"variable": "t1"}}}}},
                                            "argument": {
                                              "application": {
                                                "function": {
                                                  "application": {"function": {"variable": "hydra.core.lexical.stripAndDereferenceTerm"}, "argument": {"variable": "graph"}}},
                                                "argument": {"variable": "term0"}}}}},
                                        "argument": {
                                          "lambda": {
                                            "parameter": "term",
                                            "domain": {"variable": "hydra.core.model.Term"},
                                            "body": {
                                              "application": {
                                                "function": {
                                                  "cases": {
                                                    "typeName": "hydra.core.model.Term",
                                                    "default": {
                                                      "typeApplication": {
                                                        "body": {
                                                          "typeApplication": {
                                                            "body": {
                                                              "either": {
                                                                "left": {
                                                                  "inject": {
                                                                    "typeName": "hydra.core.errors.Error",
                                                                    "field": {
                                                                      "name": "extraction",
                                                                      "term": {
                                                                        "inject": {
                                                                          "typeName": "hydra.core.errors.ExtractionError",
                                                                          "field": {
                                                                            "name": "unexpectedShape",
                                                                            "term": {
                                                                              "record": {
                                                                                "typeName": "hydra.core.errors.UnexpectedShapeError",
                                                                                "fields": [
                                                                                  {"name": "expected", "term": {"literal": {"string": "pair"}}},
                                                                                  {
                                                                                    "name": "actual",
                                                                                    "term": {"application": {"function": {"variable": "hydra.core.print.model.term"}, "argument": {"variable": "term"}}}}]}}}}}}}}}},
                                                            "type": {"variable": "hydra.core.errors.Error"}}},
                                                        "type": {"pair": {"first": {"variable": "t0"}, "second": {"variable": "t1"}}}}},
                                                    "cases": [
                                                      {
                                                        "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": {"variable": "hydra.core.errors.Error"}}},
                                                                            "type": {"variable": "t0"}}},
                                                                        "type": {"pair": {"first": {"variable": "t0"}, "second": {"variable": "t1"}}}}},
                                                                    "argument": {
                                                                      "application": {
                                                                        "function": {"variable": "kf"},
                                                                        "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": "kVal",
                                                                    "domain": {"variable": "t0"},
                                                                    "body": {
                                                                      "application": {
                                                                        "function": {
                                                                          "application": {
                                                                            "function": {
                                                                              "typeApplication": {
                                                                                "body": {
                                                                                  "typeApplication": {
                                                                                    "body": {
                                                                                      "typeApplication": {"body": {"variable": "hydra.core.lib.eithers.bind"}, "type": {"variable": "hydra.core.errors.Error"}}},
                                                                                    "type": {"variable": "t1"}}},
                                                                                "type": {"pair": {"first": {"variable": "t0"}, "second": {"variable": "t1"}}}}},
                                                                            "argument": {
                                                                              "application": {
                                                                                "function": {"variable": "vf"},
                                                                                "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"}}}}}}},
                                                                        "argument": {
                                                                          "lambda": {
                                                                            "parameter": "vVal",
                                                                            "domain": {"variable": "t1"},
                                                                            "body": {
                                                                              "typeApplication": {
                                                                                "body": {
                                                                                  "typeApplication": {
                                                                                    "body": {
                                                                                      "either": {
                                                                                        "right": {
                                                                                          "typeApplication": {
                                                                                            "body": {
                                                                                              "typeApplication": {"body": {"pair": {"first": {"variable": "kVal"}, "second": {"variable": "vVal"}}}, "type": {"variable": "t0"}}},
                                                                                            "type": {"variable": "t1"}}}}},
                                                                                    "type": {"variable": "hydra.core.errors.Error"}}},
                                                                                "type": {"pair": {"first": {"variable": "t0"}, "second": {"variable": "t1"}}}}}}}}}}}}}}}}]}},
                                                "argument": {"variable": "term"}}}}}}}}}}}}}}},
                    "annotation": {
                      "map": [
                        {
                          "key": {"variable": "description"},
                          "value": {"literal": {"string": "Extract a pair of values from a term, applying functions to each component"}}}]}}}}}}}}},
    {
      "term": {
        "name": "hydra.core.extract.model.record",
        "signature": {
          "typeParameters": [],
          "parameters": [
            {"name": "arg0", "type": {"variable": "hydra.core.model.Name"}, "isLazy": false},
            {"name": "arg1", "type": {"variable": "hydra.core.graph.Graph"}, "isLazy": false},
            {"name": "arg2", "type": {"variable": "hydra.core.model.Term"}, "isLazy": false}],
          "result": {
            "type": {"either": {"left": {"variable": "hydra.core.errors.Error"}, "right": {"list": {"variable": "hydra.core.model.Field"}}}}}},
        "body": {
          "annotated": {
            "body": {
              "lambda": {
                "parameter": "expected",
                "domain": {"variable": "hydra.core.model.Name"},
                "body": {
                  "lambda": {
                    "parameter": "graph",
                    "domain": {"variable": "hydra.core.graph.Graph"},
                    "body": {
                      "lambda": {
                        "parameter": "term0",
                        "domain": {"variable": "hydra.core.model.Term"},
                        "body": {
                          "application": {
                            "function": {
                              "application": {
                                "function": {
                                  "typeApplication": {
                                    "body": {
                                      "typeApplication": {
                                        "body": {
                                          "typeApplication": {"body": {"variable": "hydra.core.lib.eithers.bind"}, "type": {"variable": "hydra.core.errors.Error"}}},
                                        "type": {"variable": "hydra.core.model.Record"}}},
                                    "type": {"list": {"variable": "hydra.core.model.Field"}}}},
                                "argument": {
                                  "application": {
                                    "function": {"application": {"function": {"variable": "hydra.core.extract.model.termRecord"}, "argument": {"variable": "graph"}}},
                                    "argument": {"variable": "term0"}}}}},
                            "argument": {
                              "lambda": {
                                "parameter": "record",
                                "domain": {"variable": "hydra.core.model.Record"},
                                "body": {
                                  "application": {
                                    "function": {
                                      "application": {
                                        "function": {
                                          "application": {
                                            "function": {
                                              "typeApplication": {
                                                "body": {"variable": "hydra.core.lib.logic.ifElse"},
                                                "type": {"either": {"left": {"variable": "hydra.core.errors.Error"}, "right": {"list": {"variable": "hydra.core.model.Field"}}}}}},
                                            "argument": {
                                              "application": {
                                                "function": {
                                                  "application": {
                                                    "function": {
                                                      "typeApplication": {"body": {"variable": "hydra.core.lib.equality.equal"}, "type": {"variable": "hydra.core.model.Name"}}},
                                                    "argument": {
                                                      "application": {
                                                        "function": {"project": {"typeName": "hydra.core.model.Record", "fieldName": "typeName"}},
                                                        "argument": {"variable": "record"}}}}},
                                                "argument": {"variable": "expected"}}}}},
                                        "argument": {
                                          "typeApplication": {
                                            "body": {
                                              "typeApplication": {
                                                "body": {
                                                  "either": {
                                                    "right": {
                                                      "application": {
                                                        "function": {"project": {"typeName": "hydra.core.model.Record", "fieldName": "fields"}},
                                                        "argument": {"variable": "record"}}}}},
                                                "type": {"variable": "hydra.core.errors.Error"}}},
                                            "type": {"list": {"variable": "hydra.core.model.Field"}}}}}},
                                    "argument": {
                                      "typeApplication": {
                                        "body": {
                                          "typeApplication": {
                                            "body": {
                                              "either": {
                                                "left": {
                                                  "inject": {
                                                    "typeName": "hydra.core.errors.Error",
                                                    "field": {
                                                      "name": "extraction",
                                                      "term": {
                                                        "inject": {
                                                          "typeName": "hydra.core.errors.ExtractionError",
                                                          "field": {
                                                            "name": "unexpectedShape",
                                                            "term": {
                                                              "record": {
                                                                "typeName": "hydra.core.errors.UnexpectedShapeError",
                                                                "fields": [
                                                                  {
                                                                    "name": "expected",
                                                                    "term": {
                                                                      "application": {
                                                                        "function": {
                                                                          "application": {"function": {"variable": "hydra.core.lib.strings.concat2"}, "argument": {"literal": {"string": "record of type "}}}},
                                                                        "argument": {"application": {"function": {"unwrap": "hydra.core.model.Name"}, "argument": {"variable": "expected"}}}}}},
                                                                  {
                                                                    "name": "actual",
                                                                    "term": {
                                                                      "application": {
                                                                        "function": {"unwrap": "hydra.core.model.Name"},
                                                                        "argument": {
                                                                          "application": {
                                                                            "function": {"project": {"typeName": "hydra.core.model.Record", "fieldName": "typeName"}},
                                                                            "argument": {"variable": "record"}}}}}}]}}}}}}}}}},
                                            "type": {"variable": "hydra.core.errors.Error"}}},
                                        "type": {"list": {"variable": "hydra.core.model.Field"}}}}}}}}}}}}}}}},
            "annotation": {
              "map": [{"key": {"variable": "description"}, "value": {"literal": {"string": "Extract a record's fields from a term"}}}]}}}}},
    {
      "term": {
        "name": "hydra.core.extract.model.recordType",
        "signature": {
          "typeParameters": [{"name": "t0", "constraints": []}],
          "parameters": [
            {"name": "arg0", "type": {"variable": "t0"}, "isLazy": false},
            {"name": "arg1", "type": {"variable": "hydra.core.model.Type"}, "isLazy": false}],
          "result": {
            "type": {
              "either": {"left": {"variable": "hydra.core.errors.Error"}, "right": {"list": {"variable": "hydra.core.model.FieldType"}}}}}},
        "body": {
          "typeLambda": {
            "parameter": "t0",
            "body": {
              "annotated": {
                "body": {
                  "lambda": {
                    "parameter": "ename",
                    "domain": {"variable": "t0"},
                    "body": {
                      "lambda": {
                        "parameter": "typ",
                        "domain": {"variable": "hydra.core.model.Type"},
                        "body": {
                          "let": {
                            "bindings": [
                              {
                                "name": "stripped",
                                "term": {"application": {"function": {"variable": "hydra.core.strip.deannotateType"}, "argument": {"variable": "typ"}}},
                                "typeScheme": {"variables": [], "body": {"variable": "hydra.core.model.Type"}, "constraints": []}}],
                            "body": {
                              "application": {
                                "function": {
                                  "cases": {
                                    "typeName": "hydra.core.model.Type",
                                    "default": {
                                      "typeApplication": {
                                        "body": {
                                          "typeApplication": {
                                            "body": {
                                              "either": {
                                                "left": {
                                                  "inject": {
                                                    "typeName": "hydra.core.errors.Error",
                                                    "field": {
                                                      "name": "extraction",
                                                      "term": {
                                                        "inject": {
                                                          "typeName": "hydra.core.errors.ExtractionError",
                                                          "field": {
                                                            "name": "unexpectedShape",
                                                            "term": {
                                                              "record": {
                                                                "typeName": "hydra.core.errors.UnexpectedShapeError",
                                                                "fields": [
                                                                  {"name": "expected", "term": {"literal": {"string": "record type"}}},
                                                                  {
                                                                    "name": "actual",
                                                                    "term": {"application": {"function": {"variable": "hydra.core.print.model.type"}, "argument": {"variable": "typ"}}}}]}}}}}}}}}},
                                            "type": {"variable": "hydra.core.errors.Error"}}},
                                        "type": {"list": {"variable": "hydra.core.model.FieldType"}}}},
                                    "cases": [
                                      {
                                        "name": "record",
                                        "handler": {
                                          "lambda": {
                                            "parameter": "fields",
                                            "domain": {"list": {"variable": "hydra.core.model.FieldType"}},
                                            "body": {
                                              "typeApplication": {
                                                "body": {
                                                  "typeApplication": {"body": {"either": {"right": {"variable": "fields"}}}, "type": {"variable": "hydra.core.errors.Error"}}},
                                                "type": {"list": {"variable": "hydra.core.model.FieldType"}}}}}}}]}},
                                "argument": {"variable": "stripped"}}}}}}}}},
                "annotation": {
                  "map": [{"key": {"variable": "description"}, "value": {"literal": {"string": "Extract the field types from a record type"}}}]}}}}}}},
    {
      "term": {
        "name": "hydra.core.extract.model.requireField",
        "signature": {
          "typeParameters": [{"name": "t0", "constraints": []}, {"name": "t1", "constraints": []}, {"name": "t2", "constraints": []}],
          "parameters": [
            {"name": "arg0", "type": {"literal": "string"}, "isLazy": false},
            {
              "name": "arg1",
              "type": {
                "function": {
                  "domain": {"variable": "t0"},
                  "codomain": {
                    "function": {
                      "domain": {"variable": "t1"},
                      "codomain": {"either": {"left": {"variable": "hydra.core.errors.DecodingError"}, "right": {"variable": "t2"}}}}}}},
              "isLazy": false},
            {
              "name": "arg2",
              "type": {"map": {"keys": {"variable": "hydra.core.model.Name"}, "values": {"variable": "t1"}}},
              "isLazy": false},
            {"name": "arg3", "type": {"variable": "t0"}, "isLazy": false}],
          "result": {"type": {"either": {"left": {"variable": "hydra.core.errors.DecodingError"}, "right": {"variable": "t2"}}}}},
        "body": {
          "typeLambda": {
            "parameter": "t0",
            "body": {
              "typeLambda": {
                "parameter": "t1",
                "body": {
                  "typeLambda": {
                    "parameter": "t2",
                    "body": {
                      "annotated": {
                        "body": {
                          "lambda": {
                            "parameter": "fieldName",
                            "domain": {"literal": "string"},
                            "body": {
                              "lambda": {
                                "parameter": "decoder",
                                "domain": {
                                  "function": {
                                    "domain": {"variable": "t0"},
                                    "codomain": {
                                      "function": {
                                        "domain": {"variable": "t1"},
                                        "codomain": {"either": {"left": {"variable": "hydra.core.errors.DecodingError"}, "right": {"variable": "t2"}}}}}}},
                                "body": {
                                  "lambda": {
                                    "parameter": "fieldMap",
                                    "domain": {"map": {"keys": {"variable": "hydra.core.model.Name"}, "values": {"variable": "t1"}}},
                                    "body": {
                                      "lambda": {
                                        "parameter": "g",
                                        "domain": {"variable": "t0"},
                                        "body": {
                                          "application": {
                                            "function": {
                                              "application": {
                                                "function": {
                                                  "application": {
                                                    "function": {
                                                      "typeApplication": {
                                                        "body": {"typeApplication": {"body": {"variable": "hydra.core.lib.optionals.match"}, "type": {"variable": "t1"}}},
                                                        "type": {"either": {"left": {"variable": "hydra.core.errors.DecodingError"}, "right": {"variable": "t2"}}}}},
                                                    "argument": {
                                                      "application": {
                                                        "function": {
                                                          "application": {
                                                            "function": {
                                                              "typeApplication": {
                                                                "body": {"typeApplication": {"body": {"variable": "hydra.core.lib.maps.lookup"}, "type": {"variable": "hydra.core.model.Name"}}},
                                                                "type": {"variable": "t1"}}},
                                                            "argument": {"wrap": {"typeName": "hydra.core.model.Name", "body": {"variable": "fieldName"}}}}},
                                                        "argument": {"variable": "fieldMap"}}}}},
                                                "argument": {
                                                  "typeApplication": {
                                                    "body": {
                                                      "typeApplication": {
                                                        "body": {
                                                          "either": {
                                                            "left": {
                                                              "wrap": {
                                                                "typeName": "hydra.core.errors.DecodingError",
                                                                "body": {
                                                                  "application": {
                                                                    "function": {"variable": "hydra.core.lib.strings.concat"},
                                                                    "argument": {"list": [{"literal": {"string": "missing field "}}, {"variable": "fieldName"}, {"literal": {"string": " in record"}}]}}}}}}},
                                                        "type": {"variable": "hydra.core.errors.DecodingError"}}},
                                                    "type": {"variable": "t2"}}}}},
                                            "argument": {
                                              "lambda": {
                                                "parameter": "fieldTerm",
                                                "domain": {"variable": "t1"},
                                                "body": {
                                                  "application": {
                                                    "function": {"application": {"function": {"variable": "decoder"}, "argument": {"variable": "g"}}},
                                                    "argument": {"variable": "fieldTerm"}}}}}}}}}}}}}}},
                        "annotation": {
                          "map": [
                            {
                              "key": {"variable": "description"},
                              "value": {"literal": {"string": "Require a field from a record's field map and decode it"}}}]}}}}}}}}}}},
    {
      "term": {
        "name": "hydra.core.extract.model.set",
        "signature": {
          "typeParameters": [],
          "parameters": [
            {"name": "arg0", "type": {"variable": "hydra.core.graph.Graph"}, "isLazy": false},
            {"name": "arg1", "type": {"variable": "hydra.core.model.Term"}, "isLazy": false}],
          "result": {
            "type": {"either": {"left": {"variable": "hydra.core.errors.Error"}, "right": {"set": {"variable": "hydra.core.model.Term"}}}}}},
        "body": {
          "annotated": {
            "body": {
              "lambda": {
                "parameter": "graph",
                "domain": {"variable": "hydra.core.graph.Graph"},
                "body": {
                  "lambda": {
                    "parameter": "term",
                    "domain": {"variable": "hydra.core.model.Term"},
                    "body": {
                      "application": {
                        "function": {
                          "application": {
                            "function": {
                              "typeApplication": {
                                "body": {
                                  "typeApplication": {
                                    "body": {
                                      "typeApplication": {"body": {"variable": "hydra.core.lib.eithers.bind"}, "type": {"variable": "hydra.core.errors.Error"}}},
                                    "type": {"variable": "hydra.core.model.Term"}}},
                                "type": {"set": {"variable": "hydra.core.model.Term"}}}},
                            "argument": {
                              "application": {
                                "function": {
                                  "application": {"function": {"variable": "hydra.core.lexical.stripAndDereferenceTerm"}, "argument": {"variable": "graph"}}},
                                "argument": {"variable": "term"}}}}},
                        "argument": {
                          "lambda": {
                            "parameter": "stripped",
                            "domain": {"variable": "hydra.core.model.Term"},
                            "body": {
                              "application": {
                                "function": {
                                  "cases": {
                                    "typeName": "hydra.core.model.Term",
                                    "default": {
                                      "typeApplication": {
                                        "body": {
                                          "typeApplication": {
                                            "body": {
                                              "either": {
                                                "left": {
                                                  "inject": {
                                                    "typeName": "hydra.core.errors.Error",
                                                    "field": {
                                                      "name": "extraction",
                                                      "term": {
                                                        "inject": {
                                                          "typeName": "hydra.core.errors.ExtractionError",
                                                          "field": {
                                                            "name": "unexpectedShape",
                                                            "term": {
                                                              "record": {
                                                                "typeName": "hydra.core.errors.UnexpectedShapeError",
                                                                "fields": [
                                                                  {"name": "expected", "term": {"literal": {"string": "set"}}},
                                                                  {
                                                                    "name": "actual",
                                                                    "term": {"application": {"function": {"variable": "hydra.core.print.model.term"}, "argument": {"variable": "stripped"}}}}]}}}}}}}}}},
                                            "type": {"variable": "hydra.core.errors.Error"}}},
                                        "type": {"set": {"variable": "hydra.core.model.Term"}}}},
                                    "cases": [
                                      {
                                        "name": "set",
                                        "handler": {
                                          "lambda": {
                                            "parameter": "s",
                                            "domain": {"set": {"variable": "hydra.core.model.Term"}},
                                            "body": {
                                              "typeApplication": {
                                                "body": {"typeApplication": {"body": {"either": {"right": {"variable": "s"}}}, "type": {"variable": "hydra.core.errors.Error"}}},
                                                "type": {"set": {"variable": "hydra.core.model.Term"}}}}}}}]}},
                                "argument": {"variable": "stripped"}}}}}}}}}}},
            "annotation": {"map": [{"key": {"variable": "description"}, "value": {"literal": {"string": "Extract a set of terms from a term"}}}]}}}}},
    {
      "term": {
        "name": "hydra.core.extract.model.setOf",
        "signature": {
          "typeParameters": [{"name": "t0", "constraints": [{"simple": "ordering"}]}],
          "parameters": [
            {
              "name": "arg0",
              "type": {
                "function": {
                  "domain": {"variable": "hydra.core.model.Term"},
                  "codomain": {"either": {"left": {"variable": "hydra.core.errors.Error"}, "right": {"variable": "t0"}}}}},
              "isLazy": false},
            {"name": "arg1", "type": {"variable": "hydra.core.graph.Graph"}, "isLazy": false},
            {"name": "arg2", "type": {"variable": "hydra.core.model.Term"}, "isLazy": false}],
          "result": {"type": {"either": {"left": {"variable": "hydra.core.errors.Error"}, "right": {"set": {"variable": "t0"}}}}}},
        "body": {
          "typeLambda": {
            "parameter": "t0",
            "body": {
              "annotated": {
                "body": {
                  "lambda": {
                    "parameter": "f",
                    "domain": {
                      "function": {
                        "domain": {"variable": "hydra.core.model.Term"},
                        "codomain": {"either": {"left": {"variable": "hydra.core.errors.Error"}, "right": {"variable": "t0"}}}}},
                    "body": {
                      "lambda": {
                        "parameter": "graph",
                        "domain": {"variable": "hydra.core.graph.Graph"},
                        "body": {
                          "lambda": {
                            "parameter": "term",
                            "domain": {"variable": "hydra.core.model.Term"},
                            "body": {
                              "application": {
                                "function": {
                                  "application": {
                                    "function": {
                                      "typeApplication": {
                                        "body": {
                                          "typeApplication": {
                                            "body": {
                                              "typeApplication": {"body": {"variable": "hydra.core.lib.eithers.bind"}, "type": {"variable": "hydra.core.errors.Error"}}},
                                            "type": {"set": {"variable": "hydra.core.model.Term"}}}},
                                        "type": {"set": {"variable": "t0"}}}},
                                    "argument": {
                                      "application": {
                                        "function": {"application": {"function": {"variable": "hydra.core.extract.model.set"}, "argument": {"variable": "graph"}}},
                                        "argument": {"variable": "term"}}}}},
                                "argument": {
                                  "lambda": {
                                    "parameter": "els",
                                    "domain": {"set": {"variable": "hydra.core.model.Term"}},
                                    "body": {
                                      "application": {
                                        "function": {
                                          "application": {
                                            "function": {
                                              "typeApplication": {
                                                "body": {
                                                  "typeApplication": {
                                                    "body": {
                                                      "typeApplication": {"body": {"variable": "hydra.core.lib.eithers.mapSet"}, "type": {"variable": "hydra.core.model.Term"}}},
                                                    "type": {"variable": "t0"}}},
                                                "type": {"variable": "hydra.core.errors.Error"}}},
                                            "argument": {"variable": "f"}}},
                                        "argument": {"variable": "els"}}}}}}}}}}}}},
                "annotation": {
                  "map": [
                    {
                      "key": {"variable": "description"},
                      "value": {"literal": {"string": "Extract a set of values from a term, mapping a function over each element"}}}]}}}}}}},
    {
      "term": {
        "name": "hydra.core.extract.model.setType",
        "signature": {
          "typeParameters": [],
          "parameters": [{"name": "arg0", "type": {"variable": "hydra.core.model.Type"}, "isLazy": false}],
          "result": {"type": {"either": {"left": {"variable": "hydra.core.errors.Error"}, "right": {"variable": "hydra.core.model.Type"}}}}},
        "body": {
          "annotated": {
            "body": {
              "lambda": {
                "parameter": "typ",
                "domain": {"variable": "hydra.core.model.Type"},
                "body": {
                  "let": {
                    "bindings": [
                      {
                        "name": "stripped",
                        "term": {"application": {"function": {"variable": "hydra.core.strip.deannotateType"}, "argument": {"variable": "typ"}}},
                        "typeScheme": {"variables": [], "body": {"variable": "hydra.core.model.Type"}, "constraints": []}}],
                    "body": {
                      "application": {
                        "function": {
                          "cases": {
                            "typeName": "hydra.core.model.Type",
                            "default": {
                              "typeApplication": {
                                "body": {
                                  "typeApplication": {
                                    "body": {
                                      "either": {
                                        "left": {
                                          "inject": {
                                            "typeName": "hydra.core.errors.Error",
                                            "field": {
                                              "name": "extraction",
                                              "term": {
                                                "inject": {
                                                  "typeName": "hydra.core.errors.ExtractionError",
                                                  "field": {
                                                    "name": "unexpectedShape",
                                                    "term": {
                                                      "record": {
                                                        "typeName": "hydra.core.errors.UnexpectedShapeError",
                                                        "fields": [
                                                          {"name": "expected", "term": {"literal": {"string": "set type"}}},
                                                          {
                                                            "name": "actual",
                                                            "term": {"application": {"function": {"variable": "hydra.core.print.model.type"}, "argument": {"variable": "typ"}}}}]}}}}}}}}}},
                                    "type": {"variable": "hydra.core.errors.Error"}}},
                                "type": {"variable": "hydra.core.model.Type"}}},
                            "cases": [
                              {
                                "name": "set",
                                "handler": {
                                  "lambda": {
                                    "parameter": "t",
                                    "domain": {"variable": "hydra.core.model.Type"},
                                    "body": {
                                      "typeApplication": {
                                        "body": {"typeApplication": {"body": {"either": {"right": {"variable": "t"}}}, "type": {"variable": "hydra.core.errors.Error"}}},
                                        "type": {"variable": "hydra.core.model.Type"}}}}}}]}},
                        "argument": {"variable": "stripped"}}}}}}},
            "annotation": {
              "map": [{"key": {"variable": "description"}, "value": {"literal": {"string": "Extract the element type from a set type"}}}]}}}}},
    {
      "term": {
        "name": "hydra.core.extract.model.string",
        "signature": {
          "typeParameters": [],
          "parameters": [
            {"name": "arg0", "type": {"variable": "hydra.core.graph.Graph"}, "isLazy": false},
            {"name": "arg1", "type": {"variable": "hydra.core.model.Term"}, "isLazy": false}],
          "result": {"type": {"either": {"left": {"variable": "hydra.core.errors.Error"}, "right": {"literal": "string"}}}}},
        "body": {
          "annotated": {
            "body": {
              "lambda": {
                "parameter": "graph",
                "domain": {"variable": "hydra.core.graph.Graph"},
                "body": {
                  "lambda": {
                    "parameter": "t",
                    "domain": {"variable": "hydra.core.model.Term"},
                    "body": {
                      "application": {
                        "function": {
                          "application": {
                            "function": {
                              "typeApplication": {
                                "body": {
                                  "typeApplication": {
                                    "body": {
                                      "typeApplication": {"body": {"variable": "hydra.core.lib.eithers.bind"}, "type": {"variable": "hydra.core.errors.Error"}}},
                                    "type": {"variable": "hydra.core.model.Literal"}}},
                                "type": {"literal": "string"}}},
                            "argument": {
                              "application": {
                                "function": {"application": {"function": {"variable": "hydra.core.extract.model.literal"}, "argument": {"variable": "graph"}}},
                                "argument": {"variable": "t"}}}}},
                        "argument": {
                          "lambda": {
                            "parameter": "l",
                            "domain": {"variable": "hydra.core.model.Literal"},
                            "body": {"application": {"function": {"variable": "hydra.core.extract.model.stringLiteral"}, "argument": {"variable": "l"}}}}}}}}}}},
            "annotation": {"map": [{"key": {"variable": "description"}, "value": {"literal": {"string": "Extract a string value from a term"}}}]}}}}},
    {
      "term": {
        "name": "hydra.core.extract.model.stringLiteral",
        "signature": {
          "typeParameters": [],
          "parameters": [{"name": "arg0", "type": {"variable": "hydra.core.model.Literal"}, "isLazy": false}],
          "result": {"type": {"either": {"left": {"variable": "hydra.core.errors.Error"}, "right": {"literal": "string"}}}}},
        "body": {
          "annotated": {
            "body": {
              "lambda": {
                "parameter": "v",
                "domain": {"variable": "hydra.core.model.Literal"},
                "body": {
                  "application": {
                    "function": {
                      "cases": {
                        "typeName": "hydra.core.model.Literal",
                        "default": {
                          "typeApplication": {
                            "body": {
                              "typeApplication": {
                                "body": {
                                  "either": {
                                    "left": {
                                      "inject": {
                                        "typeName": "hydra.core.errors.Error",
                                        "field": {
                                          "name": "extraction",
                                          "term": {
                                            "inject": {
                                              "typeName": "hydra.core.errors.ExtractionError",
                                              "field": {
                                                "name": "unexpectedShape",
                                                "term": {
                                                  "record": {
                                                    "typeName": "hydra.core.errors.UnexpectedShapeError",
                                                    "fields": [
                                                      {"name": "expected", "term": {"literal": {"string": "string"}}},
                                                      {
                                                        "name": "actual",
                                                        "term": {"application": {"function": {"variable": "hydra.core.print.model.literal"}, "argument": {"variable": "v"}}}}]}}}}}}}}}},
                                "type": {"variable": "hydra.core.errors.Error"}}},
                            "type": {"literal": "string"}}},
                        "cases": [
                          {
                            "name": "string",
                            "handler": {
                              "lambda": {
                                "parameter": "s",
                                "domain": {"literal": "string"},
                                "body": {
                                  "typeApplication": {
                                    "body": {"typeApplication": {"body": {"either": {"right": {"variable": "s"}}}, "type": {"variable": "hydra.core.errors.Error"}}},
                                    "type": {"literal": "string"}}}}}}]}},
                    "argument": {"variable": "v"}}}}},
            "annotation": {
              "map": [
                {"key": {"variable": "description"}, "value": {"literal": {"string": "Extract a string literal from a Literal value"}}}]}}}}},
    {
      "term": {
        "name": "hydra.core.extract.model.stripWithDecodingError",
        "signature": {
          "typeParameters": [],
          "parameters": [
            {"name": "arg0", "type": {"variable": "hydra.core.graph.Graph"}, "isLazy": false},
            {"name": "arg1", "type": {"variable": "hydra.core.model.Term"}, "isLazy": false}],
          "result": {
            "type": {"either": {"left": {"variable": "hydra.core.errors.DecodingError"}, "right": {"variable": "hydra.core.model.Term"}}}}},
        "body": {
          "annotated": {
            "body": {
              "lambda": {
                "parameter": "g",
                "domain": {"variable": "hydra.core.graph.Graph"},
                "body": {
                  "lambda": {
                    "parameter": "term",
                    "domain": {"variable": "hydra.core.model.Term"},
                    "body": {
                      "application": {
                        "function": {
                          "application": {
                            "function": {
                              "application": {
                                "function": {
                                  "typeApplication": {
                                    "body": {
                                      "typeApplication": {
                                        "body": {
                                          "typeApplication": {
                                            "body": {
                                              "typeApplication": {"body": {"variable": "hydra.core.lib.eithers.bimap"}, "type": {"variable": "hydra.core.errors.Error"}}},
                                            "type": {"variable": "hydra.core.model.Term"}}},
                                        "type": {"variable": "hydra.core.errors.DecodingError"}}},
                                    "type": {"variable": "hydra.core.model.Term"}}},
                                "argument": {
                                  "lambda": {
                                    "parameter": "_e",
                                    "domain": {"variable": "hydra.core.errors.Error"},
                                    "body": {
                                      "wrap": {
                                        "typeName": "hydra.core.errors.DecodingError",
                                        "body": {"application": {"function": {"variable": "hydra.core.print.errors.error"}, "argument": {"variable": "_e"}}}}}}}}},
                            "argument": {"lambda": {"parameter": "x", "domain": {"variable": "hydra.core.model.Term"}, "body": {"variable": "x"}}}}},
                        "argument": {
                          "application": {
                            "function": {
                              "application": {"function": {"variable": "hydra.core.lexical.stripAndDereferenceTermEither"}, "argument": {"variable": "g"}}},
                            "argument": {"variable": "term"}}}}}}}}},
            "annotation": {
              "map": [
                {
                  "key": {"variable": "description"},
                  "value": {"literal": {"string": "Strip annotations and dereference variables, returning Either DecodingError Term"}}}]}}}}},
    {
      "term": {
        "name": "hydra.core.extract.model.termRecord",
        "signature": {
          "typeParameters": [],
          "parameters": [
            {"name": "arg0", "type": {"variable": "hydra.core.graph.Graph"}, "isLazy": false},
            {"name": "arg1", "type": {"variable": "hydra.core.model.Term"}, "isLazy": false}],
          "result": {
            "type": {"either": {"left": {"variable": "hydra.core.errors.Error"}, "right": {"variable": "hydra.core.model.Record"}}}}},
        "body": {
          "annotated": {
            "body": {
              "lambda": {
                "parameter": "graph",
                "domain": {"variable": "hydra.core.graph.Graph"},
                "body": {
                  "lambda": {
                    "parameter": "term0",
                    "domain": {"variable": "hydra.core.model.Term"},
                    "body": {
                      "application": {
                        "function": {
                          "application": {
                            "function": {
                              "typeApplication": {
                                "body": {
                                  "typeApplication": {
                                    "body": {
                                      "typeApplication": {"body": {"variable": "hydra.core.lib.eithers.bind"}, "type": {"variable": "hydra.core.errors.Error"}}},
                                    "type": {"variable": "hydra.core.model.Term"}}},
                                "type": {"variable": "hydra.core.model.Record"}}},
                            "argument": {
                              "application": {
                                "function": {
                                  "application": {"function": {"variable": "hydra.core.lexical.stripAndDereferenceTerm"}, "argument": {"variable": "graph"}}},
                                "argument": {"variable": "term0"}}}}},
                        "argument": {
                          "lambda": {
                            "parameter": "term",
                            "domain": {"variable": "hydra.core.model.Term"},
                            "body": {
                              "application": {
                                "function": {
                                  "cases": {
                                    "typeName": "hydra.core.model.Term",
                                    "default": {
                                      "typeApplication": {
                                        "body": {
                                          "typeApplication": {
                                            "body": {
                                              "either": {
                                                "left": {
                                                  "inject": {
                                                    "typeName": "hydra.core.errors.Error",
                                                    "field": {
                                                      "name": "extraction",
                                                      "term": {
                                                        "inject": {
                                                          "typeName": "hydra.core.errors.ExtractionError",
                                                          "field": {
                                                            "name": "unexpectedShape",
                                                            "term": {
                                                              "record": {
                                                                "typeName": "hydra.core.errors.UnexpectedShapeError",
                                                                "fields": [
                                                                  {"name": "expected", "term": {"literal": {"string": "record"}}},
                                                                  {
                                                                    "name": "actual",
                                                                    "term": {"application": {"function": {"variable": "hydra.core.print.model.term"}, "argument": {"variable": "term"}}}}]}}}}}}}}}},
                                            "type": {"variable": "hydra.core.errors.Error"}}},
                                        "type": {"variable": "hydra.core.model.Record"}}},
                                    "cases": [
                                      {
                                        "name": "record",
                                        "handler": {
                                          "lambda": {
                                            "parameter": "record",
                                            "domain": {"variable": "hydra.core.model.Record"},
                                            "body": {
                                              "typeApplication": {
                                                "body": {
                                                  "typeApplication": {"body": {"either": {"right": {"variable": "record"}}}, "type": {"variable": "hydra.core.errors.Error"}}},
                                                "type": {"variable": "hydra.core.model.Record"}}}}}}]}},
                                "argument": {"variable": "term"}}}}}}}}}}},
            "annotation": {"map": [{"key": {"variable": "description"}, "value": {"literal": {"string": "Extract a record from a term"}}}]}}}}},
    {
      "term": {
        "name": "hydra.core.extract.model.toFieldMap",
        "signature": {
          "typeParameters": [],
          "parameters": [{"name": "arg0", "type": {"variable": "hydra.core.model.Record"}, "isLazy": false}],
          "result": {"type": {"map": {"keys": {"variable": "hydra.core.model.Name"}, "values": {"variable": "hydra.core.model.Term"}}}}},
        "body": {
          "annotated": {
            "body": {
              "lambda": {
                "parameter": "record",
                "domain": {"variable": "hydra.core.model.Record"},
                "body": {
                  "application": {
                    "function": {
                      "typeApplication": {
                        "body": {
                          "typeApplication": {"body": {"variable": "hydra.core.lib.maps.fromList"}, "type": {"variable": "hydra.core.model.Name"}}},
                        "type": {"variable": "hydra.core.model.Term"}}},
                    "argument": {
                      "application": {
                        "function": {
                          "application": {
                            "function": {
                              "typeApplication": {
                                "body": {"typeApplication": {"body": {"variable": "hydra.core.lib.lists.map"}, "type": {"variable": "hydra.core.model.Field"}}},
                                "type": {"pair": {"first": {"variable": "hydra.core.model.Name"}, "second": {"variable": "hydra.core.model.Term"}}}}},
                            "argument": {
                              "lambda": {
                                "parameter": "f",
                                "domain": {"variable": "hydra.core.model.Field"},
                                "body": {
                                  "typeApplication": {
                                    "body": {
                                      "typeApplication": {
                                        "body": {
                                          "pair": {
                                            "first": {
                                              "application": {"function": {"project": {"typeName": "hydra.core.model.Field", "fieldName": "name"}}, "argument": {"variable": "f"}}},
                                            "second": {
                                              "application": {"function": {"project": {"typeName": "hydra.core.model.Field", "fieldName": "term"}}, "argument": {"variable": "f"}}}}},
                                        "type": {"variable": "hydra.core.model.Name"}}},
                                    "type": {"variable": "hydra.core.model.Term"}}}}}}},
                        "argument": {
                          "application": {
                            "function": {"project": {"typeName": "hydra.core.model.Record", "fieldName": "fields"}},
                            "argument": {"variable": "record"}}}}}}}}},
            "annotation": {
              "map": [
                {
                  "key": {"variable": "description"},
                  "value": {"literal": {"string": "Convert a Record's fields to a Map from Name to Term"}}}]}}}}},
    {
      "term": {
        "name": "hydra.core.extract.model.uint16",
        "signature": {
          "typeParameters": [],
          "parameters": [
            {"name": "arg0", "type": {"variable": "hydra.core.graph.Graph"}, "isLazy": false},
            {"name": "arg1", "type": {"variable": "hydra.core.model.Term"}, "isLazy": false}],
          "result": {"type": {"either": {"left": {"variable": "hydra.core.errors.Error"}, "right": {"literal": {"integer": "uint16"}}}}}},
        "body": {
          "annotated": {
            "body": {
              "lambda": {
                "parameter": "graph",
                "domain": {"variable": "hydra.core.graph.Graph"},
                "body": {
                  "lambda": {
                    "parameter": "t",
                    "domain": {"variable": "hydra.core.model.Term"},
                    "body": {
                      "application": {
                        "function": {
                          "application": {
                            "function": {
                              "typeApplication": {
                                "body": {
                                  "typeApplication": {
                                    "body": {
                                      "typeApplication": {"body": {"variable": "hydra.core.lib.eithers.bind"}, "type": {"variable": "hydra.core.errors.Error"}}},
                                    "type": {"variable": "hydra.core.model.Literal"}}},
                                "type": {"literal": {"integer": "uint16"}}}},
                            "argument": {
                              "application": {
                                "function": {"application": {"function": {"variable": "hydra.core.extract.model.literal"}, "argument": {"variable": "graph"}}},
                                "argument": {"variable": "t"}}}}},
                        "argument": {
                          "lambda": {
                            "parameter": "l",
                            "domain": {"variable": "hydra.core.model.Literal"},
                            "body": {
                              "application": {
                                "function": {
                                  "application": {
                                    "function": {
                                      "typeApplication": {
                                        "body": {
                                          "typeApplication": {
                                            "body": {
                                              "typeApplication": {"body": {"variable": "hydra.core.lib.eithers.bind"}, "type": {"variable": "hydra.core.errors.Error"}}},
                                            "type": {"variable": "hydra.core.model.IntegerValue"}}},
                                        "type": {"literal": {"integer": "uint16"}}}},
                                    "argument": {"application": {"function": {"variable": "hydra.core.extract.model.integerLiteral"}, "argument": {"variable": "l"}}}}},
                                "argument": {
                                  "lambda": {
                                    "parameter": "i",
                                    "domain": {"variable": "hydra.core.model.IntegerValue"},
                                    "body": {"application": {"function": {"variable": "hydra.core.extract.model.uint16Value"}, "argument": {"variable": "i"}}}}}}}}}}}}}}},
            "annotation": {
              "map": [
                {
                  "key": {"variable": "description"},
                  "value": {"literal": {"string": "Extract a 16-bit unsigned integer value from a term"}}}]}}}}},
    {
      "term": {
        "name": "hydra.core.extract.model.uint16Value",
        "signature": {
          "typeParameters": [],
          "parameters": [{"name": "arg0", "type": {"variable": "hydra.core.model.IntegerValue"}, "isLazy": false}],
          "result": {"type": {"either": {"left": {"variable": "hydra.core.errors.Error"}, "right": {"literal": {"integer": "uint16"}}}}}},
        "body": {
          "annotated": {
            "body": {
              "lambda": {
                "parameter": "v",
                "domain": {"variable": "hydra.core.model.IntegerValue"},
                "body": {
                  "application": {
                    "function": {
                      "cases": {
                        "typeName": "hydra.core.model.IntegerValue",
                        "default": {
                          "typeApplication": {
                            "body": {
                              "typeApplication": {
                                "body": {
                                  "either": {
                                    "left": {
                                      "inject": {
                                        "typeName": "hydra.core.errors.Error",
                                        "field": {
                                          "name": "extraction",
                                          "term": {
                                            "inject": {
                                              "typeName": "hydra.core.errors.ExtractionError",
                                              "field": {
                                                "name": "unexpectedShape",
                                                "term": {
                                                  "record": {
                                                    "typeName": "hydra.core.errors.UnexpectedShapeError",
                                                    "fields": [
                                                      {"name": "expected", "term": {"literal": {"string": "uint16"}}},
                                                      {
                                                        "name": "actual",
                                                        "term": {"application": {"function": {"variable": "hydra.core.print.model.integer"}, "argument": {"variable": "v"}}}}]}}}}}}}}}},
                                "type": {"variable": "hydra.core.errors.Error"}}},
                            "type": {"literal": {"integer": "uint16"}}}},
                        "cases": [
                          {
                            "name": "uint16",
                            "handler": {
                              "lambda": {
                                "parameter": "i",
                                "domain": {"literal": {"integer": "uint16"}},
                                "body": {
                                  "typeApplication": {
                                    "body": {"typeApplication": {"body": {"either": {"right": {"variable": "i"}}}, "type": {"variable": "hydra.core.errors.Error"}}},
                                    "type": {"literal": {"integer": "uint16"}}}}}}}]}},
                    "argument": {"variable": "v"}}}}},
            "annotation": {
              "map": [{"key": {"variable": "description"}, "value": {"literal": {"string": "Extract a uint16 value from an IntegerValue"}}}]}}}}},
    {
      "term": {
        "name": "hydra.core.extract.model.uint32",
        "signature": {
          "typeParameters": [],
          "parameters": [
            {"name": "arg0", "type": {"variable": "hydra.core.graph.Graph"}, "isLazy": false},
            {"name": "arg1", "type": {"variable": "hydra.core.model.Term"}, "isLazy": false}],
          "result": {"type": {"either": {"left": {"variable": "hydra.core.errors.Error"}, "right": {"literal": {"integer": "uint32"}}}}}},
        "body": {
          "annotated": {
            "body": {
              "lambda": {
                "parameter": "graph",
                "domain": {"variable": "hydra.core.graph.Graph"},
                "body": {
                  "lambda": {
                    "parameter": "t",
                    "domain": {"variable": "hydra.core.model.Term"},
                    "body": {
                      "application": {
                        "function": {
                          "application": {
                            "function": {
                              "typeApplication": {
                                "body": {
                                  "typeApplication": {
                                    "body": {
                                      "typeApplication": {"body": {"variable": "hydra.core.lib.eithers.bind"}, "type": {"variable": "hydra.core.errors.Error"}}},
                                    "type": {"variable": "hydra.core.model.Literal"}}},
                                "type": {"literal": {"integer": "uint32"}}}},
                            "argument": {
                              "application": {
                                "function": {"application": {"function": {"variable": "hydra.core.extract.model.literal"}, "argument": {"variable": "graph"}}},
                                "argument": {"variable": "t"}}}}},
                        "argument": {
                          "lambda": {
                            "parameter": "l",
                            "domain": {"variable": "hydra.core.model.Literal"},
                            "body": {
                              "application": {
                                "function": {
                                  "application": {
                                    "function": {
                                      "typeApplication": {
                                        "body": {
                                          "typeApplication": {
                                            "body": {
                                              "typeApplication": {"body": {"variable": "hydra.core.lib.eithers.bind"}, "type": {"variable": "hydra.core.errors.Error"}}},
                                            "type": {"variable": "hydra.core.model.IntegerValue"}}},
                                        "type": {"literal": {"integer": "uint32"}}}},
                                    "argument": {"application": {"function": {"variable": "hydra.core.extract.model.integerLiteral"}, "argument": {"variable": "l"}}}}},
                                "argument": {
                                  "lambda": {
                                    "parameter": "i",
                                    "domain": {"variable": "hydra.core.model.IntegerValue"},
                                    "body": {"application": {"function": {"variable": "hydra.core.extract.model.uint32Value"}, "argument": {"variable": "i"}}}}}}}}}}}}}}},
            "annotation": {
              "map": [
                {
                  "key": {"variable": "description"},
                  "value": {"literal": {"string": "Extract a 32-bit unsigned integer value from a term"}}}]}}}}},
    {
      "term": {
        "name": "hydra.core.extract.model.uint32Value",
        "signature": {
          "typeParameters": [],
          "parameters": [{"name": "arg0", "type": {"variable": "hydra.core.model.IntegerValue"}, "isLazy": false}],
          "result": {"type": {"either": {"left": {"variable": "hydra.core.errors.Error"}, "right": {"literal": {"integer": "uint32"}}}}}},
        "body": {
          "annotated": {
            "body": {
              "lambda": {
                "parameter": "v",
                "domain": {"variable": "hydra.core.model.IntegerValue"},
                "body": {
                  "application": {
                    "function": {
                      "cases": {
                        "typeName": "hydra.core.model.IntegerValue",
                        "default": {
                          "typeApplication": {
                            "body": {
                              "typeApplication": {
                                "body": {
                                  "either": {
                                    "left": {
                                      "inject": {
                                        "typeName": "hydra.core.errors.Error",
                                        "field": {
                                          "name": "extraction",
                                          "term": {
                                            "inject": {
                                              "typeName": "hydra.core.errors.ExtractionError",
                                              "field": {
                                                "name": "unexpectedShape",
                                                "term": {
                                                  "record": {
                                                    "typeName": "hydra.core.errors.UnexpectedShapeError",
                                                    "fields": [
                                                      {"name": "expected", "term": {"literal": {"string": "uint32"}}},
                                                      {
                                                        "name": "actual",
                                                        "term": {"application": {"function": {"variable": "hydra.core.print.model.integer"}, "argument": {"variable": "v"}}}}]}}}}}}}}}},
                                "type": {"variable": "hydra.core.errors.Error"}}},
                            "type": {"literal": {"integer": "uint32"}}}},
                        "cases": [
                          {
                            "name": "uint32",
                            "handler": {
                              "lambda": {
                                "parameter": "i",
                                "domain": {"literal": {"integer": "uint32"}},
                                "body": {
                                  "typeApplication": {
                                    "body": {"typeApplication": {"body": {"either": {"right": {"variable": "i"}}}, "type": {"variable": "hydra.core.errors.Error"}}},
                                    "type": {"literal": {"integer": "uint32"}}}}}}}]}},
                    "argument": {"variable": "v"}}}}},
            "annotation": {
              "map": [{"key": {"variable": "description"}, "value": {"literal": {"string": "Extract a uint32 value from an IntegerValue"}}}]}}}}},
    {
      "term": {
        "name": "hydra.core.extract.model.uint64",
        "signature": {
          "typeParameters": [],
          "parameters": [
            {"name": "arg0", "type": {"variable": "hydra.core.graph.Graph"}, "isLazy": false},
            {"name": "arg1", "type": {"variable": "hydra.core.model.Term"}, "isLazy": false}],
          "result": {"type": {"either": {"left": {"variable": "hydra.core.errors.Error"}, "right": {"literal": {"integer": "uint64"}}}}}},
        "body": {
          "annotated": {
            "body": {
              "lambda": {
                "parameter": "graph",
                "domain": {"variable": "hydra.core.graph.Graph"},
                "body": {
                  "lambda": {
                    "parameter": "t",
                    "domain": {"variable": "hydra.core.model.Term"},
                    "body": {
                      "application": {
                        "function": {
                          "application": {
                            "function": {
                              "typeApplication": {
                                "body": {
                                  "typeApplication": {
                                    "body": {
                                      "typeApplication": {"body": {"variable": "hydra.core.lib.eithers.bind"}, "type": {"variable": "hydra.core.errors.Error"}}},
                                    "type": {"variable": "hydra.core.model.Literal"}}},
                                "type": {"literal": {"integer": "uint64"}}}},
                            "argument": {
                              "application": {
                                "function": {"application": {"function": {"variable": "hydra.core.extract.model.literal"}, "argument": {"variable": "graph"}}},
                                "argument": {"variable": "t"}}}}},
                        "argument": {
                          "lambda": {
                            "parameter": "l",
                            "domain": {"variable": "hydra.core.model.Literal"},
                            "body": {
                              "application": {
                                "function": {
                                  "application": {
                                    "function": {
                                      "typeApplication": {
                                        "body": {
                                          "typeApplication": {
                                            "body": {
                                              "typeApplication": {"body": {"variable": "hydra.core.lib.eithers.bind"}, "type": {"variable": "hydra.core.errors.Error"}}},
                                            "type": {"variable": "hydra.core.model.IntegerValue"}}},
                                        "type": {"literal": {"integer": "uint64"}}}},
                                    "argument": {"application": {"function": {"variable": "hydra.core.extract.model.integerLiteral"}, "argument": {"variable": "l"}}}}},
                                "argument": {
                                  "lambda": {
                                    "parameter": "i",
                                    "domain": {"variable": "hydra.core.model.IntegerValue"},
                                    "body": {"application": {"function": {"variable": "hydra.core.extract.model.uint64Value"}, "argument": {"variable": "i"}}}}}}}}}}}}}}},
            "annotation": {
              "map": [
                {
                  "key": {"variable": "description"},
                  "value": {"literal": {"string": "Extract a 64-bit unsigned integer value from a term"}}}]}}}}},
    {
      "term": {
        "name": "hydra.core.extract.model.uint64Value",
        "signature": {
          "typeParameters": [],
          "parameters": [{"name": "arg0", "type": {"variable": "hydra.core.model.IntegerValue"}, "isLazy": false}],
          "result": {"type": {"either": {"left": {"variable": "hydra.core.errors.Error"}, "right": {"literal": {"integer": "uint64"}}}}}},
        "body": {
          "annotated": {
            "body": {
              "lambda": {
                "parameter": "v",
                "domain": {"variable": "hydra.core.model.IntegerValue"},
                "body": {
                  "application": {
                    "function": {
                      "cases": {
                        "typeName": "hydra.core.model.IntegerValue",
                        "default": {
                          "typeApplication": {
                            "body": {
                              "typeApplication": {
                                "body": {
                                  "either": {
                                    "left": {
                                      "inject": {
                                        "typeName": "hydra.core.errors.Error",
                                        "field": {
                                          "name": "extraction",
                                          "term": {
                                            "inject": {
                                              "typeName": "hydra.core.errors.ExtractionError",
                                              "field": {
                                                "name": "unexpectedShape",
                                                "term": {
                                                  "record": {
                                                    "typeName": "hydra.core.errors.UnexpectedShapeError",
                                                    "fields": [
                                                      {"name": "expected", "term": {"literal": {"string": "uint64"}}},
                                                      {
                                                        "name": "actual",
                                                        "term": {"application": {"function": {"variable": "hydra.core.print.model.integer"}, "argument": {"variable": "v"}}}}]}}}}}}}}}},
                                "type": {"variable": "hydra.core.errors.Error"}}},
                            "type": {"literal": {"integer": "uint64"}}}},
                        "cases": [
                          {
                            "name": "uint64",
                            "handler": {
                              "lambda": {
                                "parameter": "i",
                                "domain": {"literal": {"integer": "uint64"}},
                                "body": {
                                  "typeApplication": {
                                    "body": {"typeApplication": {"body": {"either": {"right": {"variable": "i"}}}, "type": {"variable": "hydra.core.errors.Error"}}},
                                    "type": {"literal": {"integer": "uint64"}}}}}}}]}},
                    "argument": {"variable": "v"}}}}},
            "annotation": {
              "map": [{"key": {"variable": "description"}, "value": {"literal": {"string": "Extract a uint64 value from an IntegerValue"}}}]}}}}},
    {
      "term": {
        "name": "hydra.core.extract.model.uint8",
        "signature": {
          "typeParameters": [],
          "parameters": [
            {"name": "arg0", "type": {"variable": "hydra.core.graph.Graph"}, "isLazy": false},
            {"name": "arg1", "type": {"variable": "hydra.core.model.Term"}, "isLazy": false}],
          "result": {"type": {"either": {"left": {"variable": "hydra.core.errors.Error"}, "right": {"literal": {"integer": "uint8"}}}}}},
        "body": {
          "annotated": {
            "body": {
              "lambda": {
                "parameter": "graph",
                "domain": {"variable": "hydra.core.graph.Graph"},
                "body": {
                  "lambda": {
                    "parameter": "t",
                    "domain": {"variable": "hydra.core.model.Term"},
                    "body": {
                      "application": {
                        "function": {
                          "application": {
                            "function": {
                              "typeApplication": {
                                "body": {
                                  "typeApplication": {
                                    "body": {
                                      "typeApplication": {"body": {"variable": "hydra.core.lib.eithers.bind"}, "type": {"variable": "hydra.core.errors.Error"}}},
                                    "type": {"variable": "hydra.core.model.Literal"}}},
                                "type": {"literal": {"integer": "uint8"}}}},
                            "argument": {
                              "application": {
                                "function": {"application": {"function": {"variable": "hydra.core.extract.model.literal"}, "argument": {"variable": "graph"}}},
                                "argument": {"variable": "t"}}}}},
                        "argument": {
                          "lambda": {
                            "parameter": "l",
                            "domain": {"variable": "hydra.core.model.Literal"},
                            "body": {
                              "application": {
                                "function": {
                                  "application": {
                                    "function": {
                                      "typeApplication": {
                                        "body": {
                                          "typeApplication": {
                                            "body": {
                                              "typeApplication": {"body": {"variable": "hydra.core.lib.eithers.bind"}, "type": {"variable": "hydra.core.errors.Error"}}},
                                            "type": {"variable": "hydra.core.model.IntegerValue"}}},
                                        "type": {"literal": {"integer": "uint8"}}}},
                                    "argument": {"application": {"function": {"variable": "hydra.core.extract.model.integerLiteral"}, "argument": {"variable": "l"}}}}},
                                "argument": {
                                  "lambda": {
                                    "parameter": "i",
                                    "domain": {"variable": "hydra.core.model.IntegerValue"},
                                    "body": {"application": {"function": {"variable": "hydra.core.extract.model.uint8Value"}, "argument": {"variable": "i"}}}}}}}}}}}}}}},
            "annotation": {
              "map": [
                {
                  "key": {"variable": "description"},
                  "value": {"literal": {"string": "Extract an 8-bit unsigned integer value from a term"}}}]}}}}},
    {
      "term": {
        "name": "hydra.core.extract.model.uint8Value",
        "signature": {
          "typeParameters": [],
          "parameters": [{"name": "arg0", "type": {"variable": "hydra.core.model.IntegerValue"}, "isLazy": false}],
          "result": {"type": {"either": {"left": {"variable": "hydra.core.errors.Error"}, "right": {"literal": {"integer": "uint8"}}}}}},
        "body": {
          "annotated": {
            "body": {
              "lambda": {
                "parameter": "v",
                "domain": {"variable": "hydra.core.model.IntegerValue"},
                "body": {
                  "application": {
                    "function": {
                      "cases": {
                        "typeName": "hydra.core.model.IntegerValue",
                        "default": {
                          "typeApplication": {
                            "body": {
                              "typeApplication": {
                                "body": {
                                  "either": {
                                    "left": {
                                      "inject": {
                                        "typeName": "hydra.core.errors.Error",
                                        "field": {
                                          "name": "extraction",
                                          "term": {
                                            "inject": {
                                              "typeName": "hydra.core.errors.ExtractionError",
                                              "field": {
                                                "name": "unexpectedShape",
                                                "term": {
                                                  "record": {
                                                    "typeName": "hydra.core.errors.UnexpectedShapeError",
                                                    "fields": [
                                                      {"name": "expected", "term": {"literal": {"string": "uint8"}}},
                                                      {
                                                        "name": "actual",
                                                        "term": {"application": {"function": {"variable": "hydra.core.print.model.integer"}, "argument": {"variable": "v"}}}}]}}}}}}}}}},
                                "type": {"variable": "hydra.core.errors.Error"}}},
                            "type": {"literal": {"integer": "uint8"}}}},
                        "cases": [
                          {
                            "name": "uint8",
                            "handler": {
                              "lambda": {
                                "parameter": "i",
                                "domain": {"literal": {"integer": "uint8"}},
                                "body": {
                                  "typeApplication": {
                                    "body": {"typeApplication": {"body": {"either": {"right": {"variable": "i"}}}, "type": {"variable": "hydra.core.errors.Error"}}},
                                    "type": {"literal": {"integer": "uint8"}}}}}}}]}},
                    "argument": {"variable": "v"}}}}},
            "annotation": {
              "map": [{"key": {"variable": "description"}, "value": {"literal": {"string": "Extract a uint8 value from an IntegerValue"}}}]}}}}},
    {
      "term": {
        "name": "hydra.core.extract.model.unionType",
        "signature": {
          "typeParameters": [{"name": "t0", "constraints": []}],
          "parameters": [
            {"name": "arg0", "type": {"variable": "t0"}, "isLazy": false},
            {"name": "arg1", "type": {"variable": "hydra.core.model.Type"}, "isLazy": false}],
          "result": {
            "type": {
              "either": {"left": {"variable": "hydra.core.errors.Error"}, "right": {"list": {"variable": "hydra.core.model.FieldType"}}}}}},
        "body": {
          "typeLambda": {
            "parameter": "t0",
            "body": {
              "annotated": {
                "body": {
                  "lambda": {
                    "parameter": "ename",
                    "domain": {"variable": "t0"},
                    "body": {
                      "lambda": {
                        "parameter": "typ",
                        "domain": {"variable": "hydra.core.model.Type"},
                        "body": {
                          "let": {
                            "bindings": [
                              {
                                "name": "stripped",
                                "term": {"application": {"function": {"variable": "hydra.core.strip.deannotateType"}, "argument": {"variable": "typ"}}},
                                "typeScheme": {"variables": [], "body": {"variable": "hydra.core.model.Type"}, "constraints": []}}],
                            "body": {
                              "application": {
                                "function": {
                                  "cases": {
                                    "typeName": "hydra.core.model.Type",
                                    "default": {
                                      "typeApplication": {
                                        "body": {
                                          "typeApplication": {
                                            "body": {
                                              "either": {
                                                "left": {
                                                  "inject": {
                                                    "typeName": "hydra.core.errors.Error",
                                                    "field": {
                                                      "name": "extraction",
                                                      "term": {
                                                        "inject": {
                                                          "typeName": "hydra.core.errors.ExtractionError",
                                                          "field": {
                                                            "name": "unexpectedShape",
                                                            "term": {
                                                              "record": {
                                                                "typeName": "hydra.core.errors.UnexpectedShapeError",
                                                                "fields": [
                                                                  {"name": "expected", "term": {"literal": {"string": "union type"}}},
                                                                  {
                                                                    "name": "actual",
                                                                    "term": {"application": {"function": {"variable": "hydra.core.print.model.type"}, "argument": {"variable": "typ"}}}}]}}}}}}}}}},
                                            "type": {"variable": "hydra.core.errors.Error"}}},
                                        "type": {"list": {"variable": "hydra.core.model.FieldType"}}}},
                                    "cases": [
                                      {
                                        "name": "union",
                                        "handler": {
                                          "lambda": {
                                            "parameter": "fields",
                                            "domain": {"list": {"variable": "hydra.core.model.FieldType"}},
                                            "body": {
                                              "typeApplication": {
                                                "body": {
                                                  "typeApplication": {"body": {"either": {"right": {"variable": "fields"}}}, "type": {"variable": "hydra.core.errors.Error"}}},
                                                "type": {"list": {"variable": "hydra.core.model.FieldType"}}}}}}}]}},
                                "argument": {"variable": "stripped"}}}}}}}}},
                "annotation": {
                  "map": [{"key": {"variable": "description"}, "value": {"literal": {"string": "Extract the field types from a union type"}}}]}}}}}}},
    {
      "term": {
        "name": "hydra.core.extract.model.unit",
        "signature": {
          "typeParameters": [],
          "parameters": [{"name": "arg0", "type": {"variable": "hydra.core.model.Term"}, "isLazy": false}],
          "result": {"type": {"either": {"left": {"variable": "hydra.core.errors.Error"}, "right": "unit"}}}},
        "body": {
          "annotated": {
            "body": {
              "lambda": {
                "parameter": "term",
                "domain": {"variable": "hydra.core.model.Term"},
                "body": {
                  "application": {
                    "function": {
                      "cases": {
                        "typeName": "hydra.core.model.Term",
                        "default": {
                          "typeApplication": {
                            "body": {
                              "typeApplication": {
                                "body": {
                                  "either": {
                                    "left": {
                                      "inject": {
                                        "typeName": "hydra.core.errors.Error",
                                        "field": {
                                          "name": "extraction",
                                          "term": {
                                            "inject": {
                                              "typeName": "hydra.core.errors.ExtractionError",
                                              "field": {
                                                "name": "unexpectedShape",
                                                "term": {
                                                  "record": {
                                                    "typeName": "hydra.core.errors.UnexpectedShapeError",
                                                    "fields": [
                                                      {"name": "expected", "term": {"literal": {"string": "unit"}}},
                                                      {
                                                        "name": "actual",
                                                        "term": {"application": {"function": {"variable": "hydra.core.print.model.term"}, "argument": {"variable": "term"}}}}]}}}}}}}}}},
                                "type": {"variable": "hydra.core.errors.Error"}}},
                            "type": "unit"}},
                        "cases": [
                          {
                            "name": "unit",
                            "handler": {
                              "lambda": {
                                "parameter": "_",
                                "domain": "unit",
                                "body": {
                                  "typeApplication": {
                                    "body": {"typeApplication": {"body": {"either": {"right": "unit"}}, "type": {"variable": "hydra.core.errors.Error"}}},
                                    "type": "unit"}}}}}]}},
                    "argument": {"variable": "term"}}}}},
            "annotation": {"map": [{"key": {"variable": "description"}, "value": {"literal": {"string": "Extract a unit value from a term"}}}]}}}}},
    {
      "term": {
        "name": "hydra.core.extract.model.unitVariant",
        "signature": {
          "typeParameters": [],
          "parameters": [
            {"name": "arg0", "type": {"variable": "hydra.core.model.Name"}, "isLazy": false},
            {"name": "arg1", "type": {"variable": "hydra.core.graph.Graph"}, "isLazy": false},
            {"name": "arg2", "type": {"variable": "hydra.core.model.Term"}, "isLazy": false}],
          "result": {"type": {"either": {"left": {"variable": "hydra.core.errors.Error"}, "right": {"variable": "hydra.core.model.Name"}}}}},
        "body": {
          "annotated": {
            "body": {
              "lambda": {
                "parameter": "tname",
                "domain": {"variable": "hydra.core.model.Name"},
                "body": {
                  "lambda": {
                    "parameter": "graph",
                    "domain": {"variable": "hydra.core.graph.Graph"},
                    "body": {
                      "lambda": {
                        "parameter": "term",
                        "domain": {"variable": "hydra.core.model.Term"},
                        "body": {
                          "application": {
                            "function": {
                              "application": {
                                "function": {
                                  "typeApplication": {
                                    "body": {
                                      "typeApplication": {
                                        "body": {
                                          "typeApplication": {"body": {"variable": "hydra.core.lib.eithers.bind"}, "type": {"variable": "hydra.core.errors.Error"}}},
                                        "type": {"variable": "hydra.core.model.Field"}}},
                                    "type": {"variable": "hydra.core.model.Name"}}},
                                "argument": {
                                  "application": {
                                    "function": {
                                      "application": {
                                        "function": {"application": {"function": {"variable": "hydra.core.extract.model.injection"}, "argument": {"variable": "tname"}}},
                                        "argument": {"variable": "graph"}}},
                                    "argument": {"variable": "term"}}}}},
                            "argument": {
                              "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.bind"}, "type": {"variable": "hydra.core.errors.Error"}}},
                                                "type": "unit"}},
                                            "type": {"variable": "hydra.core.model.Name"}}},
                                        "argument": {
                                          "application": {
                                            "function": {"variable": "hydra.core.extract.model.unit"},
                                            "argument": {
                                              "application": {
                                                "function": {"project": {"typeName": "hydra.core.model.Field", "fieldName": "term"}},
                                                "argument": {"variable": "field"}}}}}}},
                                    "argument": {
                                      "lambda": {
                                        "parameter": "ignored",
                                        "domain": "unit",
                                        "body": {
                                          "typeApplication": {
                                            "body": {
                                              "typeApplication": {
                                                "body": {
                                                  "either": {
                                                    "right": {
                                                      "application": {
                                                        "function": {"project": {"typeName": "hydra.core.model.Field", "fieldName": "name"}},
                                                        "argument": {"variable": "field"}}}}},
                                                "type": {"variable": "hydra.core.errors.Error"}}},
                                            "type": {"variable": "hydra.core.model.Name"}}}}}}}}}}}}}}}}},
            "annotation": {
              "map": [
                {
                  "key": {"variable": "description"},
                  "value": {"literal": {"string": "Extract a unit variant (a variant with an empty record value) from a union term"}}}]}}}}},
    {
      "term": {
        "name": "hydra.core.extract.model.wrap",
        "signature": {
          "typeParameters": [],
          "parameters": [
            {"name": "arg0", "type": {"variable": "hydra.core.model.Name"}, "isLazy": false},
            {"name": "arg1", "type": {"variable": "hydra.core.graph.Graph"}, "isLazy": false},
            {"name": "arg2", "type": {"variable": "hydra.core.model.Term"}, "isLazy": false}],
          "result": {"type": {"either": {"left": {"variable": "hydra.core.errors.Error"}, "right": {"variable": "hydra.core.model.Term"}}}}},
        "body": {
          "annotated": {
            "body": {
              "lambda": {
                "parameter": "expected",
                "domain": {"variable": "hydra.core.model.Name"},
                "body": {
                  "lambda": {
                    "parameter": "graph",
                    "domain": {"variable": "hydra.core.graph.Graph"},
                    "body": {
                      "lambda": {
                        "parameter": "term0",
                        "domain": {"variable": "hydra.core.model.Term"},
                        "body": {
                          "application": {
                            "function": {
                              "application": {
                                "function": {
                                  "typeApplication": {
                                    "body": {
                                      "typeApplication": {
                                        "body": {
                                          "typeApplication": {"body": {"variable": "hydra.core.lib.eithers.bind"}, "type": {"variable": "hydra.core.errors.Error"}}},
                                        "type": {"variable": "hydra.core.model.Term"}}},
                                    "type": {"variable": "hydra.core.model.Term"}}},
                                "argument": {
                                  "application": {
                                    "function": {
                                      "application": {"function": {"variable": "hydra.core.lexical.stripAndDereferenceTerm"}, "argument": {"variable": "graph"}}},
                                    "argument": {"variable": "term0"}}}}},
                            "argument": {
                              "lambda": {
                                "parameter": "term",
                                "domain": {"variable": "hydra.core.model.Term"},
                                "body": {
                                  "application": {
                                    "function": {
                                      "cases": {
                                        "typeName": "hydra.core.model.Term",
                                        "default": {
                                          "typeApplication": {
                                            "body": {
                                              "typeApplication": {
                                                "body": {
                                                  "either": {
                                                    "left": {
                                                      "inject": {
                                                        "typeName": "hydra.core.errors.Error",
                                                        "field": {
                                                          "name": "extraction",
                                                          "term": {
                                                            "inject": {
                                                              "typeName": "hydra.core.errors.ExtractionError",
                                                              "field": {
                                                                "name": "unexpectedShape",
                                                                "term": {
                                                                  "record": {
                                                                    "typeName": "hydra.core.errors.UnexpectedShapeError",
                                                                    "fields": [
                                                                      {
                                                                        "name": "expected",
                                                                        "term": {
                                                                          "application": {
                                                                            "function": {
                                                                              "application": {
                                                                                "function": {"variable": "hydra.core.lib.strings.concat2"},
                                                                                "argument": {
                                                                                  "application": {
                                                                                    "function": {
                                                                                      "application": {"function": {"variable": "hydra.core.lib.strings.concat2"}, "argument": {"literal": {"string": "wrap("}}}},
                                                                                    "argument": {"application": {"function": {"unwrap": "hydra.core.model.Name"}, "argument": {"variable": "expected"}}}}}}},
                                                                            "argument": {"literal": {"string": ")"}}}}},
                                                                      {
                                                                        "name": "actual",
                                                                        "term": {"application": {"function": {"variable": "hydra.core.print.model.term"}, "argument": {"variable": "term"}}}}]}}}}}}}}}},
                                                "type": {"variable": "hydra.core.errors.Error"}}},
                                            "type": {"variable": "hydra.core.model.Term"}}},
                                        "cases": [
                                          {
                                            "name": "wrap",
                                            "handler": {
                                              "lambda": {
                                                "parameter": "wrappedTerm",
                                                "domain": {"variable": "hydra.core.model.WrappedTerm"},
                                                "body": {
                                                  "application": {
                                                    "function": {
                                                      "application": {
                                                        "function": {
                                                          "application": {
                                                            "function": {
                                                              "typeApplication": {
                                                                "body": {"variable": "hydra.core.lib.logic.ifElse"},
                                                                "type": {"either": {"left": {"variable": "hydra.core.errors.Error"}, "right": {"variable": "hydra.core.model.Term"}}}}},
                                                            "argument": {
                                                              "application": {
                                                                "function": {
                                                                  "application": {
                                                                    "function": {"typeApplication": {"body": {"variable": "hydra.core.lib.equality.equal"}, "type": {"literal": "string"}}},
                                                                    "argument": {
                                                                      "application": {
                                                                        "function": {"unwrap": "hydra.core.model.Name"},
                                                                        "argument": {
                                                                          "application": {
                                                                            "function": {"project": {"typeName": "hydra.core.model.WrappedTerm", "fieldName": "typeName"}},
                                                                            "argument": {"variable": "wrappedTerm"}}}}}}},
                                                                "argument": {"application": {"function": {"unwrap": "hydra.core.model.Name"}, "argument": {"variable": "expected"}}}}}}},
                                                        "argument": {
                                                          "typeApplication": {
                                                            "body": {
                                                              "typeApplication": {
                                                                "body": {
                                                                  "either": {
                                                                    "right": {
                                                                      "application": {
                                                                        "function": {"project": {"typeName": "hydra.core.model.WrappedTerm", "fieldName": "body"}},
                                                                        "argument": {"variable": "wrappedTerm"}}}}},
                                                                "type": {"variable": "hydra.core.errors.Error"}}},
                                                            "type": {"variable": "hydra.core.model.Term"}}}}},
                                                    "argument": {
                                                      "typeApplication": {
                                                        "body": {
                                                          "typeApplication": {
                                                            "body": {
                                                              "either": {
                                                                "left": {
                                                                  "inject": {
                                                                    "typeName": "hydra.core.errors.Error",
                                                                    "field": {
                                                                      "name": "extraction",
                                                                      "term": {
                                                                        "inject": {
                                                                          "typeName": "hydra.core.errors.ExtractionError",
                                                                          "field": {
                                                                            "name": "unexpectedShape",
                                                                            "term": {
                                                                              "record": {
                                                                                "typeName": "hydra.core.errors.UnexpectedShapeError",
                                                                                "fields": [
                                                                                  {
                                                                                    "name": "expected",
                                                                                    "term": {
                                                                                      "application": {
                                                                                        "function": {
                                                                                          "application": {"function": {"variable": "hydra.core.lib.strings.concat2"}, "argument": {"literal": {"string": "wrapper of type "}}}},
                                                                                        "argument": {"application": {"function": {"unwrap": "hydra.core.model.Name"}, "argument": {"variable": "expected"}}}}}},
                                                                                  {
                                                                                    "name": "actual",
                                                                                    "term": {
                                                                                      "application": {
                                                                                        "function": {"unwrap": "hydra.core.model.Name"},
                                                                                        "argument": {
                                                                                          "application": {
                                                                                            "function": {"project": {"typeName": "hydra.core.model.WrappedTerm", "fieldName": "typeName"}},
                                                                                            "argument": {"variable": "wrappedTerm"}}}}}}]}}}}}}}}}},
                                                            "type": {"variable": "hydra.core.errors.Error"}}},
                                                        "type": {"variable": "hydra.core.model.Term"}}}}}}}}]}},
                                    "argument": {"variable": "term"}}}}}}}}}}}}},
            "annotation": {
              "map": [
                {"key": {"variable": "description"}, "value": {"literal": {"string": "Extract the wrapped value from a wrapped term"}}}]}}}}},
    {
      "term": {
        "name": "hydra.core.extract.model.wrappedType",
        "signature": {
          "typeParameters": [{"name": "t0", "constraints": []}],
          "parameters": [
            {"name": "arg0", "type": {"variable": "t0"}, "isLazy": false},
            {"name": "arg1", "type": {"variable": "hydra.core.model.Type"}, "isLazy": false}],
          "result": {"type": {"either": {"left": {"variable": "hydra.core.errors.Error"}, "right": {"variable": "hydra.core.model.Type"}}}}},
        "body": {
          "typeLambda": {
            "parameter": "t0",
            "body": {
              "annotated": {
                "body": {
                  "lambda": {
                    "parameter": "ename",
                    "domain": {"variable": "t0"},
                    "body": {
                      "lambda": {
                        "parameter": "typ",
                        "domain": {"variable": "hydra.core.model.Type"},
                        "body": {
                          "let": {
                            "bindings": [
                              {
                                "name": "stripped",
                                "term": {"application": {"function": {"variable": "hydra.core.strip.deannotateType"}, "argument": {"variable": "typ"}}},
                                "typeScheme": {"variables": [], "body": {"variable": "hydra.core.model.Type"}, "constraints": []}}],
                            "body": {
                              "application": {
                                "function": {
                                  "cases": {
                                    "typeName": "hydra.core.model.Type",
                                    "default": {
                                      "typeApplication": {
                                        "body": {
                                          "typeApplication": {
                                            "body": {
                                              "either": {
                                                "left": {
                                                  "inject": {
                                                    "typeName": "hydra.core.errors.Error",
                                                    "field": {
                                                      "name": "extraction",
                                                      "term": {
                                                        "inject": {
                                                          "typeName": "hydra.core.errors.ExtractionError",
                                                          "field": {
                                                            "name": "unexpectedShape",
                                                            "term": {
                                                              "record": {
                                                                "typeName": "hydra.core.errors.UnexpectedShapeError",
                                                                "fields": [
                                                                  {"name": "expected", "term": {"literal": {"string": "wrapped type"}}},
                                                                  {
                                                                    "name": "actual",
                                                                    "term": {"application": {"function": {"variable": "hydra.core.print.model.type"}, "argument": {"variable": "typ"}}}}]}}}}}}}}}},
                                            "type": {"variable": "hydra.core.errors.Error"}}},
                                        "type": {"variable": "hydra.core.model.Type"}}},
                                    "cases": [
                                      {
                                        "name": "wrap",
                                        "handler": {
                                          "lambda": {
                                            "parameter": "innerType",
                                            "domain": {"variable": "hydra.core.model.Type"},
                                            "body": {
                                              "typeApplication": {
                                                "body": {
                                                  "typeApplication": {"body": {"either": {"right": {"variable": "innerType"}}}, "type": {"variable": "hydra.core.errors.Error"}}},
                                                "type": {"variable": "hydra.core.model.Type"}}}}}}]}},
                                "argument": {"variable": "stripped"}}}}}}}}},
                "annotation": {
                  "map": [{"key": {"variable": "description"}, "value": {"literal": {"string": "Extract the wrapped type from a wrapper type"}}}]}}}}}}}]}