packages feed

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

{
  "name": "hydra.core.decode.tabular",
  "metadata": {"description": "Term decoders for hydra.core.tabular", "comments": [], "seeAlso": [], "provisions": []},
  "dependencies": [
    {"module": "hydra.core.extract.model"},
    {"module": "hydra.core.lexical"},
    {"module": "hydra.core.rewriting"},
    {"module": "hydra.core.tabular"},
    {"module": "hydra.core.util"},
    {"module": "hydra.core.decode.model"},
    {"module": "hydra.core.decode.relational"}],
  "definitions": [
    {
      "term": {
        "name": "hydra.core.decode.tabular.columnType",
        "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.tabular.ColumnType"}}}}},
        "body": {
          "annotated": {
            "body": {
              "lambda": {
                "parameter": "cx",
                "domain": {"variable": "hydra.core.graph.Graph"},
                "body": {
                  "lambda": {
                    "parameter": "raw",
                    "domain": {"variable": "hydra.core.model.Term"},
                    "body": {
                      "application": {
                        "function": {
                          "application": {
                            "function": {
                              "application": {
                                "function": {
                                  "typeApplication": {
                                    "body": {
                                      "typeApplication": {
                                        "body": {
                                          "typeApplication": {"body": {"variable": "hydra.core.lib.eithers.either"}, "type": {"variable": "hydra.core.errors.DecodingError"}}},
                                        "type": {"variable": "hydra.core.model.Term"}}},
                                    "type": {
                                      "either": {"left": {"variable": "hydra.core.errors.DecodingError"}, "right": {"variable": "hydra.core.tabular.ColumnType"}}}}},
                                "argument": {
                                  "lambda": {
                                    "parameter": "err",
                                    "domain": {"variable": "hydra.core.errors.DecodingError"},
                                    "body": {
                                      "typeApplication": {
                                        "body": {
                                          "typeApplication": {"body": {"either": {"left": {"variable": "err"}}}, "type": {"variable": "hydra.core.errors.DecodingError"}}},
                                        "type": {"variable": "hydra.core.tabular.ColumnType"}}}}}}},
                            "argument": {
                              "lambda": {
                                "parameter": "stripped",
                                "domain": {"variable": "hydra.core.model.Term"},
                                "body": {
                                  "application": {
                                    "function": {
                                      "cases": {
                                        "typeName": "hydra.core.model.Term",
                                        "default": {
                                          "typeApplication": {
                                            "body": {
                                              "typeApplication": {
                                                "body": {
                                                  "either": {
                                                    "left": {
                                                      "wrap": {
                                                        "typeName": "hydra.core.errors.DecodingError",
                                                        "body": {"literal": {"string": "expected a record of type hydra.core.tabular.ColumnType"}}}}}},
                                                "type": {"variable": "hydra.core.errors.DecodingError"}}},
                                            "type": {"variable": "hydra.core.tabular.ColumnType"}}},
                                        "cases": [
                                          {
                                            "name": "record",
                                            "handler": {
                                              "lambda": {
                                                "parameter": "record",
                                                "domain": {"variable": "hydra.core.model.Record"},
                                                "body": {
                                                  "let": {
                                                    "bindings": [
                                                      {
                                                        "name": "fieldMap",
                                                        "term": {"application": {"function": {"variable": "hydra.core.extract.model.toFieldMap"}, "argument": {"variable": "record"}}},
                                                        "typeScheme": {
                                                          "variables": [],
                                                          "body": {"map": {"keys": {"variable": "hydra.core.model.Name"}, "values": {"variable": "hydra.core.model.Term"}}},
                                                          "constraints": []}}],
                                                    "body": {
                                                      "application": {
                                                        "function": {
                                                          "application": {
                                                            "function": {
                                                              "typeApplication": {
                                                                "body": {
                                                                  "typeApplication": {
                                                                    "body": {
                                                                      "typeApplication": {"body": {"variable": "hydra.core.lib.eithers.bind"}, "type": {"variable": "hydra.core.errors.DecodingError"}}},
                                                                    "type": {"variable": "hydra.core.relational.ColumnName"}}},
                                                                "type": {"variable": "hydra.core.tabular.ColumnType"}}},
                                                            "argument": {
                                                              "application": {
                                                                "function": {
                                                                  "application": {
                                                                    "function": {
                                                                      "application": {
                                                                        "function": {
                                                                          "application": {
                                                                            "function": {
                                                                              "typeApplication": {
                                                                                "body": {
                                                                                  "typeApplication": {
                                                                                    "body": {
                                                                                      "typeApplication": {"body": {"variable": "hydra.core.extract.model.requireField"}, "type": {"variable": "hydra.core.graph.Graph"}}},
                                                                                    "type": {"variable": "hydra.core.model.Term"}}},
                                                                                "type": {"variable": "hydra.core.relational.ColumnName"}}},
                                                                            "argument": {"literal": {"string": "name"}}}},
                                                                        "argument": {"variable": "hydra.core.decode.relational.columnName"}}},
                                                                    "argument": {"variable": "fieldMap"}}},
                                                                "argument": {"variable": "cx"}}}}},
                                                        "argument": {
                                                          "lambda": {
                                                            "parameter": "field_name",
                                                            "domain": {"variable": "hydra.core.relational.ColumnName"},
                                                            "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.Type"}}},
                                                                        "type": {"variable": "hydra.core.tabular.ColumnType"}}},
                                                                    "argument": {
                                                                      "application": {
                                                                        "function": {
                                                                          "application": {
                                                                            "function": {
                                                                              "application": {
                                                                                "function": {
                                                                                  "application": {
                                                                                    "function": {
                                                                                      "typeApplication": {
                                                                                        "body": {
                                                                                          "typeApplication": {
                                                                                            "body": {
                                                                                              "typeApplication": {"body": {"variable": "hydra.core.extract.model.requireField"}, "type": {"variable": "hydra.core.graph.Graph"}}},
                                                                                            "type": {"variable": "hydra.core.model.Term"}}},
                                                                                        "type": {"variable": "hydra.core.model.Type"}}},
                                                                                    "argument": {"literal": {"string": "type"}}}},
                                                                                "argument": {"variable": "hydra.core.decode.model.type"}}},
                                                                            "argument": {"variable": "fieldMap"}}},
                                                                        "argument": {"variable": "cx"}}}}},
                                                                "argument": {
                                                                  "lambda": {
                                                                    "parameter": "field_type",
                                                                    "domain": {"variable": "hydra.core.model.Type"},
                                                                    "body": {
                                                                      "typeApplication": {
                                                                        "body": {
                                                                          "typeApplication": {
                                                                            "body": {
                                                                              "either": {
                                                                                "right": {
                                                                                  "record": {
                                                                                    "typeName": "hydra.core.tabular.ColumnType",
                                                                                    "fields": [{"name": "name", "term": {"variable": "field_name"}}, {"name": "type", "term": {"variable": "field_type"}}]}}}},
                                                                            "type": {"variable": "hydra.core.errors.DecodingError"}}},
                                                                        "type": {"variable": "hydra.core.tabular.ColumnType"}}}}}}}}}}}}}}}}]}},
                                    "argument": {"variable": "stripped"}}}}}}},
                        "argument": {
                          "application": {
                            "function": {
                              "application": {"function": {"variable": "hydra.core.extract.model.stripWithDecodingError"}, "argument": {"variable": "cx"}}},
                            "argument": {"variable": "raw"}}}}}}}}},
            "annotation": {
              "map": [{"key": {"variable": "description"}, "value": {"literal": {"string": "Decoder for hydra.core.tabular.ColumnType"}}}]}}}}},
    {
      "term": {
        "name": "hydra.core.decode.tabular.dataRow",
        "signature": {
          "typeParameters": [{"name": "v", "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": "v"}}}}}}},
              "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": {"application": {"function": {"variable": "hydra.core.tabular.DataRow"}, "argument": {"variable": "v"}}}}}}},
        "body": {
          "annotated": {
            "body": {
              "lambda": {
                "parameter": "v",
                "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": "v"}}}}}}},
                "body": {
                  "lambda": {
                    "parameter": "cx",
                    "domain": {"variable": "hydra.core.graph.Graph"},
                    "body": {
                      "lambda": {
                        "parameter": "raw",
                        "domain": {"variable": "hydra.core.model.Term"},
                        "body": {
                          "application": {
                            "function": {
                              "application": {
                                "function": {
                                  "application": {
                                    "function": {
                                      "typeApplication": {
                                        "body": {
                                          "typeApplication": {
                                            "body": {
                                              "typeApplication": {"body": {"variable": "hydra.core.lib.eithers.either"}, "type": {"variable": "hydra.core.errors.DecodingError"}}},
                                            "type": {"variable": "hydra.core.model.Term"}}},
                                        "type": {
                                          "either": {
                                            "left": {"variable": "hydra.core.errors.DecodingError"},
                                            "right": {"application": {"function": {"variable": "hydra.core.tabular.DataRow"}, "argument": {"variable": "v"}}}}}}},
                                    "argument": {
                                      "lambda": {
                                        "parameter": "err",
                                        "domain": {"variable": "hydra.core.errors.DecodingError"},
                                        "body": {
                                          "typeApplication": {
                                            "body": {
                                              "typeApplication": {"body": {"either": {"left": {"variable": "err"}}}, "type": {"variable": "hydra.core.errors.DecodingError"}}},
                                            "type": {"application": {"function": {"variable": "hydra.core.tabular.DataRow"}, "argument": {"variable": "v"}}}}}}}}},
                                "argument": {
                                  "lambda": {
                                    "parameter": "stripped",
                                    "domain": {"variable": "hydra.core.model.Term"},
                                    "body": {
                                      "application": {
                                        "function": {
                                          "cases": {
                                            "typeName": "hydra.core.model.Term",
                                            "default": {
                                              "typeApplication": {
                                                "body": {
                                                  "typeApplication": {
                                                    "body": {
                                                      "either": {
                                                        "left": {"wrap": {"typeName": "hydra.core.errors.DecodingError", "body": {"literal": {"string": "expected wrapped type"}}}}}},
                                                    "type": {"variable": "hydra.core.errors.DecodingError"}}},
                                                "type": {"application": {"function": {"variable": "hydra.core.tabular.DataRow"}, "argument": {"variable": "v"}}}}},
                                            "cases": [
                                              {
                                                "name": "wrap",
                                                "handler": {
                                                  "lambda": {
                                                    "parameter": "wrappedTerm",
                                                    "domain": {"variable": "hydra.core.model.WrappedTerm"},
                                                    "body": {
                                                      "application": {
                                                        "function": {
                                                          "application": {
                                                            "function": {
                                                              "typeApplication": {
                                                                "body": {
                                                                  "typeApplication": {
                                                                    "body": {
                                                                      "typeApplication": {"body": {"variable": "hydra.core.lib.eithers.map"}, "type": {"list": {"optional": {"variable": "v"}}}}},
                                                                    "type": {"application": {"function": {"variable": "hydra.core.tabular.DataRow"}, "argument": {"variable": "v"}}}}},
                                                                "type": {"variable": "hydra.core.errors.DecodingError"}}},
                                                            "argument": {
                                                              "lambda": {
                                                                "parameter": "b",
                                                                "domain": {"list": {"optional": {"variable": "v"}}},
                                                                "body": {"wrap": {"typeName": "hydra.core.tabular.DataRow", "body": {"variable": "b"}}}}}}},
                                                        "argument": {
                                                          "application": {
                                                            "function": {
                                                              "application": {
                                                                "function": {
                                                                  "application": {
                                                                    "function": {
                                                                      "typeApplication": {"body": {"variable": "hydra.core.extract.model.decodeList"}, "type": {"optional": {"variable": "v"}}}},
                                                                    "argument": {
                                                                      "application": {
                                                                        "function": {"typeApplication": {"body": {"variable": "hydra.core.extract.model.decodeMaybe"}, "type": {"variable": "v"}}},
                                                                        "argument": {"variable": "v"}}}}},
                                                                "argument": {"variable": "cx"}}},
                                                            "argument": {
                                                              "application": {
                                                                "function": {"project": {"typeName": "hydra.core.model.WrappedTerm", "fieldName": "body"}},
                                                                "argument": {"variable": "wrappedTerm"}}}}}}}}}}]}},
                                        "argument": {"variable": "stripped"}}}}}}},
                            "argument": {
                              "application": {
                                "function": {
                                  "application": {"function": {"variable": "hydra.core.extract.model.stripWithDecodingError"}, "argument": {"variable": "cx"}}},
                                "argument": {"variable": "raw"}}}}}}}}}}},
            "annotation": {
              "map": [{"key": {"variable": "description"}, "value": {"literal": {"string": "Decoder for hydra.core.tabular.DataRow"}}}]}}}}},
    {
      "term": {
        "name": "hydra.core.decode.tabular.headerRow",
        "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.tabular.HeaderRow"}}}}},
        "body": {
          "annotated": {
            "body": {
              "lambda": {
                "parameter": "cx",
                "domain": {"variable": "hydra.core.graph.Graph"},
                "body": {
                  "lambda": {
                    "parameter": "raw",
                    "domain": {"variable": "hydra.core.model.Term"},
                    "body": {
                      "application": {
                        "function": {
                          "application": {
                            "function": {
                              "application": {
                                "function": {
                                  "typeApplication": {
                                    "body": {
                                      "typeApplication": {
                                        "body": {
                                          "typeApplication": {"body": {"variable": "hydra.core.lib.eithers.either"}, "type": {"variable": "hydra.core.errors.DecodingError"}}},
                                        "type": {"variable": "hydra.core.model.Term"}}},
                                    "type": {
                                      "either": {"left": {"variable": "hydra.core.errors.DecodingError"}, "right": {"variable": "hydra.core.tabular.HeaderRow"}}}}},
                                "argument": {
                                  "lambda": {
                                    "parameter": "err",
                                    "domain": {"variable": "hydra.core.errors.DecodingError"},
                                    "body": {
                                      "typeApplication": {
                                        "body": {
                                          "typeApplication": {"body": {"either": {"left": {"variable": "err"}}}, "type": {"variable": "hydra.core.errors.DecodingError"}}},
                                        "type": {"variable": "hydra.core.tabular.HeaderRow"}}}}}}},
                            "argument": {
                              "lambda": {
                                "parameter": "stripped",
                                "domain": {"variable": "hydra.core.model.Term"},
                                "body": {
                                  "application": {
                                    "function": {
                                      "cases": {
                                        "typeName": "hydra.core.model.Term",
                                        "default": {
                                          "typeApplication": {
                                            "body": {
                                              "typeApplication": {
                                                "body": {
                                                  "either": {
                                                    "left": {"wrap": {"typeName": "hydra.core.errors.DecodingError", "body": {"literal": {"string": "expected wrapped type"}}}}}},
                                                "type": {"variable": "hydra.core.errors.DecodingError"}}},
                                            "type": {"variable": "hydra.core.tabular.HeaderRow"}}},
                                        "cases": [
                                          {
                                            "name": "wrap",
                                            "handler": {
                                              "lambda": {
                                                "parameter": "wrappedTerm",
                                                "domain": {"variable": "hydra.core.model.WrappedTerm"},
                                                "body": {
                                                  "application": {
                                                    "function": {
                                                      "application": {
                                                        "function": {
                                                          "typeApplication": {
                                                            "body": {
                                                              "typeApplication": {
                                                                "body": {"typeApplication": {"body": {"variable": "hydra.core.lib.eithers.map"}, "type": {"list": {"literal": "string"}}}},
                                                                "type": {"variable": "hydra.core.tabular.HeaderRow"}}},
                                                            "type": {"variable": "hydra.core.errors.DecodingError"}}},
                                                        "argument": {
                                                          "lambda": {
                                                            "parameter": "b",
                                                            "domain": {"list": {"literal": "string"}},
                                                            "body": {"wrap": {"typeName": "hydra.core.tabular.HeaderRow", "body": {"variable": "b"}}}}}}},
                                                    "argument": {
                                                      "application": {
                                                        "function": {
                                                          "application": {
                                                            "function": {
                                                              "application": {
                                                                "function": {"typeApplication": {"body": {"variable": "hydra.core.extract.model.decodeList"}, "type": {"literal": "string"}}},
                                                                "argument": {
                                                                  "lambda": {
                                                                    "parameter": "cx",
                                                                    "domain": {"variable": "hydra.core.graph.Graph"},
                                                                    "body": {
                                                                      "lambda": {
                                                                        "parameter": "raw",
                                                                        "domain": {"variable": "hydra.core.model.Term"},
                                                                        "body": {
                                                                          "application": {
                                                                            "function": {
                                                                              "application": {
                                                                                "function": {
                                                                                  "application": {
                                                                                    "function": {
                                                                                      "typeApplication": {
                                                                                        "body": {
                                                                                          "typeApplication": {
                                                                                            "body": {
                                                                                              "typeApplication": {"body": {"variable": "hydra.core.lib.eithers.either"}, "type": {"variable": "hydra.core.errors.DecodingError"}}},
                                                                                            "type": {"variable": "hydra.core.model.Term"}}},
                                                                                        "type": {"either": {"left": {"variable": "hydra.core.errors.DecodingError"}, "right": {"literal": "string"}}}}},
                                                                                    "argument": {
                                                                                      "lambda": {
                                                                                        "parameter": "err",
                                                                                        "domain": {"variable": "hydra.core.errors.DecodingError"},
                                                                                        "body": {
                                                                                          "typeApplication": {
                                                                                            "body": {
                                                                                              "typeApplication": {"body": {"either": {"left": {"variable": "err"}}}, "type": {"variable": "hydra.core.errors.DecodingError"}}},
                                                                                            "type": {"literal": "string"}}}}}}},
                                                                                "argument": {
                                                                                  "lambda": {
                                                                                    "parameter": "stripped",
                                                                                    "domain": {"variable": "hydra.core.model.Term"},
                                                                                    "body": {
                                                                                      "application": {
                                                                                        "function": {
                                                                                          "cases": {
                                                                                            "typeName": "hydra.core.model.Term",
                                                                                            "default": {
                                                                                              "typeApplication": {
                                                                                                "body": {
                                                                                                  "typeApplication": {
                                                                                                    "body": {
                                                                                                      "either": {"left": {"wrap": {"typeName": "hydra.core.errors.DecodingError", "body": {"literal": {"string": "expected literal"}}}}}},
                                                                                                    "type": {"variable": "hydra.core.errors.DecodingError"}}},
                                                                                                "type": {"literal": "string"}}},
                                                                                            "cases": [
                                                                                              {
                                                                                                "name": "literal",
                                                                                                "handler": {
                                                                                                  "lambda": {
                                                                                                    "parameter": "v",
                                                                                                    "domain": {"variable": "hydra.core.model.Literal"},
                                                                                                    "body": {
                                                                                                      "application": {
                                                                                                        "function": {
                                                                                                          "cases": {
                                                                                                            "typeName": "hydra.core.model.Literal",
                                                                                                            "default": {
                                                                                                              "typeApplication": {
                                                                                                                "body": {
                                                                                                                  "typeApplication": {
                                                                                                                    "body": {
                                                                                                                      "either": {
                                                                                                                        "left": {"wrap": {"typeName": "hydra.core.errors.DecodingError", "body": {"literal": {"string": "expected string literal"}}}}}},
                                                                                                                    "type": {"variable": "hydra.core.errors.DecodingError"}}},
                                                                                                                "type": {"literal": "string"}}},
                                                                                                            "cases": [
                                                                                                              {
                                                                                                                "name": "string",
                                                                                                                "handler": {
                                                                                                                  "lambda": {
                                                                                                                    "parameter": "s",
                                                                                                                    "domain": {"literal": "string"},
                                                                                                                    "body": {
                                                                                                                      "typeApplication": {
                                                                                                                        "body": {
                                                                                                                          "typeApplication": {"body": {"either": {"right": {"variable": "s"}}}, "type": {"variable": "hydra.core.errors.DecodingError"}}},
                                                                                                                        "type": {"literal": "string"}}}}}}]}},
                                                                                                        "argument": {"variable": "v"}}}}}}]}},
                                                                                        "argument": {"variable": "stripped"}}}}}}},
                                                                            "argument": {
                                                                              "application": {
                                                                                "function": {
                                                                                  "application": {"function": {"variable": "hydra.core.extract.model.stripWithDecodingError"}, "argument": {"variable": "cx"}}},
                                                                                "argument": {"variable": "raw"}}}}}}}}}}},
                                                            "argument": {"variable": "cx"}}},
                                                        "argument": {
                                                          "application": {
                                                            "function": {"project": {"typeName": "hydra.core.model.WrappedTerm", "fieldName": "body"}},
                                                            "argument": {"variable": "wrappedTerm"}}}}}}}}}}]}},
                                    "argument": {"variable": "stripped"}}}}}}},
                        "argument": {
                          "application": {
                            "function": {
                              "application": {"function": {"variable": "hydra.core.extract.model.stripWithDecodingError"}, "argument": {"variable": "cx"}}},
                            "argument": {"variable": "raw"}}}}}}}}},
            "annotation": {
              "map": [{"key": {"variable": "description"}, "value": {"literal": {"string": "Decoder for hydra.core.tabular.HeaderRow"}}}]}}}}},
    {
      "term": {
        "name": "hydra.core.decode.tabular.table",
        "signature": {
          "typeParameters": [{"name": "v", "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": "v"}}}}}}},
              "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": {"application": {"function": {"variable": "hydra.core.tabular.Table"}, "argument": {"variable": "v"}}}}}}},
        "body": {
          "annotated": {
            "body": {
              "lambda": {
                "parameter": "v",
                "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": "v"}}}}}}},
                "body": {
                  "lambda": {
                    "parameter": "cx",
                    "domain": {"variable": "hydra.core.graph.Graph"},
                    "body": {
                      "lambda": {
                        "parameter": "raw",
                        "domain": {"variable": "hydra.core.model.Term"},
                        "body": {
                          "application": {
                            "function": {
                              "application": {
                                "function": {
                                  "application": {
                                    "function": {
                                      "typeApplication": {
                                        "body": {
                                          "typeApplication": {
                                            "body": {
                                              "typeApplication": {"body": {"variable": "hydra.core.lib.eithers.either"}, "type": {"variable": "hydra.core.errors.DecodingError"}}},
                                            "type": {"variable": "hydra.core.model.Term"}}},
                                        "type": {
                                          "either": {
                                            "left": {"variable": "hydra.core.errors.DecodingError"},
                                            "right": {"application": {"function": {"variable": "hydra.core.tabular.Table"}, "argument": {"variable": "v"}}}}}}},
                                    "argument": {
                                      "lambda": {
                                        "parameter": "err",
                                        "domain": {"variable": "hydra.core.errors.DecodingError"},
                                        "body": {
                                          "typeApplication": {
                                            "body": {
                                              "typeApplication": {"body": {"either": {"left": {"variable": "err"}}}, "type": {"variable": "hydra.core.errors.DecodingError"}}},
                                            "type": {"application": {"function": {"variable": "hydra.core.tabular.Table"}, "argument": {"variable": "v"}}}}}}}}},
                                "argument": {
                                  "lambda": {
                                    "parameter": "stripped",
                                    "domain": {"variable": "hydra.core.model.Term"},
                                    "body": {
                                      "application": {
                                        "function": {
                                          "cases": {
                                            "typeName": "hydra.core.model.Term",
                                            "default": {
                                              "typeApplication": {
                                                "body": {
                                                  "typeApplication": {
                                                    "body": {
                                                      "either": {
                                                        "left": {
                                                          "wrap": {
                                                            "typeName": "hydra.core.errors.DecodingError",
                                                            "body": {"literal": {"string": "expected a record of type hydra.core.tabular.Table"}}}}}},
                                                    "type": {"variable": "hydra.core.errors.DecodingError"}}},
                                                "type": {"application": {"function": {"variable": "hydra.core.tabular.Table"}, "argument": {"variable": "v"}}}}},
                                            "cases": [
                                              {
                                                "name": "record",
                                                "handler": {
                                                  "lambda": {
                                                    "parameter": "record",
                                                    "domain": {"variable": "hydra.core.model.Record"},
                                                    "body": {
                                                      "let": {
                                                        "bindings": [
                                                          {
                                                            "name": "fieldMap",
                                                            "term": {"application": {"function": {"variable": "hydra.core.extract.model.toFieldMap"}, "argument": {"variable": "record"}}},
                                                            "typeScheme": {
                                                              "variables": [],
                                                              "body": {"map": {"keys": {"variable": "hydra.core.model.Name"}, "values": {"variable": "hydra.core.model.Term"}}},
                                                              "constraints": []}}],
                                                        "body": {
                                                          "application": {
                                                            "function": {
                                                              "application": {
                                                                "function": {
                                                                  "typeApplication": {
                                                                    "body": {
                                                                      "typeApplication": {
                                                                        "body": {
                                                                          "typeApplication": {"body": {"variable": "hydra.core.lib.eithers.bind"}, "type": {"variable": "hydra.core.errors.DecodingError"}}},
                                                                        "type": {"optional": {"variable": "hydra.core.tabular.HeaderRow"}}}},
                                                                    "type": {"application": {"function": {"variable": "hydra.core.tabular.Table"}, "argument": {"variable": "v"}}}}},
                                                                "argument": {
                                                                  "application": {
                                                                    "function": {
                                                                      "application": {
                                                                        "function": {
                                                                          "application": {
                                                                            "function": {
                                                                              "application": {
                                                                                "function": {
                                                                                  "typeApplication": {
                                                                                    "body": {
                                                                                      "typeApplication": {
                                                                                        "body": {
                                                                                          "typeApplication": {"body": {"variable": "hydra.core.extract.model.requireField"}, "type": {"variable": "hydra.core.graph.Graph"}}},
                                                                                        "type": {"variable": "hydra.core.model.Term"}}},
                                                                                    "type": {"optional": {"variable": "hydra.core.tabular.HeaderRow"}}}},
                                                                                "argument": {"literal": {"string": "header"}}}},
                                                                            "argument": {
                                                                              "application": {
                                                                                "function": {
                                                                                  "typeApplication": {"body": {"variable": "hydra.core.extract.model.decodeMaybe"}, "type": {"variable": "hydra.core.tabular.HeaderRow"}}},
                                                                                "argument": {"variable": "hydra.core.decode.tabular.headerRow"}}}}},
                                                                        "argument": {"variable": "fieldMap"}}},
                                                                    "argument": {"variable": "cx"}}}}},
                                                            "argument": {
                                                              "lambda": {
                                                                "parameter": "field_header",
                                                                "domain": {"optional": {"variable": "hydra.core.tabular.HeaderRow"}},
                                                                "body": {
                                                                  "application": {
                                                                    "function": {
                                                                      "application": {
                                                                        "function": {
                                                                          "typeApplication": {
                                                                            "body": {
                                                                              "typeApplication": {
                                                                                "body": {
                                                                                  "typeApplication": {"body": {"variable": "hydra.core.lib.eithers.bind"}, "type": {"variable": "hydra.core.errors.DecodingError"}}},
                                                                                "type": {"list": {"application": {"function": {"variable": "hydra.core.tabular.DataRow"}, "argument": {"variable": "v"}}}}}},
                                                                            "type": {"application": {"function": {"variable": "hydra.core.tabular.Table"}, "argument": {"variable": "v"}}}}},
                                                                        "argument": {
                                                                          "application": {
                                                                            "function": {
                                                                              "application": {
                                                                                "function": {
                                                                                  "application": {
                                                                                    "function": {
                                                                                      "application": {
                                                                                        "function": {
                                                                                          "typeApplication": {
                                                                                            "body": {
                                                                                              "typeApplication": {
                                                                                                "body": {
                                                                                                  "typeApplication": {"body": {"variable": "hydra.core.extract.model.requireField"}, "type": {"variable": "hydra.core.graph.Graph"}}},
                                                                                                "type": {"variable": "hydra.core.model.Term"}}},
                                                                                            "type": {"list": {"application": {"function": {"variable": "hydra.core.tabular.DataRow"}, "argument": {"variable": "v"}}}}}},
                                                                                        "argument": {"literal": {"string": "data"}}}},
                                                                                    "argument": {
                                                                                      "application": {
                                                                                        "function": {
                                                                                          "typeApplication": {
                                                                                            "body": {"variable": "hydra.core.extract.model.decodeList"},
                                                                                            "type": {"application": {"function": {"variable": "hydra.core.tabular.DataRow"}, "argument": {"variable": "v"}}}}},
                                                                                        "argument": {
                                                                                          "application": {
                                                                                            "function": {"typeApplication": {"body": {"variable": "hydra.core.decode.tabular.dataRow"}, "type": {"variable": "v"}}},
                                                                                            "argument": {"variable": "v"}}}}}}},
                                                                                "argument": {"variable": "fieldMap"}}},
                                                                            "argument": {"variable": "cx"}}}}},
                                                                    "argument": {
                                                                      "lambda": {
                                                                        "parameter": "field_data",
                                                                        "domain": {"list": {"application": {"function": {"variable": "hydra.core.tabular.DataRow"}, "argument": {"variable": "v"}}}},
                                                                        "body": {
                                                                          "typeApplication": {
                                                                            "body": {
                                                                              "typeApplication": {
                                                                                "body": {
                                                                                  "either": {
                                                                                    "right": {
                                                                                      "record": {
                                                                                        "typeName": "hydra.core.tabular.Table",
                                                                                        "fields": [{"name": "header", "term": {"variable": "field_header"}}, {"name": "data", "term": {"variable": "field_data"}}]}}}},
                                                                                "type": {"variable": "hydra.core.errors.DecodingError"}}},
                                                                            "type": {"application": {"function": {"variable": "hydra.core.tabular.Table"}, "argument": {"variable": "v"}}}}}}}}}}}}}}}}}}]}},
                                        "argument": {"variable": "stripped"}}}}}}},
                            "argument": {
                              "application": {
                                "function": {
                                  "application": {"function": {"variable": "hydra.core.extract.model.stripWithDecodingError"}, "argument": {"variable": "cx"}}},
                                "argument": {"variable": "raw"}}}}}}}}}}},
            "annotation": {
              "map": [{"key": {"variable": "description"}, "value": {"literal": {"string": "Decoder for hydra.core.tabular.Table"}}}]}}}}},
    {
      "term": {
        "name": "hydra.core.decode.tabular.tableType",
        "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.tabular.TableType"}}}}},
        "body": {
          "annotated": {
            "body": {
              "lambda": {
                "parameter": "cx",
                "domain": {"variable": "hydra.core.graph.Graph"},
                "body": {
                  "lambda": {
                    "parameter": "raw",
                    "domain": {"variable": "hydra.core.model.Term"},
                    "body": {
                      "application": {
                        "function": {
                          "application": {
                            "function": {
                              "application": {
                                "function": {
                                  "typeApplication": {
                                    "body": {
                                      "typeApplication": {
                                        "body": {
                                          "typeApplication": {"body": {"variable": "hydra.core.lib.eithers.either"}, "type": {"variable": "hydra.core.errors.DecodingError"}}},
                                        "type": {"variable": "hydra.core.model.Term"}}},
                                    "type": {
                                      "either": {"left": {"variable": "hydra.core.errors.DecodingError"}, "right": {"variable": "hydra.core.tabular.TableType"}}}}},
                                "argument": {
                                  "lambda": {
                                    "parameter": "err",
                                    "domain": {"variable": "hydra.core.errors.DecodingError"},
                                    "body": {
                                      "typeApplication": {
                                        "body": {
                                          "typeApplication": {"body": {"either": {"left": {"variable": "err"}}}, "type": {"variable": "hydra.core.errors.DecodingError"}}},
                                        "type": {"variable": "hydra.core.tabular.TableType"}}}}}}},
                            "argument": {
                              "lambda": {
                                "parameter": "stripped",
                                "domain": {"variable": "hydra.core.model.Term"},
                                "body": {
                                  "application": {
                                    "function": {
                                      "cases": {
                                        "typeName": "hydra.core.model.Term",
                                        "default": {
                                          "typeApplication": {
                                            "body": {
                                              "typeApplication": {
                                                "body": {
                                                  "either": {
                                                    "left": {
                                                      "wrap": {
                                                        "typeName": "hydra.core.errors.DecodingError",
                                                        "body": {"literal": {"string": "expected a record of type hydra.core.tabular.TableType"}}}}}},
                                                "type": {"variable": "hydra.core.errors.DecodingError"}}},
                                            "type": {"variable": "hydra.core.tabular.TableType"}}},
                                        "cases": [
                                          {
                                            "name": "record",
                                            "handler": {
                                              "lambda": {
                                                "parameter": "record",
                                                "domain": {"variable": "hydra.core.model.Record"},
                                                "body": {
                                                  "let": {
                                                    "bindings": [
                                                      {
                                                        "name": "fieldMap",
                                                        "term": {"application": {"function": {"variable": "hydra.core.extract.model.toFieldMap"}, "argument": {"variable": "record"}}},
                                                        "typeScheme": {
                                                          "variables": [],
                                                          "body": {"map": {"keys": {"variable": "hydra.core.model.Name"}, "values": {"variable": "hydra.core.model.Term"}}},
                                                          "constraints": []}}],
                                                    "body": {
                                                      "application": {
                                                        "function": {
                                                          "application": {
                                                            "function": {
                                                              "typeApplication": {
                                                                "body": {
                                                                  "typeApplication": {
                                                                    "body": {
                                                                      "typeApplication": {"body": {"variable": "hydra.core.lib.eithers.bind"}, "type": {"variable": "hydra.core.errors.DecodingError"}}},
                                                                    "type": {"variable": "hydra.core.relational.RelationName"}}},
                                                                "type": {"variable": "hydra.core.tabular.TableType"}}},
                                                            "argument": {
                                                              "application": {
                                                                "function": {
                                                                  "application": {
                                                                    "function": {
                                                                      "application": {
                                                                        "function": {
                                                                          "application": {
                                                                            "function": {
                                                                              "typeApplication": {
                                                                                "body": {
                                                                                  "typeApplication": {
                                                                                    "body": {
                                                                                      "typeApplication": {"body": {"variable": "hydra.core.extract.model.requireField"}, "type": {"variable": "hydra.core.graph.Graph"}}},
                                                                                    "type": {"variable": "hydra.core.model.Term"}}},
                                                                                "type": {"variable": "hydra.core.relational.RelationName"}}},
                                                                            "argument": {"literal": {"string": "name"}}}},
                                                                        "argument": {"variable": "hydra.core.decode.relational.relationName"}}},
                                                                    "argument": {"variable": "fieldMap"}}},
                                                                "argument": {"variable": "cx"}}}}},
                                                        "argument": {
                                                          "lambda": {
                                                            "parameter": "field_name",
                                                            "domain": {"variable": "hydra.core.relational.RelationName"},
                                                            "body": {
                                                              "application": {
                                                                "function": {
                                                                  "application": {
                                                                    "function": {
                                                                      "typeApplication": {
                                                                        "body": {
                                                                          "typeApplication": {
                                                                            "body": {
                                                                              "typeApplication": {"body": {"variable": "hydra.core.lib.eithers.bind"}, "type": {"variable": "hydra.core.errors.DecodingError"}}},
                                                                            "type": {"list": {"variable": "hydra.core.tabular.ColumnType"}}}},
                                                                        "type": {"variable": "hydra.core.tabular.TableType"}}},
                                                                    "argument": {
                                                                      "application": {
                                                                        "function": {
                                                                          "application": {
                                                                            "function": {
                                                                              "application": {
                                                                                "function": {
                                                                                  "application": {
                                                                                    "function": {
                                                                                      "typeApplication": {
                                                                                        "body": {
                                                                                          "typeApplication": {
                                                                                            "body": {
                                                                                              "typeApplication": {"body": {"variable": "hydra.core.extract.model.requireField"}, "type": {"variable": "hydra.core.graph.Graph"}}},
                                                                                            "type": {"variable": "hydra.core.model.Term"}}},
                                                                                        "type": {"list": {"variable": "hydra.core.tabular.ColumnType"}}}},
                                                                                    "argument": {"literal": {"string": "columns"}}}},
                                                                                "argument": {
                                                                                  "application": {
                                                                                    "function": {
                                                                                      "typeApplication": {"body": {"variable": "hydra.core.extract.model.decodeList"}, "type": {"variable": "hydra.core.tabular.ColumnType"}}},
                                                                                    "argument": {"variable": "hydra.core.decode.tabular.columnType"}}}}},
                                                                            "argument": {"variable": "fieldMap"}}},
                                                                        "argument": {"variable": "cx"}}}}},
                                                                "argument": {
                                                                  "lambda": {
                                                                    "parameter": "field_columns",
                                                                    "domain": {"list": {"variable": "hydra.core.tabular.ColumnType"}},
                                                                    "body": {
                                                                      "typeApplication": {
                                                                        "body": {
                                                                          "typeApplication": {
                                                                            "body": {
                                                                              "either": {
                                                                                "right": {
                                                                                  "record": {
                                                                                    "typeName": "hydra.core.tabular.TableType",
                                                                                    "fields": [{"name": "name", "term": {"variable": "field_name"}}, {"name": "columns", "term": {"variable": "field_columns"}}]}}}},
                                                                            "type": {"variable": "hydra.core.errors.DecodingError"}}},
                                                                        "type": {"variable": "hydra.core.tabular.TableType"}}}}}}}}}}}}}}}}]}},
                                    "argument": {"variable": "stripped"}}}}}}},
                        "argument": {
                          "application": {
                            "function": {
                              "application": {"function": {"variable": "hydra.core.extract.model.stripWithDecodingError"}, "argument": {"variable": "cx"}}},
                            "argument": {"variable": "raw"}}}}}}}}},
            "annotation": {
              "map": [{"key": {"variable": "description"}, "value": {"literal": {"string": "Decoder for hydra.core.tabular.TableType"}}}]}}}}}]}