hydra-kernel-0.18.1: hydra-kernel-json/hydra/core/print/packaging.json
{
"name": "hydra.core.print.packaging",
"metadata": {"description": "String representations of hydra.core.packaging types", "comments": [], "seeAlso": [], "provisions": []},
"dependencies": [
{"module": "hydra.core.analysis"},
{"module": "hydra.core.lib.equality"},
{"module": "hydra.core.lib.lists"},
{"module": "hydra.core.lib.logic"},
{"module": "hydra.core.lib.maps"},
{"module": "hydra.core.lib.math"},
{"module": "hydra.core.lib.optionals"},
{"module": "hydra.core.lib.ordering"},
{"module": "hydra.core.lib.pairs"},
{"module": "hydra.core.lib.sets"},
{"module": "hydra.core.lib.strings"},
{"module": "hydra.core.model"},
{"module": "hydra.core.names"},
{"module": "hydra.core.packaging"},
{"module": "hydra.core.print.model"},
{"module": "hydra.core.serialization"},
{"module": "hydra.core.typing"}],
"definitions": [
{
"term": {
"name": "hydra.core.print.packaging.aliasFromSuffix",
"signature": {
"typeParameters": [],
"parameters": [
{"name": "arg0", "type": {"list": {"literal": "string"}}, "isLazy": false},
{"name": "arg1", "type": {"literal": {"integer": "int32"}}, "isLazy": false}],
"result": {"type": {"literal": "string"}}},
"body": {
"annotated": {
"body": {
"lambda": {
"parameter": "segs",
"domain": {"list": {"literal": "string"}},
"body": {
"lambda": {
"parameter": "n",
"domain": {"literal": {"integer": "int32"}},
"body": {
"let": {
"bindings": [
{
"name": "dropCount",
"term": {
"application": {
"function": {
"application": {
"function": {"typeApplication": {"body": {"variable": "hydra.core.lib.math.sub"}, "type": {"literal": {"integer": "int32"}}}},
"argument": {
"application": {
"function": {"typeApplication": {"body": {"variable": "hydra.core.lib.lists.length"}, "type": {"literal": "string"}}},
"argument": {"variable": "segs"}}}}},
"argument": {"variable": "n"}}},
"typeScheme": {"variables": [], "body": {"literal": {"integer": "int32"}}, "constraints": []}}],
"body": {
"application": {
"function": {"application": {"function": {"variable": "hydra.core.lib.strings.join"}, "argument": {"literal": {"string": "."}}}},
"argument": {
"application": {
"function": {
"application": {
"function": {"typeApplication": {"body": {"variable": "hydra.core.lib.lists.drop"}, "type": {"literal": "string"}}},
"argument": {"variable": "dropCount"}}},
"argument": {"variable": "segs"}}}}}}}}}}},
"annotation": {
"map": [
{
"key": {"variable": "description"},
"value": {"literal": {"string": "Build a candidate alias from the last n dotted segments of a module's full name"}}}]}}}}},
{
"term": {
"name": "hydra.core.print.packaging.definition",
"signature": {
"typeParameters": [],
"parameters": [
{
"name": "arg0",
"type": {"map": {"keys": {"variable": "hydra.core.packaging.ModuleName"}, "values": {"literal": "string"}}},
"isLazy": false},
{"name": "arg1", "type": {"variable": "hydra.core.packaging.Definition"}, "isLazy": false}],
"result": {"type": {"literal": "string"}}},
"body": {
"annotated": {
"body": {
"lambda": {
"parameter": "aliases",
"domain": {"map": {"keys": {"variable": "hydra.core.packaging.ModuleName"}, "values": {"literal": "string"}}},
"body": {
"lambda": {
"parameter": "def",
"domain": {"variable": "hydra.core.packaging.Definition"},
"body": {
"application": {
"function": {
"cases": {
"typeName": "hydra.core.packaging.Definition",
"cases": [
{
"name": "primitive",
"handler": {
"lambda": {
"parameter": "pd",
"domain": {"variable": "hydra.core.packaging.PrimitiveDefinition"},
"body": {
"application": {
"function": {
"application": {"function": {"variable": "hydra.core.print.packaging.primitiveDefinition"}, "argument": {"variable": "aliases"}}},
"argument": {"variable": "pd"}}}}}},
{
"name": "term",
"handler": {
"lambda": {
"parameter": "td",
"domain": {"variable": "hydra.core.packaging.TermDefinition"},
"body": {
"application": {
"function": {
"application": {"function": {"variable": "hydra.core.print.packaging.termDefinition"}, "argument": {"variable": "aliases"}}},
"argument": {"variable": "td"}}}}}},
{
"name": "type",
"handler": {
"lambda": {
"parameter": "tyd",
"domain": {"variable": "hydra.core.packaging.TypeDefinition"},
"body": {
"application": {
"function": {
"application": {"function": {"variable": "hydra.core.print.packaging.typeDefinition"}, "argument": {"variable": "aliases"}}},
"argument": {"variable": "tyd"}}}}}}]}},
"argument": {"variable": "def"}}}}}}},
"annotation": {
"map": [
{
"key": {"variable": "description"},
"value": {
"literal": {"string": "Show a definition as a string, shortening nominal references via the given import-alias map (#803)"}}}]}}}}},
{
"term": {
"name": "hydra.core.print.packaging.docCommentLinesOf",
"signature": {
"typeParameters": [],
"parameters": [{"name": "arg0", "type": {"literal": "string"}, "isLazy": false}],
"result": {"type": {"list": {"literal": "string"}}}},
"body": {
"annotated": {
"body": {
"lambda": {
"parameter": "s",
"domain": {"literal": "string"},
"body": {
"application": {
"function": {
"application": {
"function": {
"typeApplication": {
"body": {"typeApplication": {"body": {"variable": "hydra.core.lib.lists.map"}, "type": {"literal": "string"}}},
"type": {"literal": "string"}}},
"argument": {
"lambda": {
"parameter": "ln",
"domain": {"literal": "string"},
"body": {
"application": {
"function": {
"application": {"function": {"variable": "hydra.core.lib.strings.concat2"}, "argument": {"literal": {"string": "## "}}}},
"argument": {"variable": "ln"}}}}}}},
"argument": {
"application": {
"function": {"application": {"function": {"variable": "hydra.core.lib.strings.splitOn"}, "argument": {"literal": {"string": "\n"}}}},
"argument": {"variable": "s"}}}}}}},
"annotation": {
"map": [
{
"key": {"variable": "description"},
"value": {
"literal": {"string": "Split a (possibly multi-line) string into '## '-prefixed doc-comment lines, one per embedded newline"}}}]}}}}},
{
"term": {
"name": "hydra.core.print.packaging.entityMetadataDoc",
"signature": {
"typeParameters": [],
"parameters": [{"name": "arg0", "type": {"variable": "hydra.core.packaging.EntityMetadata"}, "isLazy": false}],
"result": {"type": {"literal": "string"}}},
"body": {
"annotated": {
"body": {
"lambda": {
"parameter": "em",
"domain": {"variable": "hydra.core.packaging.EntityMetadata"},
"body": {
"let": {
"bindings": [
{
"name": "descLine",
"term": {
"application": {
"function": {
"application": {
"function": {
"application": {
"function": {
"typeApplication": {
"body": {"typeApplication": {"body": {"variable": "hydra.core.lib.optionals.match"}, "type": {"literal": "string"}}},
"type": {"list": {"literal": "string"}}}},
"argument": {
"application": {
"function": {"project": {"typeName": "hydra.core.packaging.EntityMetadata", "fieldName": "description"}},
"argument": {"variable": "em"}}}}},
"argument": {"typeApplication": {"body": {"list": []}, "type": {"literal": "string"}}}}},
"argument": {
"lambda": {
"parameter": "d",
"domain": {"literal": "string"},
"body": {
"application": {"function": {"variable": "hydra.core.print.packaging.docCommentLinesOf"}, "argument": {"variable": "d"}}}}}}},
"typeScheme": {"variables": [], "body": {"list": {"literal": "string"}}, "constraints": []}}],
"body": {
"let": {
"bindings": [
{
"name": "commentBlocks",
"term": {
"application": {
"function": {"typeApplication": {"body": {"variable": "hydra.core.lib.lists.concat"}, "type": {"literal": "string"}}},
"argument": {
"application": {
"function": {
"application": {
"function": {
"typeApplication": {
"body": {"typeApplication": {"body": {"variable": "hydra.core.lib.lists.map"}, "type": {"literal": "string"}}},
"type": {"list": {"literal": "string"}}}},
"argument": {"variable": "hydra.core.print.packaging.docCommentLinesOf"}}},
"argument": {
"application": {
"function": {"project": {"typeName": "hydra.core.packaging.EntityMetadata", "fieldName": "comments"}},
"argument": {"variable": "em"}}}}}}},
"typeScheme": {"variables": [], "body": {"list": {"literal": "string"}}, "constraints": []}}],
"body": {
"let": {
"bindings": [
{
"name": "seeAlsoLines",
"term": {
"application": {
"function": {
"application": {
"function": {
"typeApplication": {
"body": {
"typeApplication": {"body": {"variable": "hydra.core.lib.lists.map"}, "type": {"variable": "hydra.core.packaging.EntityReference"}}},
"type": {"literal": "string"}}},
"argument": {
"lambda": {
"parameter": "ref",
"domain": {"variable": "hydra.core.packaging.EntityReference"},
"body": {
"application": {
"function": {"variable": "hydra.core.lib.strings.concat"},
"argument": {
"list": [
{"literal": {"string": "## @seeAlso "}},
{
"application": {"function": {"variable": "hydra.core.print.packaging.entityReferenceDoc"}, "argument": {"variable": "ref"}}}]}}}}}}},
"argument": {
"application": {
"function": {"project": {"typeName": "hydra.core.packaging.EntityMetadata", "fieldName": "seeAlso"}},
"argument": {"variable": "em"}}}}},
"typeScheme": {"variables": [], "body": {"list": {"literal": "string"}}, "constraints": []}}],
"body": {
"let": {
"bindings": [
{
"name": "lifecycleLines",
"term": {
"application": {
"function": {
"application": {
"function": {
"application": {
"function": {
"typeApplication": {
"body": {
"typeApplication": {"body": {"variable": "hydra.core.lib.optionals.match"}, "type": {"variable": "hydra.core.packaging.LifecycleInfo"}}},
"type": {"list": {"literal": "string"}}}},
"argument": {
"application": {
"function": {"project": {"typeName": "hydra.core.packaging.EntityMetadata", "fieldName": "lifecycle"}},
"argument": {"variable": "em"}}}}},
"argument": {"typeApplication": {"body": {"list": []}, "type": {"literal": "string"}}}}},
"argument": {
"lambda": {
"parameter": "lc",
"domain": {"variable": "hydra.core.packaging.LifecycleInfo"},
"body": {
"let": {
"bindings": [
{
"name": "avail",
"term": {
"application": {
"function": {
"application": {
"function": {
"application": {
"function": {
"typeApplication": {
"body": {
"typeApplication": {"body": {"variable": "hydra.core.lib.optionals.match"}, "type": {"variable": "hydra.core.packaging.Version"}}},
"type": {"list": {"literal": "string"}}}},
"argument": {
"application": {
"function": {"project": {"typeName": "hydra.core.packaging.LifecycleInfo", "fieldName": "availableSince"}},
"argument": {"variable": "lc"}}}}},
"argument": {"typeApplication": {"body": {"list": []}, "type": {"literal": "string"}}}}},
"argument": {
"lambda": {
"parameter": "v",
"domain": {"variable": "hydra.core.packaging.Version"},
"body": {
"list": [
{
"application": {
"function": {
"application": {"function": {"variable": "hydra.core.lib.strings.concat2"}, "argument": {"literal": {"string": "## @availableSince "}}}},
"argument": {"application": {"function": {"unwrap": "hydra.core.packaging.Version"}, "argument": {"variable": "v"}}}}}]}}}}},
"typeScheme": {"variables": [], "body": {"list": {"literal": "string"}}, "constraints": []}}],
"body": {
"let": {
"bindings": [
{
"name": "depr",
"term": {
"application": {
"function": {
"application": {
"function": {
"application": {
"function": {
"typeApplication": {
"body": {
"typeApplication": {"body": {"variable": "hydra.core.lib.optionals.match"}, "type": {"variable": "hydra.core.packaging.Version"}}},
"type": {"list": {"literal": "string"}}}},
"argument": {
"application": {
"function": {"project": {"typeName": "hydra.core.packaging.LifecycleInfo", "fieldName": "deprecatedSince"}},
"argument": {"variable": "lc"}}}}},
"argument": {"typeApplication": {"body": {"list": []}, "type": {"literal": "string"}}}}},
"argument": {
"lambda": {
"parameter": "v",
"domain": {"variable": "hydra.core.packaging.Version"},
"body": {
"list": [
{
"application": {
"function": {
"application": {
"function": {"variable": "hydra.core.lib.strings.concat2"},
"argument": {"literal": {"string": "## @deprecatedSince "}}}},
"argument": {"application": {"function": {"unwrap": "hydra.core.packaging.Version"}, "argument": {"variable": "v"}}}}}]}}}}},
"typeScheme": {"variables": [], "body": {"list": {"literal": "string"}}, "constraints": []}}],
"body": {
"application": {
"function": {
"application": {
"function": {"typeApplication": {"body": {"variable": "hydra.core.lib.lists.concat2"}, "type": {"literal": "string"}}},
"argument": {"variable": "avail"}}},
"argument": {"variable": "depr"}}}}}}}}}}},
"typeScheme": {"variables": [], "body": {"list": {"literal": "string"}}, "constraints": []}}],
"body": {
"let": {
"bindings": [
{
"name": "provisionLines",
"term": {
"application": {
"function": {
"application": {
"function": {
"typeApplication": {
"body": {
"typeApplication": {"body": {"variable": "hydra.core.lib.lists.map"}, "type": {"variable": "hydra.core.packaging.Provision"}}},
"type": {"literal": "string"}}},
"argument": {
"lambda": {
"parameter": "p",
"domain": {"variable": "hydra.core.packaging.Provision"},
"body": {
"let": {
"bindings": [
{
"name": "localName",
"term": {
"application": {
"function": {"variable": "hydra.core.names.localNameOf"},
"argument": {
"application": {
"function": {"project": {"typeName": "hydra.core.packaging.Provision", "fieldName": "name"}},
"argument": {"variable": "p"}}}}},
"typeScheme": {"variables": [], "body": {"literal": "string"}, "constraints": []}},
{
"name": "tag",
"term": {
"application": {
"function": {
"cases": {
"typeName": "hydra.core.packaging.ProvisionKind",
"cases": [
{
"name": "requirement",
"handler": {"lambda": {"parameter": "_", "domain": "unit", "body": {"literal": {"string": "@requirement"}}}}},
{
"name": "recommendation",
"handler": {"lambda": {"parameter": "_", "domain": "unit", "body": {"literal": {"string": "@recommendation"}}}}}]}},
"argument": {
"application": {
"function": {"project": {"typeName": "hydra.core.packaging.Provision", "fieldName": "kind"}},
"argument": {"variable": "p"}}}}},
"typeScheme": {"variables": [], "body": {"literal": "string"}, "constraints": []}}],
"body": {
"application": {
"function": {"variable": "hydra.core.lib.strings.concat"},
"argument": {
"list": [
{"literal": {"string": "## "}},
{"variable": "tag"},
{"literal": {"string": " "}},
{"variable": "localName"},
{"literal": {"string": ": "}},
{
"application": {
"function": {"project": {"typeName": "hydra.core.packaging.Provision", "fieldName": "statement"}},
"argument": {"variable": "p"}}}]}}}}}}}}},
"argument": {
"application": {
"function": {"project": {"typeName": "hydra.core.packaging.EntityMetadata", "fieldName": "provisions"}},
"argument": {"variable": "em"}}}}},
"typeScheme": {"variables": [], "body": {"list": {"literal": "string"}}, "constraints": []}}],
"body": {
"let": {
"bindings": [
{
"name": "keyLines",
"term": {
"application": {
"function": {"typeApplication": {"body": {"variable": "hydra.core.lib.lists.concat"}, "type": {"literal": "string"}}},
"argument": {"list": [{"variable": "seeAlsoLines"}, {"variable": "lifecycleLines"}, {"variable": "provisionLines"}]}}},
"typeScheme": {"variables": [], "body": {"list": {"literal": "string"}}, "constraints": []}}],
"body": {
"let": {
"bindings": [
{
"name": "sections",
"term": {
"application": {
"function": {
"application": {
"function": {"typeApplication": {"body": {"variable": "hydra.core.lib.lists.filter"}, "type": {"list": {"literal": "string"}}}},
"argument": {
"lambda": {
"parameter": "s",
"domain": {"list": {"literal": "string"}},
"body": {
"application": {
"function": {"variable": "hydra.core.lib.logic.not"},
"argument": {
"application": {
"function": {"typeApplication": {"body": {"variable": "hydra.core.lib.lists.isEmpty"}, "type": {"literal": "string"}}},
"argument": {"variable": "s"}}}}}}}}},
"argument": {"list": [{"variable": "descLine"}, {"variable": "commentBlocks"}, {"variable": "keyLines"}]}}},
"typeScheme": {"variables": [], "body": {"list": {"list": {"literal": "string"}}}, "constraints": []}}],
"body": {
"application": {
"function": {
"application": {"function": {"variable": "hydra.core.lib.strings.join"}, "argument": {"literal": {"string": "\n##\n"}}}},
"argument": {
"application": {
"function": {
"application": {
"function": {
"typeApplication": {
"body": {"typeApplication": {"body": {"variable": "hydra.core.lib.lists.map"}, "type": {"list": {"literal": "string"}}}},
"type": {"literal": "string"}}},
"argument": {
"lambda": {
"parameter": "s",
"domain": {"list": {"literal": "string"}},
"body": {
"application": {
"function": {"application": {"function": {"variable": "hydra.core.lib.strings.join"}, "argument": {"literal": {"string": "\n"}}}},
"argument": {"variable": "s"}}}}}}},
"argument": {"variable": "sections"}}}}}}}}}}}}}}}}}}}}},
"annotation": {
"map": [
{
"key": {"variable": "description"},
"value": {"literal": {"string": "Show an EntityMetadata as a block of '##' doc-comment lines"}}}]}}}}},
{
"term": {
"name": "hydra.core.print.packaging.entityReferenceDoc",
"signature": {
"typeParameters": [],
"parameters": [{"name": "arg0", "type": {"variable": "hydra.core.packaging.EntityReference"}, "isLazy": false}],
"result": {"type": {"literal": "string"}}},
"body": {
"annotated": {
"body": {
"lambda": {
"parameter": "ref",
"domain": {"variable": "hydra.core.packaging.EntityReference"},
"body": {
"application": {
"function": {
"cases": {
"typeName": "hydra.core.packaging.EntityReference",
"cases": [
{
"name": "definition",
"handler": {
"lambda": {
"parameter": "defRef",
"domain": {"variable": "hydra.core.packaging.DefinitionReference"},
"body": {
"application": {
"function": {
"cases": {
"typeName": "hydra.core.packaging.DefinitionReference",
"cases": [
{
"name": "type",
"handler": {
"lambda": {
"parameter": "n",
"domain": {"variable": "hydra.core.model.Name"},
"body": {
"application": {
"function": {
"application": {"function": {"variable": "hydra.core.lib.strings.concat2"}, "argument": {"literal": {"string": "type "}}}},
"argument": {"application": {"function": {"unwrap": "hydra.core.model.Name"}, "argument": {"variable": "n"}}}}}}}},
{
"name": "term",
"handler": {
"lambda": {
"parameter": "n",
"domain": {"variable": "hydra.core.model.Name"},
"body": {
"application": {
"function": {
"application": {"function": {"variable": "hydra.core.lib.strings.concat2"}, "argument": {"literal": {"string": "term "}}}},
"argument": {"application": {"function": {"unwrap": "hydra.core.model.Name"}, "argument": {"variable": "n"}}}}}}}},
{
"name": "primitive",
"handler": {
"lambda": {
"parameter": "n",
"domain": {"variable": "hydra.core.model.Name"},
"body": {
"application": {
"function": {
"application": {"function": {"variable": "hydra.core.lib.strings.concat2"}, "argument": {"literal": {"string": "primitive "}}}},
"argument": {"application": {"function": {"unwrap": "hydra.core.model.Name"}, "argument": {"variable": "n"}}}}}}}}]}},
"argument": {"variable": "defRef"}}}}}},
{
"name": "module",
"handler": {
"lambda": {
"parameter": "mn",
"domain": {"variable": "hydra.core.packaging.ModuleName"},
"body": {
"application": {
"function": {
"application": {"function": {"variable": "hydra.core.lib.strings.concat2"}, "argument": {"literal": {"string": "module "}}}},
"argument": {"application": {"function": {"unwrap": "hydra.core.packaging.ModuleName"}, "argument": {"variable": "mn"}}}}}}}},
{
"name": "package",
"handler": {
"lambda": {
"parameter": "pn",
"domain": {"variable": "hydra.core.packaging.PackageName"},
"body": {
"application": {
"function": {
"application": {"function": {"variable": "hydra.core.lib.strings.concat2"}, "argument": {"literal": {"string": "package "}}}},
"argument": {"application": {"function": {"unwrap": "hydra.core.packaging.PackageName"}, "argument": {"variable": "pn"}}}}}}}},
{
"name": "termExpr",
"handler": {
"lambda": {
"parameter": "t",
"domain": {"literal": "string"},
"body": {
"application": {
"function": {
"application": {"function": {"variable": "hydra.core.lib.strings.concat2"}, "argument": {"literal": {"string": "term-expr "}}}},
"argument": {"variable": "t"}}}}}},
{
"name": "typeExpr",
"handler": {
"lambda": {
"parameter": "t",
"domain": {"literal": "string"},
"body": {
"application": {
"function": {
"application": {"function": {"variable": "hydra.core.lib.strings.concat2"}, "argument": {"literal": {"string": "type-expr "}}}},
"argument": {"variable": "t"}}}}}}]}},
"argument": {"variable": "ref"}}}}},
"annotation": {
"map": [
{
"key": {"variable": "description"},
"value": {"literal": {"string": "Show an EntityReference using the type/term/primitive/module/package/term-expr/type-expr tags"}}}]}}}}},
{
"term": {
"name": "hydra.core.print.packaging.growAliasesStep",
"signature": {
"typeParameters": [{"name": "t0", "constraints": [{"simple": "ordering"}]}, {"name": "t1", "constraints": []}],
"parameters": [
{
"name": "arg0",
"type": {"map": {"keys": {"variable": "t0"}, "values": {"list": {"literal": "string"}}}},
"isLazy": false},
{
"name": "arg1",
"type": {"map": {"keys": {"variable": "t0"}, "values": {"literal": {"integer": "int32"}}}},
"isLazy": false},
{"name": "arg2", "type": {"variable": "t1"}, "isLazy": false}],
"result": {"type": {"map": {"keys": {"variable": "t0"}, "values": {"literal": {"integer": "int32"}}}}}},
"body": {
"typeLambda": {
"parameter": "t0",
"body": {
"typeLambda": {
"parameter": "t1",
"body": {
"annotated": {
"body": {
"lambda": {
"parameter": "segsMap",
"domain": {"map": {"keys": {"variable": "t0"}, "values": {"list": {"literal": "string"}}}},
"body": {
"lambda": {
"parameter": "state",
"domain": {"map": {"keys": {"variable": "t0"}, "values": {"literal": {"integer": "int32"}}}},
"body": {
"lambda": {
"parameter": "_ign",
"domain": {"variable": "t1"},
"body": {
"let": {
"bindings": [
{
"name": "nss",
"term": {
"application": {
"function": {
"typeApplication": {
"body": {"typeApplication": {"body": {"variable": "hydra.core.lib.maps.keys"}, "type": {"variable": "t0"}}},
"type": {"list": {"literal": "string"}}}},
"argument": {"variable": "segsMap"}}},
"typeScheme": {"variables": [], "body": {"list": {"variable": "t0"}}, "constraints": []}}],
"body": {
"let": {
"bindings": [
{
"name": "segsFor",
"term": {
"lambda": {
"parameter": "nm",
"domain": {"variable": "t0"},
"body": {
"application": {
"function": {
"application": {
"function": {
"typeApplication": {"body": {"variable": "hydra.core.lib.optionals.withDefault"}, "type": {"list": {"literal": "string"}}}},
"argument": {"typeApplication": {"body": {"list": []}, "type": {"literal": "string"}}}}},
"argument": {
"application": {
"function": {
"application": {
"function": {
"typeApplication": {
"body": {"typeApplication": {"body": {"variable": "hydra.core.lib.maps.lookup"}, "type": {"variable": "t0"}}},
"type": {"list": {"literal": "string"}}}},
"argument": {"variable": "nm"}}},
"argument": {"variable": "segsMap"}}}}}}},
"typeScheme": {
"variables": [],
"body": {"function": {"domain": {"variable": "t0"}, "codomain": {"list": {"literal": "string"}}}},
"constraints": []}}],
"body": {
"let": {
"bindings": [
{
"name": "takenFor",
"term": {
"lambda": {
"parameter": "nm",
"domain": {"variable": "t0"},
"body": {
"application": {
"function": {
"application": {
"function": {
"typeApplication": {"body": {"variable": "hydra.core.lib.optionals.withDefault"}, "type": {"literal": {"integer": "int32"}}}},
"argument": {"literal": {"integer": {"int32": 1}}}}},
"argument": {
"application": {
"function": {
"application": {
"function": {
"typeApplication": {
"body": {"typeApplication": {"body": {"variable": "hydra.core.lib.maps.lookup"}, "type": {"variable": "t0"}}},
"type": {"literal": {"integer": "int32"}}}},
"argument": {"variable": "nm"}}},
"argument": {"variable": "state"}}}}}}},
"typeScheme": {
"variables": [],
"body": {"function": {"domain": {"variable": "t0"}, "codomain": {"literal": {"integer": "int32"}}}},
"constraints": []}}],
"body": {
"let": {
"bindings": [
{
"name": "entries",
"term": {
"application": {
"function": {
"application": {
"function": {
"typeApplication": {
"body": {"typeApplication": {"body": {"variable": "hydra.core.lib.lists.map"}, "type": {"variable": "t0"}}},
"type": {
"pair": {
"first": {"variable": "t0"},
"second": {
"pair": {
"first": {"literal": {"integer": "int32"}},
"second": {"pair": {"first": {"literal": {"integer": "int32"}}, "second": {"literal": "string"}}}}}}}}},
"argument": {
"lambda": {
"parameter": "nm",
"domain": {"variable": "t0"},
"body": {
"let": {
"bindings": [
{
"name": "segs",
"term": {"application": {"function": {"variable": "segsFor"}, "argument": {"variable": "nm"}}},
"typeScheme": {"variables": [], "body": {"list": {"literal": "string"}}, "constraints": []}},
{
"name": "n",
"term": {"application": {"function": {"variable": "takenFor"}, "argument": {"variable": "nm"}}},
"typeScheme": {"variables": [], "body": {"literal": {"integer": "int32"}}, "constraints": []}},
{
"name": "segCount",
"term": {
"application": {
"function": {"typeApplication": {"body": {"variable": "hydra.core.lib.lists.length"}, "type": {"literal": "string"}}},
"argument": {"variable": "segs"}}},
"typeScheme": {"variables": [], "body": {"literal": {"integer": "int32"}}, "constraints": []}},
{
"name": "aliasStr",
"term": {
"application": {
"function": {
"application": {"function": {"variable": "hydra.core.print.packaging.aliasFromSuffix"}, "argument": {"variable": "segs"}}},
"argument": {"variable": "n"}}},
"typeScheme": {"variables": [], "body": {"literal": "string"}, "constraints": []}}],
"body": {
"typeApplication": {
"body": {
"typeApplication": {
"body": {
"pair": {
"first": {"variable": "nm"},
"second": {
"typeApplication": {
"body": {
"typeApplication": {
"body": {
"pair": {
"first": {"variable": "n"},
"second": {
"typeApplication": {
"body": {
"typeApplication": {
"body": {"pair": {"first": {"variable": "segCount"}, "second": {"variable": "aliasStr"}}},
"type": {"literal": {"integer": "int32"}}}},
"type": {"literal": "string"}}}}},
"type": {"literal": {"integer": "int32"}}}},
"type": {"pair": {"first": {"literal": {"integer": "int32"}}, "second": {"literal": "string"}}}}}}},
"type": {"variable": "t0"}}},
"type": {
"pair": {
"first": {"literal": {"integer": "int32"}},
"second": {"pair": {"first": {"literal": {"integer": "int32"}}, "second": {"literal": "string"}}}}}}}}}}}}},
"argument": {"variable": "nss"}}},
"typeScheme": {
"variables": [],
"body": {
"list": {
"pair": {
"first": {"variable": "t0"},
"second": {
"pair": {
"first": {"literal": {"integer": "int32"}},
"second": {"pair": {"first": {"literal": {"integer": "int32"}}, "second": {"literal": "string"}}}}}}}},
"constraints": []}}],
"body": {
"let": {
"bindings": [
{
"name": "aliasKey",
"term": {
"typeLambda": {
"parameter": "t2",
"body": {
"typeLambda": {
"parameter": "t3",
"body": {
"typeLambda": {
"parameter": "t4",
"body": {
"typeLambda": {
"parameter": "t5",
"body": {
"lambda": {
"parameter": "e",
"domain": {
"pair": {
"first": {"variable": "t2"},
"second": {"pair": {"first": {"variable": "t3"}, "second": {"pair": {"first": {"variable": "t4"}, "second": {"variable": "t5"}}}}}}},
"body": {
"application": {
"function": {
"typeApplication": {
"body": {"typeApplication": {"body": {"variable": "hydra.core.lib.pairs.second"}, "type": {"variable": "t4"}}},
"type": {"variable": "t5"}}},
"argument": {
"application": {
"function": {
"typeApplication": {
"body": {"typeApplication": {"body": {"variable": "hydra.core.lib.pairs.second"}, "type": {"variable": "t3"}}},
"type": {"pair": {"first": {"variable": "t4"}, "second": {"variable": "t5"}}}}},
"argument": {
"application": {
"function": {
"typeApplication": {
"body": {"typeApplication": {"body": {"variable": "hydra.core.lib.pairs.second"}, "type": {"variable": "t2"}}},
"type": {"pair": {"first": {"variable": "t3"}, "second": {"pair": {"first": {"variable": "t4"}, "second": {"variable": "t5"}}}}}}},
"argument": {"variable": "e"}}}}}}}}}}}}}}}}},
"typeScheme": {
"variables": ["t2", "t3", "t4", "t5"],
"body": {
"function": {
"domain": {
"pair": {
"first": {"variable": "t2"},
"second": {"pair": {"first": {"variable": "t3"}, "second": {"pair": {"first": {"variable": "t4"}, "second": {"variable": "t5"}}}}}}},
"codomain": {"variable": "t5"}}},
"constraints": [
{"key": "t2", "value": {"classes": []}},
{"key": "t3", "value": {"classes": []}},
{"key": "t4", "value": {"classes": []}},
{"key": "t5", "value": {"classes": []}}]}}],
"body": {
"let": {
"bindings": [
{
"name": "segCountOf",
"term": {
"typeLambda": {
"parameter": "t2",
"body": {
"typeLambda": {
"parameter": "t3",
"body": {
"typeLambda": {
"parameter": "t4",
"body": {
"typeLambda": {
"parameter": "t5",
"body": {
"lambda": {
"parameter": "e",
"domain": {
"pair": {
"first": {"variable": "t2"},
"second": {"pair": {"first": {"variable": "t3"}, "second": {"pair": {"first": {"variable": "t4"}, "second": {"variable": "t5"}}}}}}},
"body": {
"application": {
"function": {
"typeApplication": {
"body": {"typeApplication": {"body": {"variable": "hydra.core.lib.pairs.first"}, "type": {"variable": "t4"}}},
"type": {"variable": "t5"}}},
"argument": {
"application": {
"function": {
"typeApplication": {
"body": {"typeApplication": {"body": {"variable": "hydra.core.lib.pairs.second"}, "type": {"variable": "t3"}}},
"type": {"pair": {"first": {"variable": "t4"}, "second": {"variable": "t5"}}}}},
"argument": {
"application": {
"function": {
"typeApplication": {
"body": {"typeApplication": {"body": {"variable": "hydra.core.lib.pairs.second"}, "type": {"variable": "t2"}}},
"type": {"pair": {"first": {"variable": "t3"}, "second": {"pair": {"first": {"variable": "t4"}, "second": {"variable": "t5"}}}}}}},
"argument": {"variable": "e"}}}}}}}}}}}}}}}}},
"typeScheme": {
"variables": ["t2", "t3", "t4", "t5"],
"body": {
"function": {
"domain": {
"pair": {
"first": {"variable": "t2"},
"second": {"pair": {"first": {"variable": "t3"}, "second": {"pair": {"first": {"variable": "t4"}, "second": {"variable": "t5"}}}}}}},
"codomain": {"variable": "t4"}}},
"constraints": [
{"key": "t2", "value": {"classes": []}},
{"key": "t3", "value": {"classes": []}},
{"key": "t4", "value": {"classes": []}},
{"key": "t5", "value": {"classes": []}}]}}],
"body": {
"let": {
"bindings": [
{
"name": "aliasCounts",
"term": {
"application": {
"function": {
"application": {
"function": {
"application": {
"function": {
"typeApplication": {
"body": {
"typeApplication": {
"body": {"variable": "hydra.core.lib.lists.foldl"},
"type": {"map": {"keys": {"literal": "string"}, "values": {"literal": {"integer": "int32"}}}}}},
"type": {
"pair": {
"first": {"variable": "t0"},
"second": {
"pair": {
"first": {"literal": {"integer": "int32"}},
"second": {"pair": {"first": {"literal": {"integer": "int32"}}, "second": {"literal": "string"}}}}}}}}},
"argument": {
"lambda": {
"parameter": "m",
"domain": {"map": {"keys": {"literal": "string"}, "values": {"literal": {"integer": "int32"}}}},
"body": {
"lambda": {
"parameter": "e",
"domain": {
"pair": {
"first": {"variable": "t0"},
"second": {
"pair": {
"first": {"literal": {"integer": "int32"}},
"second": {"pair": {"first": {"literal": {"integer": "int32"}}, "second": {"literal": "string"}}}}}}},
"body": {
"application": {
"function": {
"application": {
"function": {
"application": {
"function": {
"typeApplication": {
"body": {"typeApplication": {"body": {"variable": "hydra.core.lib.maps.insert"}, "type": {"literal": "string"}}},
"type": {"literal": {"integer": "int32"}}}},
"argument": {
"application": {
"function": {
"typeApplication": {
"body": {
"typeApplication": {
"body": {
"typeApplication": {
"body": {"typeApplication": {"body": {"variable": "aliasKey"}, "type": {"variable": "t0"}}},
"type": {"literal": {"integer": "int32"}}}},
"type": {"literal": {"integer": "int32"}}}},
"type": {"literal": "string"}}},
"argument": {"variable": "e"}}}}},
"argument": {
"application": {
"function": {
"application": {
"function": {"typeApplication": {"body": {"variable": "hydra.core.lib.math.add"}, "type": {"literal": {"integer": "int32"}}}},
"argument": {"literal": {"integer": {"int32": 1}}}}},
"argument": {
"application": {
"function": {
"application": {
"function": {
"typeApplication": {"body": {"variable": "hydra.core.lib.optionals.withDefault"}, "type": {"literal": {"integer": "int32"}}}},
"argument": {"literal": {"integer": {"int32": 0}}}}},
"argument": {
"application": {
"function": {
"application": {
"function": {
"typeApplication": {
"body": {"typeApplication": {"body": {"variable": "hydra.core.lib.maps.lookup"}, "type": {"literal": "string"}}},
"type": {"literal": {"integer": "int32"}}}},
"argument": {
"application": {
"function": {
"typeApplication": {
"body": {
"typeApplication": {
"body": {
"typeApplication": {
"body": {"typeApplication": {"body": {"variable": "aliasKey"}, "type": {"variable": "t0"}}},
"type": {"literal": {"integer": "int32"}}}},
"type": {"literal": {"integer": "int32"}}}},
"type": {"literal": "string"}}},
"argument": {"variable": "e"}}}}},
"argument": {"variable": "m"}}}}}}}}},
"argument": {"variable": "m"}}}}}}}}},
"argument": {
"typeApplication": {
"body": {"typeApplication": {"body": {"variable": "hydra.core.lib.maps.empty"}, "type": {"literal": "string"}}},
"type": {"literal": {"integer": "int32"}}}}}},
"argument": {"variable": "entries"}}},
"typeScheme": {
"variables": [],
"body": {"map": {"keys": {"literal": "string"}, "values": {"literal": {"integer": "int32"}}}},
"constraints": []}}],
"body": {
"let": {
"bindings": [
{
"name": "aliasMinSegs",
"term": {
"application": {
"function": {
"application": {
"function": {
"application": {
"function": {
"typeApplication": {
"body": {
"typeApplication": {
"body": {"variable": "hydra.core.lib.lists.foldl"},
"type": {"map": {"keys": {"literal": "string"}, "values": {"literal": {"integer": "int32"}}}}}},
"type": {
"pair": {
"first": {"variable": "t0"},
"second": {
"pair": {
"first": {"literal": {"integer": "int32"}},
"second": {"pair": {"first": {"literal": {"integer": "int32"}}, "second": {"literal": "string"}}}}}}}}},
"argument": {
"lambda": {
"parameter": "m",
"domain": {"map": {"keys": {"literal": "string"}, "values": {"literal": {"integer": "int32"}}}},
"body": {
"lambda": {
"parameter": "e",
"domain": {
"pair": {
"first": {"variable": "t0"},
"second": {
"pair": {
"first": {"literal": {"integer": "int32"}},
"second": {"pair": {"first": {"literal": {"integer": "int32"}}, "second": {"literal": "string"}}}}}}},
"body": {
"let": {
"bindings": [
{
"name": "k",
"term": {
"application": {
"function": {
"typeApplication": {
"body": {
"typeApplication": {
"body": {
"typeApplication": {
"body": {"typeApplication": {"body": {"variable": "aliasKey"}, "type": {"variable": "t0"}}},
"type": {"literal": {"integer": "int32"}}}},
"type": {"literal": {"integer": "int32"}}}},
"type": {"literal": "string"}}},
"argument": {"variable": "e"}}},
"typeScheme": {"variables": [], "body": {"literal": "string"}, "constraints": []}}],
"body": {
"let": {
"bindings": [
{
"name": "segCount",
"term": {
"application": {
"function": {
"typeApplication": {
"body": {
"typeApplication": {
"body": {
"typeApplication": {
"body": {"typeApplication": {"body": {"variable": "segCountOf"}, "type": {"variable": "t0"}}},
"type": {"literal": {"integer": "int32"}}}},
"type": {"literal": {"integer": "int32"}}}},
"type": {"literal": "string"}}},
"argument": {"variable": "e"}}},
"typeScheme": {"variables": [], "body": {"literal": {"integer": "int32"}}, "constraints": []}}],
"body": {
"application": {
"function": {
"application": {
"function": {
"application": {
"function": {
"typeApplication": {
"body": {"typeApplication": {"body": {"variable": "hydra.core.lib.maps.insert"}, "type": {"literal": "string"}}},
"type": {"literal": {"integer": "int32"}}}},
"argument": {"variable": "k"}}},
"argument": {
"application": {
"function": {
"application": {
"function": {
"application": {
"function": {
"typeApplication": {
"body": {"typeApplication": {"body": {"variable": "hydra.core.lib.optionals.match"}, "type": {"literal": {"integer": "int32"}}}},
"type": {"literal": {"integer": "int32"}}}},
"argument": {
"application": {
"function": {
"application": {
"function": {
"typeApplication": {
"body": {"typeApplication": {"body": {"variable": "hydra.core.lib.maps.lookup"}, "type": {"literal": "string"}}},
"type": {"literal": {"integer": "int32"}}}},
"argument": {"variable": "k"}}},
"argument": {"variable": "m"}}}}},
"argument": {"variable": "segCount"}}},
"argument": {
"lambda": {
"parameter": "prev",
"domain": {"literal": {"integer": "int32"}},
"body": {
"application": {
"function": {
"application": {
"function": {
"application": {
"function": {"typeApplication": {"body": {"variable": "hydra.core.lib.logic.ifElse"}, "type": {"literal": {"integer": "int32"}}}},
"argument": {
"application": {
"function": {
"application": {
"function": {"typeApplication": {"body": {"variable": "hydra.core.lib.ordering.lt"}, "type": {"literal": {"integer": "int32"}}}},
"argument": {"variable": "segCount"}}},
"argument": {"variable": "prev"}}}}},
"argument": {"variable": "segCount"}}},
"argument": {"variable": "prev"}}}}}}}}},
"argument": {"variable": "m"}}}}}}}}}}}}},
"argument": {
"typeApplication": {
"body": {"typeApplication": {"body": {"variable": "hydra.core.lib.maps.empty"}, "type": {"literal": "string"}}},
"type": {"literal": {"integer": "int32"}}}}}},
"argument": {"variable": "entries"}}},
"typeScheme": {
"variables": [],
"body": {"map": {"keys": {"literal": "string"}, "values": {"literal": {"integer": "int32"}}}},
"constraints": []}}],
"body": {
"let": {
"bindings": [
{
"name": "aliasMinSegsCount",
"term": {
"application": {
"function": {
"application": {
"function": {
"application": {
"function": {
"typeApplication": {
"body": {
"typeApplication": {
"body": {"variable": "hydra.core.lib.lists.foldl"},
"type": {"map": {"keys": {"literal": "string"}, "values": {"literal": {"integer": "int32"}}}}}},
"type": {
"pair": {
"first": {"variable": "t0"},
"second": {
"pair": {
"first": {"literal": {"integer": "int32"}},
"second": {"pair": {"first": {"literal": {"integer": "int32"}}, "second": {"literal": "string"}}}}}}}}},
"argument": {
"lambda": {
"parameter": "m",
"domain": {"map": {"keys": {"literal": "string"}, "values": {"literal": {"integer": "int32"}}}},
"body": {
"lambda": {
"parameter": "e",
"domain": {
"pair": {
"first": {"variable": "t0"},
"second": {
"pair": {
"first": {"literal": {"integer": "int32"}},
"second": {"pair": {"first": {"literal": {"integer": "int32"}}, "second": {"literal": "string"}}}}}}},
"body": {
"let": {
"bindings": [
{
"name": "k",
"term": {
"application": {
"function": {
"typeApplication": {
"body": {
"typeApplication": {
"body": {
"typeApplication": {
"body": {"typeApplication": {"body": {"variable": "aliasKey"}, "type": {"variable": "t0"}}},
"type": {"literal": {"integer": "int32"}}}},
"type": {"literal": {"integer": "int32"}}}},
"type": {"literal": "string"}}},
"argument": {"variable": "e"}}},
"typeScheme": {"variables": [], "body": {"literal": "string"}, "constraints": []}}],
"body": {
"let": {
"bindings": [
{
"name": "segCount",
"term": {
"application": {
"function": {
"typeApplication": {
"body": {
"typeApplication": {
"body": {
"typeApplication": {
"body": {"typeApplication": {"body": {"variable": "segCountOf"}, "type": {"variable": "t0"}}},
"type": {"literal": {"integer": "int32"}}}},
"type": {"literal": {"integer": "int32"}}}},
"type": {"literal": "string"}}},
"argument": {"variable": "e"}}},
"typeScheme": {"variables": [], "body": {"literal": {"integer": "int32"}}, "constraints": []}}],
"body": {
"let": {
"bindings": [
{
"name": "minSegs",
"term": {
"application": {
"function": {
"application": {
"function": {
"typeApplication": {"body": {"variable": "hydra.core.lib.optionals.withDefault"}, "type": {"literal": {"integer": "int32"}}}},
"argument": {"variable": "segCount"}}},
"argument": {
"application": {
"function": {
"application": {
"function": {
"typeApplication": {
"body": {"typeApplication": {"body": {"variable": "hydra.core.lib.maps.lookup"}, "type": {"literal": "string"}}},
"type": {"literal": {"integer": "int32"}}}},
"argument": {"variable": "k"}}},
"argument": {"variable": "aliasMinSegs"}}}}},
"typeScheme": {"variables": [], "body": {"literal": {"integer": "int32"}}, "constraints": []}}],
"body": {
"application": {
"function": {
"application": {
"function": {
"application": {
"function": {
"typeApplication": {
"body": {"variable": "hydra.core.lib.logic.ifElse"},
"type": {"map": {"keys": {"literal": "string"}, "values": {"literal": {"integer": "int32"}}}}}},
"argument": {
"application": {
"function": {
"application": {
"function": {"typeApplication": {"body": {"variable": "hydra.core.lib.equality.equal"}, "type": {"literal": {"integer": "int32"}}}},
"argument": {"variable": "segCount"}}},
"argument": {"variable": "minSegs"}}}}},
"argument": {
"application": {
"function": {
"application": {
"function": {
"application": {
"function": {
"typeApplication": {
"body": {"typeApplication": {"body": {"variable": "hydra.core.lib.maps.insert"}, "type": {"literal": "string"}}},
"type": {"literal": {"integer": "int32"}}}},
"argument": {"variable": "k"}}},
"argument": {
"application": {
"function": {
"application": {
"function": {"typeApplication": {"body": {"variable": "hydra.core.lib.math.add"}, "type": {"literal": {"integer": "int32"}}}},
"argument": {"literal": {"integer": {"int32": 1}}}}},
"argument": {
"application": {
"function": {
"application": {
"function": {
"typeApplication": {"body": {"variable": "hydra.core.lib.optionals.withDefault"}, "type": {"literal": {"integer": "int32"}}}},
"argument": {"literal": {"integer": {"int32": 0}}}}},
"argument": {
"application": {
"function": {
"application": {
"function": {
"typeApplication": {
"body": {"typeApplication": {"body": {"variable": "hydra.core.lib.maps.lookup"}, "type": {"literal": "string"}}},
"type": {"literal": {"integer": "int32"}}}},
"argument": {"variable": "k"}}},
"argument": {"variable": "m"}}}}}}}}},
"argument": {"variable": "m"}}}}},
"argument": {"variable": "m"}}}}}}}}}}}}}}},
"argument": {
"typeApplication": {
"body": {"typeApplication": {"body": {"variable": "hydra.core.lib.maps.empty"}, "type": {"literal": "string"}}},
"type": {"literal": {"integer": "int32"}}}}}},
"argument": {"variable": "entries"}}},
"typeScheme": {
"variables": [],
"body": {"map": {"keys": {"literal": "string"}, "values": {"literal": {"integer": "int32"}}}},
"constraints": []}}],
"body": {
"application": {
"function": {
"typeApplication": {
"body": {"typeApplication": {"body": {"variable": "hydra.core.lib.maps.fromList"}, "type": {"variable": "t0"}}},
"type": {"literal": {"integer": "int32"}}}},
"argument": {
"application": {
"function": {
"application": {
"function": {
"typeApplication": {
"body": {
"typeApplication": {
"body": {"variable": "hydra.core.lib.lists.map"},
"type": {
"pair": {
"first": {"variable": "t0"},
"second": {
"pair": {
"first": {"literal": {"integer": "int32"}},
"second": {"pair": {"first": {"literal": {"integer": "int32"}}, "second": {"literal": "string"}}}}}}}}},
"type": {"pair": {"first": {"variable": "t0"}, "second": {"literal": {"integer": "int32"}}}}}},
"argument": {
"lambda": {
"parameter": "e",
"domain": {
"pair": {
"first": {"variable": "t0"},
"second": {
"pair": {
"first": {"literal": {"integer": "int32"}},
"second": {"pair": {"first": {"literal": {"integer": "int32"}}, "second": {"literal": "string"}}}}}}},
"body": {
"let": {
"bindings": [
{
"name": "nm",
"term": {
"application": {
"function": {
"typeApplication": {
"body": {"typeApplication": {"body": {"variable": "hydra.core.lib.pairs.first"}, "type": {"variable": "t0"}}},
"type": {
"pair": {
"first": {"literal": {"integer": "int32"}},
"second": {"pair": {"first": {"literal": {"integer": "int32"}}, "second": {"literal": "string"}}}}}}},
"argument": {"variable": "e"}}},
"typeScheme": {"variables": [], "body": {"variable": "t0"}, "constraints": []}}],
"body": {
"let": {
"bindings": [
{
"name": "n",
"term": {
"application": {
"function": {
"typeApplication": {
"body": {"typeApplication": {"body": {"variable": "hydra.core.lib.pairs.first"}, "type": {"literal": {"integer": "int32"}}}},
"type": {"pair": {"first": {"literal": {"integer": "int32"}}, "second": {"literal": "string"}}}}},
"argument": {
"application": {
"function": {
"typeApplication": {
"body": {"typeApplication": {"body": {"variable": "hydra.core.lib.pairs.second"}, "type": {"variable": "t0"}}},
"type": {
"pair": {
"first": {"literal": {"integer": "int32"}},
"second": {"pair": {"first": {"literal": {"integer": "int32"}}, "second": {"literal": "string"}}}}}}},
"argument": {"variable": "e"}}}}},
"typeScheme": {"variables": [], "body": {"literal": {"integer": "int32"}}, "constraints": []}}],
"body": {
"let": {
"bindings": [
{
"name": "segCount",
"term": {
"application": {
"function": {
"typeApplication": {
"body": {
"typeApplication": {
"body": {
"typeApplication": {
"body": {"typeApplication": {"body": {"variable": "segCountOf"}, "type": {"variable": "t0"}}},
"type": {"literal": {"integer": "int32"}}}},
"type": {"literal": {"integer": "int32"}}}},
"type": {"literal": "string"}}},
"argument": {"variable": "e"}}},
"typeScheme": {"variables": [], "body": {"literal": {"integer": "int32"}}, "constraints": []}}],
"body": {
"let": {
"bindings": [
{
"name": "aliasStr",
"term": {
"application": {
"function": {
"typeApplication": {
"body": {
"typeApplication": {
"body": {
"typeApplication": {
"body": {"typeApplication": {"body": {"variable": "aliasKey"}, "type": {"variable": "t0"}}},
"type": {"literal": {"integer": "int32"}}}},
"type": {"literal": {"integer": "int32"}}}},
"type": {"literal": "string"}}},
"argument": {"variable": "e"}}},
"typeScheme": {"variables": [], "body": {"literal": "string"}, "constraints": []}}],
"body": {
"let": {
"bindings": [
{
"name": "count",
"term": {
"application": {
"function": {
"application": {
"function": {
"typeApplication": {"body": {"variable": "hydra.core.lib.optionals.withDefault"}, "type": {"literal": {"integer": "int32"}}}},
"argument": {"literal": {"integer": {"int32": 0}}}}},
"argument": {
"application": {
"function": {
"application": {
"function": {
"typeApplication": {
"body": {"typeApplication": {"body": {"variable": "hydra.core.lib.maps.lookup"}, "type": {"literal": "string"}}},
"type": {"literal": {"integer": "int32"}}}},
"argument": {"variable": "aliasStr"}}},
"argument": {"variable": "aliasCounts"}}}}},
"typeScheme": {"variables": [], "body": {"literal": {"integer": "int32"}}, "constraints": []}}],
"body": {
"let": {
"bindings": [
{
"name": "minSegs",
"term": {
"application": {
"function": {
"application": {
"function": {
"typeApplication": {"body": {"variable": "hydra.core.lib.optionals.withDefault"}, "type": {"literal": {"integer": "int32"}}}},
"argument": {"variable": "segCount"}}},
"argument": {
"application": {
"function": {
"application": {
"function": {
"typeApplication": {
"body": {"typeApplication": {"body": {"variable": "hydra.core.lib.maps.lookup"}, "type": {"literal": "string"}}},
"type": {"literal": {"integer": "int32"}}}},
"argument": {"variable": "aliasStr"}}},
"argument": {"variable": "aliasMinSegs"}}}}},
"typeScheme": {"variables": [], "body": {"literal": {"integer": "int32"}}, "constraints": []}}],
"body": {
"let": {
"bindings": [
{
"name": "minSegsCount",
"term": {
"application": {
"function": {
"application": {
"function": {
"typeApplication": {"body": {"variable": "hydra.core.lib.optionals.withDefault"}, "type": {"literal": {"integer": "int32"}}}},
"argument": {"literal": {"integer": {"int32": 0}}}}},
"argument": {
"application": {
"function": {
"application": {
"function": {
"typeApplication": {
"body": {"typeApplication": {"body": {"variable": "hydra.core.lib.maps.lookup"}, "type": {"literal": "string"}}},
"type": {"literal": {"integer": "int32"}}}},
"argument": {"variable": "aliasStr"}}},
"argument": {"variable": "aliasMinSegsCount"}}}}},
"typeScheme": {"variables": [], "body": {"literal": {"integer": "int32"}}, "constraints": []}}],
"body": {
"let": {
"bindings": [
{
"name": "canGrow",
"term": {
"application": {
"function": {
"application": {
"function": {"variable": "hydra.core.lib.logic.and"},
"argument": {
"application": {
"function": {
"application": {
"function": {"typeApplication": {"body": {"variable": "hydra.core.lib.ordering.gt"}, "type": {"literal": {"integer": "int32"}}}},
"argument": {"variable": "count"}}},
"argument": {"literal": {"integer": {"int32": 1}}}}}}},
"argument": {
"application": {
"function": {
"application": {
"function": {"variable": "hydra.core.lib.logic.and"},
"argument": {
"application": {
"function": {
"application": {
"function": {"typeApplication": {"body": {"variable": "hydra.core.lib.ordering.gt"}, "type": {"literal": {"integer": "int32"}}}},
"argument": {"variable": "segCount"}}},
"argument": {"variable": "n"}}}}},
"argument": {
"application": {
"function": {
"application": {
"function": {"variable": "hydra.core.lib.logic.or"},
"argument": {
"application": {
"function": {
"application": {
"function": {"typeApplication": {"body": {"variable": "hydra.core.lib.ordering.gt"}, "type": {"literal": {"integer": "int32"}}}},
"argument": {"variable": "segCount"}}},
"argument": {"variable": "minSegs"}}}}},
"argument": {
"application": {
"function": {
"application": {
"function": {"typeApplication": {"body": {"variable": "hydra.core.lib.ordering.gt"}, "type": {"literal": {"integer": "int32"}}}},
"argument": {"variable": "minSegsCount"}}},
"argument": {"literal": {"integer": {"int32": 1}}}}}}}}}}},
"typeScheme": {"variables": [], "body": {"literal": "boolean"}, "constraints": []}}],
"body": {
"typeApplication": {
"body": {
"typeApplication": {
"body": {
"pair": {
"first": {"variable": "nm"},
"second": {
"application": {
"function": {
"application": {
"function": {
"application": {
"function": {"typeApplication": {"body": {"variable": "hydra.core.lib.logic.ifElse"}, "type": {"literal": {"integer": "int32"}}}},
"argument": {"variable": "canGrow"}}},
"argument": {
"application": {
"function": {
"application": {
"function": {"typeApplication": {"body": {"variable": "hydra.core.lib.math.add"}, "type": {"literal": {"integer": "int32"}}}},
"argument": {"variable": "n"}}},
"argument": {"literal": {"integer": {"int32": 1}}}}}}},
"argument": {"variable": "n"}}}}},
"type": {"variable": "t0"}}},
"type": {"literal": {"integer": "int32"}}}}}}}}}}}}}}}}}}}}}}}},
"argument": {"variable": "entries"}}}}}}}}}}}}}}}}}}}}}}}}}}}}},
"annotation": {
"map": [
{
"key": {"variable": "description"},
"value": {"literal": {"string": "One growth round of the alias-collision fixed point: colliding non-shortest members grow"}}}]}}}}}}}}},
{
"term": {
"name": "hydra.core.print.packaging.importDecl",
"signature": {
"typeParameters": [],
"parameters": [
{
"name": "arg0",
"type": {"map": {"keys": {"variable": "hydra.core.packaging.ModuleName"}, "values": {"literal": "string"}}},
"isLazy": false},
{"name": "arg1", "type": {"variable": "hydra.core.packaging.ModuleDependency"}, "isLazy": false}],
"result": {"type": {"literal": "string"}}},
"body": {
"annotated": {
"body": {
"lambda": {
"parameter": "aliases",
"domain": {"map": {"keys": {"variable": "hydra.core.packaging.ModuleName"}, "values": {"literal": "string"}}},
"body": {
"lambda": {
"parameter": "d",
"domain": {"variable": "hydra.core.packaging.ModuleDependency"},
"body": {
"let": {
"bindings": [
{
"name": "depMod",
"term": {
"application": {
"function": {"project": {"typeName": "hydra.core.packaging.ModuleDependency", "fieldName": "module"}},
"argument": {"variable": "d"}}},
"typeScheme": {"variables": [], "body": {"variable": "hydra.core.packaging.ModuleName"}, "constraints": []}}],
"body": {
"let": {
"bindings": [
{
"name": "modNameStr",
"term": {
"application": {"function": {"variable": "hydra.core.print.packaging.moduleNameString"}, "argument": {"variable": "depMod"}}},
"typeScheme": {"variables": [], "body": {"literal": "string"}, "constraints": []}}],
"body": {
"let": {
"bindings": [
{
"name": "aliasSuffix",
"term": {
"application": {
"function": {
"application": {
"function": {
"application": {
"function": {
"typeApplication": {
"body": {"typeApplication": {"body": {"variable": "hydra.core.lib.optionals.match"}, "type": {"literal": "string"}}},
"type": {"literal": "string"}}},
"argument": {
"application": {
"function": {
"application": {
"function": {
"typeApplication": {
"body": {
"typeApplication": {"body": {"variable": "hydra.core.lib.maps.lookup"}, "type": {"variable": "hydra.core.packaging.ModuleName"}}},
"type": {"literal": "string"}}},
"argument": {"variable": "depMod"}}},
"argument": {"variable": "aliases"}}}}},
"argument": {"literal": {"string": ""}}}},
"argument": {
"lambda": {
"parameter": "alias",
"domain": {"literal": "string"},
"body": {
"application": {
"function": {
"application": {
"function": {
"application": {
"function": {"typeApplication": {"body": {"variable": "hydra.core.lib.logic.ifElse"}, "type": {"literal": "string"}}},
"argument": {"application": {"function": {"variable": "hydra.core.lib.strings.isEmpty"}, "argument": {"variable": "alias"}}}}},
"argument": {"literal": {"string": ""}}}},
"argument": {
"application": {
"function": {"variable": "hydra.core.lib.strings.concat"},
"argument": {"list": [{"literal": {"string": " as "}}, {"variable": "alias"}]}}}}}}}}},
"typeScheme": {"variables": [], "body": {"literal": "string"}, "constraints": []}}],
"body": {
"let": {
"bindings": [
{
"name": "pkgSuffix",
"term": {
"application": {
"function": {
"application": {
"function": {
"application": {
"function": {
"typeApplication": {
"body": {
"typeApplication": {"body": {"variable": "hydra.core.lib.optionals.match"}, "type": {"variable": "hydra.core.packaging.PackageName"}}},
"type": {"literal": "string"}}},
"argument": {
"application": {
"function": {"project": {"typeName": "hydra.core.packaging.ModuleDependency", "fieldName": "package"}},
"argument": {"variable": "d"}}}}},
"argument": {"literal": {"string": ""}}}},
"argument": {
"lambda": {
"parameter": "pkg",
"domain": {"variable": "hydra.core.packaging.PackageName"},
"body": {
"application": {
"function": {"variable": "hydra.core.lib.strings.concat"},
"argument": {
"list": [
{"literal": {"string": " from "}},
{"application": {"function": {"unwrap": "hydra.core.packaging.PackageName"}, "argument": {"variable": "pkg"}}}]}}}}}}},
"typeScheme": {"variables": [], "body": {"literal": "string"}, "constraints": []}}],
"body": {
"application": {
"function": {"variable": "hydra.core.lib.strings.concat"},
"argument": {
"list": [{"literal": {"string": "import "}}, {"variable": "modNameStr"}, {"variable": "aliasSuffix"}, {"variable": "pkgSuffix"}]}}}}}}}}}}}}}}},
"annotation": {
"map": [
{
"key": {"variable": "description"},
"value": {"literal": {"string": "Show a module dependency as an import declaration, using the given alias map"}}}]}}}}},
{
"term": {
"name": "hydra.core.print.packaging.moduleAliases",
"signature": {
"typeParameters": [],
"parameters": [{"name": "arg0", "type": {"variable": "hydra.core.packaging.Module"}, "isLazy": false}],
"result": {"type": {"map": {"keys": {"variable": "hydra.core.packaging.ModuleName"}, "values": {"literal": "string"}}}}},
"body": {
"annotated": {
"body": {
"lambda": {
"parameter": "mod",
"domain": {"variable": "hydra.core.packaging.Module"},
"body": {
"application": {
"function": {
"application": {
"function": {"variable": "hydra.core.print.packaging.moduleAliasesWith"},
"argument": {
"typeApplication": {
"body": {
"typeApplication": {"body": {"variable": "hydra.core.lib.maps.empty"}, "type": {"variable": "hydra.core.packaging.ModuleName"}}},
"type": {"set": {"variable": "hydra.core.model.Name"}}}}}},
"argument": {"variable": "mod"}}}}},
"annotation": {
"map": [
{
"key": {"variable": "description"},
"value": {
"literal": {
"string": "Compute the printing alias for every module referenced by the given module's definitions, plus the module's own namespace (mapped to the empty alias, for self-reference shortening, #711); context-free, so every real dependency stays aliased"}}}]}}}}},
{
"term": {
"name": "hydra.core.print.packaging.moduleAliasesWith",
"signature": {
"typeParameters": [],
"parameters": [
{
"name": "arg0",
"type": {
"map": {"keys": {"variable": "hydra.core.packaging.ModuleName"}, "values": {"set": {"variable": "hydra.core.model.Name"}}}},
"isLazy": false},
{"name": "arg1", "type": {"variable": "hydra.core.packaging.Module"}, "isLazy": false}],
"result": {"type": {"map": {"keys": {"variable": "hydra.core.packaging.ModuleName"}, "values": {"literal": "string"}}}}},
"body": {
"annotated": {
"body": {
"lambda": {
"parameter": "universe",
"domain": {
"map": {"keys": {"variable": "hydra.core.packaging.ModuleName"}, "values": {"set": {"variable": "hydra.core.model.Name"}}}},
"body": {
"lambda": {
"parameter": "mod",
"domain": {"variable": "hydra.core.packaging.Module"},
"body": {
"let": {
"bindings": [
{
"name": "ownNs",
"term": {
"application": {
"function": {"project": {"typeName": "hydra.core.packaging.Module", "fieldName": "name"}},
"argument": {"variable": "mod"}}},
"typeScheme": {"variables": [], "body": {"variable": "hydra.core.packaging.ModuleName"}, "constraints": []}}],
"body": {
"let": {
"bindings": [
{
"name": "defs",
"term": {
"application": {
"function": {"project": {"typeName": "hydra.core.packaging.Module", "fieldName": "definitions"}},
"argument": {"variable": "mod"}}},
"typeScheme": {"variables": [], "body": {"list": {"variable": "hydra.core.packaging.Definition"}}, "constraints": []}}],
"body": {
"let": {
"bindings": [
{
"name": "namesByModRaw",
"term": {
"application": {"function": {"variable": "hydra.core.analysis.definitionDependencyNamesByModule"}, "argument": {"variable": "defs"}}},
"typeScheme": {
"variables": [],
"body": {
"map": {
"keys": {"variable": "hydra.core.packaging.ModuleName"},
"values": {"map": {"keys": {"literal": "string"}, "values": {"literal": {"integer": "int32"}}}}}},
"constraints": []}}],
"body": {
"let": {
"bindings": [
{
"name": "namesByMod",
"term": {
"application": {
"function": {
"application": {
"function": {
"typeApplication": {
"body": {
"typeApplication": {"body": {"variable": "hydra.core.lib.maps.delete"}, "type": {"variable": "hydra.core.packaging.ModuleName"}}},
"type": {"map": {"keys": {"literal": "string"}, "values": {"literal": {"integer": "int32"}}}}}},
"argument": {"variable": "ownNs"}}},
"argument": {"variable": "namesByModRaw"}}},
"typeScheme": {
"variables": [],
"body": {
"map": {
"keys": {"variable": "hydra.core.packaging.ModuleName"},
"values": {"map": {"keys": {"literal": "string"}, "values": {"literal": {"integer": "int32"}}}}}},
"constraints": []}}],
"body": {
"let": {
"bindings": [
{
"name": "nssAsList",
"term": {
"application": {
"function": {
"application": {
"function": {
"typeApplication": {
"body": {
"typeApplication": {"body": {"variable": "hydra.core.lib.lists.sortBy"}, "type": {"variable": "hydra.core.packaging.ModuleName"}}},
"type": {"literal": "string"}}},
"argument": {
"lambda": {
"parameter": "nm",
"domain": {"variable": "hydra.core.packaging.ModuleName"},
"body": {"application": {"function": {"unwrap": "hydra.core.packaging.ModuleName"}, "argument": {"variable": "nm"}}}}}}},
"argument": {
"application": {
"function": {
"typeApplication": {
"body": {
"typeApplication": {"body": {"variable": "hydra.core.lib.maps.keys"}, "type": {"variable": "hydra.core.packaging.ModuleName"}}},
"type": {"map": {"keys": {"literal": "string"}, "values": {"literal": {"integer": "int32"}}}}}},
"argument": {"variable": "namesByMod"}}}}},
"typeScheme": {"variables": [], "body": {"list": {"variable": "hydra.core.packaging.ModuleName"}}, "constraints": []}}],
"body": {
"let": {
"bindings": [
{
"name": "ownLocalNames",
"term": {
"application": {
"function": {"typeApplication": {"body": {"variable": "hydra.core.lib.sets.fromList"}, "type": {"literal": "string"}}},
"argument": {
"application": {
"function": {
"application": {
"function": {
"typeApplication": {
"body": {
"typeApplication": {"body": {"variable": "hydra.core.lib.lists.map"}, "type": {"variable": "hydra.core.packaging.Definition"}}},
"type": {"literal": "string"}}},
"argument": {
"lambda": {
"parameter": "def",
"domain": {"variable": "hydra.core.packaging.Definition"},
"body": {
"application": {
"function": {"variable": "hydra.core.names.localNameOf"},
"argument": {
"application": {
"function": {
"cases": {
"typeName": "hydra.core.packaging.Definition",
"cases": [
{
"name": "type",
"handler": {
"lambda": {
"parameter": "td",
"domain": {"variable": "hydra.core.packaging.TypeDefinition"},
"body": {
"application": {
"function": {"project": {"typeName": "hydra.core.packaging.TypeDefinition", "fieldName": "name"}},
"argument": {"variable": "td"}}}}}},
{
"name": "term",
"handler": {
"lambda": {
"parameter": "td",
"domain": {"variable": "hydra.core.packaging.TermDefinition"},
"body": {
"application": {
"function": {"project": {"typeName": "hydra.core.packaging.TermDefinition", "fieldName": "name"}},
"argument": {"variable": "td"}}}}}},
{
"name": "primitive",
"handler": {
"lambda": {
"parameter": "pd",
"domain": {"variable": "hydra.core.packaging.PrimitiveDefinition"},
"body": {
"application": {
"function": {"project": {"typeName": "hydra.core.packaging.PrimitiveDefinition", "fieldName": "name"}},
"argument": {"variable": "pd"}}}}}}]}},
"argument": {"variable": "def"}}}}}}}}},
"argument": {"variable": "defs"}}}}},
"typeScheme": {"variables": [], "body": {"set": {"literal": "string"}}, "constraints": []}}],
"body": {
"let": {
"bindings": [
{
"name": "declaredImportNames",
"term": {"variable": "nssAsList"},
"typeScheme": {"variables": [], "body": {"list": {"variable": "hydra.core.packaging.ModuleName"}}, "constraints": []}}],
"body": {
"let": {
"bindings": [
{
"name": "otherLocalNamesExcluding",
"term": {
"lambda": {
"parameter": "d",
"domain": {"variable": "hydra.core.packaging.ModuleName"},
"body": {
"application": {
"function": {"typeApplication": {"body": {"variable": "hydra.core.lib.sets.unions"}, "type": {"literal": "string"}}},
"argument": {
"application": {
"function": {
"application": {
"function": {"typeApplication": {"body": {"variable": "hydra.core.lib.lists.cons"}, "type": {"set": {"literal": "string"}}}},
"argument": {"variable": "ownLocalNames"}}},
"argument": {
"application": {
"function": {
"application": {
"function": {
"typeApplication": {
"body": {
"typeApplication": {"body": {"variable": "hydra.core.lib.lists.map"}, "type": {"variable": "hydra.core.packaging.ModuleName"}}},
"type": {"set": {"literal": "string"}}}},
"argument": {
"lambda": {
"parameter": "other",
"domain": {"variable": "hydra.core.packaging.ModuleName"},
"body": {
"application": {
"function": {
"application": {
"function": {
"typeApplication": {
"body": {"typeApplication": {"body": {"variable": "hydra.core.lib.sets.map"}, "type": {"variable": "hydra.core.model.Name"}}},
"type": {"literal": "string"}}},
"argument": {"variable": "hydra.core.names.localNameOf"}}},
"argument": {
"application": {
"function": {
"application": {
"function": {
"typeApplication": {"body": {"variable": "hydra.core.lib.optionals.withDefault"}, "type": {"set": {"variable": "hydra.core.model.Name"}}}},
"argument": {"typeApplication": {"body": {"variable": "hydra.core.lib.sets.empty"}, "type": {"variable": "hydra.core.model.Name"}}}}},
"argument": {
"application": {
"function": {
"application": {
"function": {
"typeApplication": {
"body": {
"typeApplication": {"body": {"variable": "hydra.core.lib.maps.lookup"}, "type": {"variable": "hydra.core.packaging.ModuleName"}}},
"type": {"set": {"variable": "hydra.core.model.Name"}}}},
"argument": {"variable": "other"}}},
"argument": {"variable": "universe"}}}}}}}}}}},
"argument": {
"application": {
"function": {
"application": {
"function": {
"typeApplication": {"body": {"variable": "hydra.core.lib.lists.filter"}, "type": {"variable": "hydra.core.packaging.ModuleName"}}},
"argument": {
"lambda": {
"parameter": "nm",
"domain": {"variable": "hydra.core.packaging.ModuleName"},
"body": {
"application": {
"function": {"variable": "hydra.core.lib.logic.not"},
"argument": {
"application": {
"function": {
"application": {
"function": {
"typeApplication": {"body": {"variable": "hydra.core.lib.equality.equal"}, "type": {"variable": "hydra.core.packaging.ModuleName"}}},
"argument": {"variable": "nm"}}},
"argument": {"variable": "d"}}}}}}}}},
"argument": {"variable": "declaredImportNames"}}}}}}}}}}},
"typeScheme": {
"variables": [],
"body": {"function": {"domain": {"variable": "hydra.core.packaging.ModuleName"}, "codomain": {"set": {"literal": "string"}}}},
"constraints": []}}],
"body": {
"let": {
"bindings": [
{
"name": "allBinderLocalNames",
"term": {
"application": {
"function": {
"application": {
"function": {
"typeApplication": {
"body": {"typeApplication": {"body": {"variable": "hydra.core.lib.sets.map"}, "type": {"variable": "hydra.core.model.Name"}}},
"type": {"literal": "string"}}},
"argument": {"variable": "hydra.core.names.localNameOf"}}},
"argument": {
"application": {"function": {"variable": "hydra.core.analysis.allBinderNamesInDefinitions"}, "argument": {"variable": "defs"}}}}},
"typeScheme": {"variables": [], "body": {"set": {"literal": "string"}}, "constraints": []}}],
"body": {
"let": {
"bindings": [
{
"name": "isSafeBare",
"term": {
"lambda": {
"parameter": "d",
"domain": {"variable": "hydra.core.packaging.ModuleName"},
"body": {
"application": {
"function": {
"application": {
"function": {
"application": {
"function": {
"typeApplication": {
"body": {
"typeApplication": {"body": {"variable": "hydra.core.lib.optionals.match"}, "type": {"set": {"variable": "hydra.core.model.Name"}}}},
"type": {"literal": "boolean"}}},
"argument": {
"application": {
"function": {
"application": {
"function": {
"typeApplication": {
"body": {
"typeApplication": {"body": {"variable": "hydra.core.lib.maps.lookup"}, "type": {"variable": "hydra.core.packaging.ModuleName"}}},
"type": {"set": {"variable": "hydra.core.model.Name"}}}},
"argument": {"variable": "d"}}},
"argument": {"variable": "universe"}}}}},
"argument": {"literal": {"boolean": false}}}},
"argument": {
"lambda": {
"parameter": "declaredNames",
"domain": {"set": {"variable": "hydra.core.model.Name"}},
"body": {
"let": {
"bindings": [
{
"name": "declaredLocalNames",
"term": {
"application": {
"function": {
"application": {
"function": {
"typeApplication": {
"body": {"typeApplication": {"body": {"variable": "hydra.core.lib.sets.map"}, "type": {"variable": "hydra.core.model.Name"}}},
"type": {"literal": "string"}}},
"argument": {"variable": "hydra.core.names.localNameOf"}}},
"argument": {"variable": "declaredNames"}}},
"typeScheme": {"variables": [], "body": {"set": {"literal": "string"}}, "constraints": []}}],
"body": {
"let": {
"bindings": [
{
"name": "referencedLocalNames",
"term": {
"application": {
"function": {
"typeApplication": {
"body": {"typeApplication": {"body": {"variable": "hydra.core.lib.maps.keys"}, "type": {"literal": "string"}}},
"type": {"literal": {"integer": "int32"}}}},
"argument": {
"application": {
"function": {
"application": {
"function": {
"typeApplication": {
"body": {"variable": "hydra.core.lib.optionals.withDefault"},
"type": {"map": {"keys": {"literal": "string"}, "values": {"literal": {"integer": "int32"}}}}}},
"argument": {
"typeApplication": {
"body": {"typeApplication": {"body": {"variable": "hydra.core.lib.maps.empty"}, "type": {"literal": "string"}}},
"type": {"literal": {"integer": "int32"}}}}}},
"argument": {
"application": {
"function": {
"application": {
"function": {
"typeApplication": {
"body": {
"typeApplication": {"body": {"variable": "hydra.core.lib.maps.lookup"}, "type": {"variable": "hydra.core.packaging.ModuleName"}}},
"type": {"map": {"keys": {"literal": "string"}, "values": {"literal": {"integer": "int32"}}}}}},
"argument": {"variable": "d"}}},
"argument": {"variable": "namesByMod"}}}}}}},
"typeScheme": {"variables": [], "body": {"list": {"literal": "string"}}, "constraints": []}}],
"body": {
"let": {
"bindings": [
{
"name": "otherLocalNames",
"term": {"application": {"function": {"variable": "otherLocalNamesExcluding"}, "argument": {"variable": "d"}}},
"typeScheme": {"variables": [], "body": {"set": {"literal": "string"}}, "constraints": []}}],
"body": {
"let": {
"bindings": [
{
"name": "isUnsafe",
"term": {
"lambda": {
"parameter": "local",
"domain": {"literal": "string"},
"body": {
"application": {
"function": {"variable": "hydra.core.lib.logic.not"},
"argument": {
"application": {
"function": {
"application": {
"function": {"variable": "hydra.core.lib.logic.and"},
"argument": {
"application": {
"function": {
"application": {
"function": {"typeApplication": {"body": {"variable": "hydra.core.lib.sets.member"}, "type": {"literal": "string"}}},
"argument": {"variable": "local"}}},
"argument": {"variable": "declaredLocalNames"}}}}},
"argument": {
"application": {
"function": {
"application": {
"function": {"variable": "hydra.core.lib.logic.and"},
"argument": {
"application": {
"function": {"variable": "hydra.core.lib.logic.not"},
"argument": {
"application": {
"function": {
"application": {
"function": {"typeApplication": {"body": {"variable": "hydra.core.lib.sets.member"}, "type": {"literal": "string"}}},
"argument": {"variable": "local"}}},
"argument": {"variable": "otherLocalNames"}}}}}}},
"argument": {
"application": {
"function": {"variable": "hydra.core.lib.logic.not"},
"argument": {
"application": {
"function": {
"application": {
"function": {"typeApplication": {"body": {"variable": "hydra.core.lib.sets.member"}, "type": {"literal": "string"}}},
"argument": {"variable": "local"}}},
"argument": {"variable": "allBinderLocalNames"}}}}}}}}}}}}},
"typeScheme": {
"variables": [],
"body": {"function": {"domain": {"literal": "string"}, "codomain": {"literal": "boolean"}}},
"constraints": []}}],
"body": {
"application": {
"function": {"typeApplication": {"body": {"variable": "hydra.core.lib.lists.isEmpty"}, "type": {"literal": "string"}}},
"argument": {
"application": {
"function": {
"application": {
"function": {"typeApplication": {"body": {"variable": "hydra.core.lib.lists.filter"}, "type": {"literal": "string"}}},
"argument": {"variable": "isUnsafe"}}},
"argument": {"variable": "referencedLocalNames"}}}}}}}}}}}}}}}}}}},
"typeScheme": {
"variables": [],
"body": {"function": {"domain": {"variable": "hydra.core.packaging.ModuleName"}, "codomain": {"literal": "boolean"}}},
"constraints": []}}],
"body": {
"let": {
"bindings": [
{
"name": "bareList",
"term": {
"application": {
"function": {
"application": {
"function": {
"typeApplication": {"body": {"variable": "hydra.core.lib.lists.filter"}, "type": {"variable": "hydra.core.packaging.ModuleName"}}},
"argument": {"variable": "isSafeBare"}}},
"argument": {"variable": "nssAsList"}}},
"typeScheme": {"variables": [], "body": {"list": {"variable": "hydra.core.packaging.ModuleName"}}, "constraints": []}}],
"body": {
"let": {
"bindings": [
{
"name": "aliasedList",
"term": {
"application": {
"function": {
"application": {
"function": {
"typeApplication": {"body": {"variable": "hydra.core.lib.lists.filter"}, "type": {"variable": "hydra.core.packaging.ModuleName"}}},
"argument": {
"lambda": {
"parameter": "nm",
"domain": {"variable": "hydra.core.packaging.ModuleName"},
"body": {
"application": {
"function": {"variable": "hydra.core.lib.logic.not"},
"argument": {"application": {"function": {"variable": "isSafeBare"}, "argument": {"variable": "nm"}}}}}}}}},
"argument": {"variable": "nssAsList"}}},
"typeScheme": {"variables": [], "body": {"list": {"variable": "hydra.core.packaging.ModuleName"}}, "constraints": []}}],
"body": {
"let": {
"bindings": [
{
"name": "segmentsOf",
"term": {
"lambda": {
"parameter": "nm",
"domain": {"variable": "hydra.core.packaging.ModuleName"},
"body": {
"application": {
"function": {"application": {"function": {"variable": "hydra.core.lib.strings.splitOn"}, "argument": {"literal": {"string": "."}}}},
"argument": {"application": {"function": {"unwrap": "hydra.core.packaging.ModuleName"}, "argument": {"variable": "nm"}}}}}}},
"typeScheme": {
"variables": [],
"body": {"function": {"domain": {"variable": "hydra.core.packaging.ModuleName"}, "codomain": {"list": {"literal": "string"}}}},
"constraints": []}}],
"body": {
"let": {
"bindings": [
{
"name": "segsMap",
"term": {
"application": {
"function": {
"typeApplication": {
"body": {
"typeApplication": {"body": {"variable": "hydra.core.lib.maps.fromList"}, "type": {"variable": "hydra.core.packaging.ModuleName"}}},
"type": {"list": {"literal": "string"}}}},
"argument": {
"application": {
"function": {
"application": {
"function": {
"typeApplication": {
"body": {
"typeApplication": {"body": {"variable": "hydra.core.lib.lists.map"}, "type": {"variable": "hydra.core.packaging.ModuleName"}}},
"type": {"pair": {"first": {"variable": "hydra.core.packaging.ModuleName"}, "second": {"list": {"literal": "string"}}}}}},
"argument": {
"lambda": {
"parameter": "nm",
"domain": {"variable": "hydra.core.packaging.ModuleName"},
"body": {
"typeApplication": {
"body": {
"typeApplication": {
"body": {
"pair": {
"first": {"variable": "nm"},
"second": {"application": {"function": {"variable": "segmentsOf"}, "argument": {"variable": "nm"}}}}},
"type": {"variable": "hydra.core.packaging.ModuleName"}}},
"type": {"list": {"literal": "string"}}}}}}}},
"argument": {"variable": "aliasedList"}}}}},
"typeScheme": {
"variables": [],
"body": {"map": {"keys": {"variable": "hydra.core.packaging.ModuleName"}, "values": {"list": {"literal": "string"}}}},
"constraints": []}}],
"body": {
"let": {
"bindings": [
{
"name": "maxSegs",
"term": {
"application": {
"function": {
"application": {
"function": {
"application": {
"function": {
"typeApplication": {
"body": {"typeApplication": {"body": {"variable": "hydra.core.lib.lists.foldl"}, "type": {"literal": {"integer": "int32"}}}},
"type": {"literal": {"integer": "int32"}}}},
"argument": {
"lambda": {
"parameter": "a",
"domain": {"literal": {"integer": "int32"}},
"body": {
"lambda": {
"parameter": "b",
"domain": {"literal": {"integer": "int32"}},
"body": {
"application": {
"function": {
"application": {
"function": {
"application": {
"function": {"typeApplication": {"body": {"variable": "hydra.core.lib.logic.ifElse"}, "type": {"literal": {"integer": "int32"}}}},
"argument": {
"application": {
"function": {
"application": {
"function": {"typeApplication": {"body": {"variable": "hydra.core.lib.ordering.gt"}, "type": {"literal": {"integer": "int32"}}}},
"argument": {"variable": "a"}}},
"argument": {"variable": "b"}}}}},
"argument": {"variable": "a"}}},
"argument": {"variable": "b"}}}}}}}}},
"argument": {"literal": {"integer": {"int32": 1}}}}},
"argument": {
"application": {
"function": {
"application": {
"function": {
"typeApplication": {
"body": {
"typeApplication": {"body": {"variable": "hydra.core.lib.lists.map"}, "type": {"variable": "hydra.core.packaging.ModuleName"}}},
"type": {"literal": {"integer": "int32"}}}},
"argument": {
"lambda": {
"parameter": "nm",
"domain": {"variable": "hydra.core.packaging.ModuleName"},
"body": {
"application": {
"function": {"typeApplication": {"body": {"variable": "hydra.core.lib.lists.length"}, "type": {"literal": "string"}}},
"argument": {"application": {"function": {"variable": "segmentsOf"}, "argument": {"variable": "nm"}}}}}}}}},
"argument": {"variable": "aliasedList"}}}}},
"typeScheme": {"variables": [], "body": {"literal": {"integer": "int32"}}, "constraints": []}}],
"body": {
"let": {
"bindings": [
{
"name": "initialState",
"term": {
"application": {
"function": {
"typeApplication": {
"body": {
"typeApplication": {"body": {"variable": "hydra.core.lib.maps.fromList"}, "type": {"variable": "hydra.core.packaging.ModuleName"}}},
"type": {"literal": {"integer": "int32"}}}},
"argument": {
"application": {
"function": {
"application": {
"function": {
"typeApplication": {
"body": {
"typeApplication": {"body": {"variable": "hydra.core.lib.lists.map"}, "type": {"variable": "hydra.core.packaging.ModuleName"}}},
"type": {"pair": {"first": {"variable": "hydra.core.packaging.ModuleName"}, "second": {"literal": {"integer": "int32"}}}}}},
"argument": {
"lambda": {
"parameter": "nm",
"domain": {"variable": "hydra.core.packaging.ModuleName"},
"body": {
"typeApplication": {
"body": {
"typeApplication": {
"body": {"pair": {"first": {"variable": "nm"}, "second": {"literal": {"integer": {"int32": 1}}}}},
"type": {"variable": "hydra.core.packaging.ModuleName"}}},
"type": {"literal": {"integer": "int32"}}}}}}}},
"argument": {"variable": "aliasedList"}}}}},
"typeScheme": {
"variables": [],
"body": {"map": {"keys": {"variable": "hydra.core.packaging.ModuleName"}, "values": {"literal": {"integer": "int32"}}}},
"constraints": []}}],
"body": {
"let": {
"bindings": [
{
"name": "finalState",
"term": {
"application": {
"function": {
"application": {
"function": {
"application": {
"function": {
"typeApplication": {
"body": {
"typeApplication": {
"body": {"variable": "hydra.core.lib.lists.foldl"},
"type": {"map": {"keys": {"variable": "hydra.core.packaging.ModuleName"}, "values": {"literal": {"integer": "int32"}}}}}},
"type": "unit"}},
"argument": {
"application": {
"function": {
"typeApplication": {
"body": {
"typeApplication": {
"body": {"variable": "hydra.core.print.packaging.growAliasesStep"},
"type": {"variable": "hydra.core.packaging.ModuleName"}}},
"type": "unit"}},
"argument": {"variable": "segsMap"}}}}},
"argument": {"variable": "initialState"}}},
"argument": {
"application": {
"function": {
"application": {
"function": {"typeApplication": {"body": {"variable": "hydra.core.lib.lists.replicate"}, "type": "unit"}},
"argument": {"variable": "maxSegs"}}},
"argument": "unit"}}}},
"typeScheme": {
"variables": [],
"body": {"map": {"keys": {"variable": "hydra.core.packaging.ModuleName"}, "values": {"literal": {"integer": "int32"}}}},
"constraints": []}}],
"body": {
"let": {
"bindings": [
{
"name": "bareAliases",
"term": {
"application": {
"function": {
"typeApplication": {
"body": {
"typeApplication": {"body": {"variable": "hydra.core.lib.maps.fromList"}, "type": {"variable": "hydra.core.packaging.ModuleName"}}},
"type": {"literal": "string"}}},
"argument": {
"application": {
"function": {
"application": {
"function": {
"typeApplication": {
"body": {
"typeApplication": {"body": {"variable": "hydra.core.lib.lists.map"}, "type": {"variable": "hydra.core.packaging.ModuleName"}}},
"type": {"pair": {"first": {"variable": "hydra.core.packaging.ModuleName"}, "second": {"literal": "string"}}}}},
"argument": {
"lambda": {
"parameter": "nm",
"domain": {"variable": "hydra.core.packaging.ModuleName"},
"body": {
"typeApplication": {
"body": {
"typeApplication": {
"body": {"pair": {"first": {"variable": "nm"}, "second": {"literal": {"string": ""}}}},
"type": {"variable": "hydra.core.packaging.ModuleName"}}},
"type": {"literal": "string"}}}}}}},
"argument": {"variable": "bareList"}}}}},
"typeScheme": {
"variables": [],
"body": {"map": {"keys": {"variable": "hydra.core.packaging.ModuleName"}, "values": {"literal": "string"}}},
"constraints": []}}],
"body": {
"let": {
"bindings": [
{
"name": "aliasedAliases",
"term": {
"application": {
"function": {
"typeApplication": {
"body": {
"typeApplication": {"body": {"variable": "hydra.core.lib.maps.fromList"}, "type": {"variable": "hydra.core.packaging.ModuleName"}}},
"type": {"literal": "string"}}},
"argument": {
"application": {
"function": {
"application": {
"function": {
"typeApplication": {
"body": {
"typeApplication": {"body": {"variable": "hydra.core.lib.lists.map"}, "type": {"variable": "hydra.core.packaging.ModuleName"}}},
"type": {"pair": {"first": {"variable": "hydra.core.packaging.ModuleName"}, "second": {"literal": "string"}}}}},
"argument": {
"lambda": {
"parameter": "nm",
"domain": {"variable": "hydra.core.packaging.ModuleName"},
"body": {
"typeApplication": {
"body": {
"typeApplication": {
"body": {
"pair": {
"first": {"variable": "nm"},
"second": {
"application": {
"function": {
"application": {
"function": {"variable": "hydra.core.print.packaging.aliasFromSuffix"},
"argument": {
"application": {
"function": {
"application": {
"function": {
"typeApplication": {"body": {"variable": "hydra.core.lib.optionals.withDefault"}, "type": {"list": {"literal": "string"}}}},
"argument": {"typeApplication": {"body": {"list": []}, "type": {"literal": "string"}}}}},
"argument": {
"application": {
"function": {
"application": {
"function": {
"typeApplication": {
"body": {
"typeApplication": {"body": {"variable": "hydra.core.lib.maps.lookup"}, "type": {"variable": "hydra.core.packaging.ModuleName"}}},
"type": {"list": {"literal": "string"}}}},
"argument": {"variable": "nm"}}},
"argument": {"variable": "segsMap"}}}}}}},
"argument": {
"application": {
"function": {
"application": {
"function": {
"typeApplication": {"body": {"variable": "hydra.core.lib.optionals.withDefault"}, "type": {"literal": {"integer": "int32"}}}},
"argument": {"literal": {"integer": {"int32": 1}}}}},
"argument": {
"application": {
"function": {
"application": {
"function": {
"typeApplication": {
"body": {
"typeApplication": {"body": {"variable": "hydra.core.lib.maps.lookup"}, "type": {"variable": "hydra.core.packaging.ModuleName"}}},
"type": {"literal": {"integer": "int32"}}}},
"argument": {"variable": "nm"}}},
"argument": {"variable": "finalState"}}}}}}}}},
"type": {"variable": "hydra.core.packaging.ModuleName"}}},
"type": {"literal": "string"}}}}}}},
"argument": {"variable": "aliasedList"}}}}},
"typeScheme": {
"variables": [],
"body": {"map": {"keys": {"variable": "hydra.core.packaging.ModuleName"}, "values": {"literal": "string"}}},
"constraints": []}}],
"body": {
"let": {
"bindings": [
{
"name": "otherAliases",
"term": {
"application": {
"function": {
"application": {
"function": {
"typeApplication": {
"body": {
"typeApplication": {"body": {"variable": "hydra.core.lib.maps.union"}, "type": {"variable": "hydra.core.packaging.ModuleName"}}},
"type": {"literal": "string"}}},
"argument": {"variable": "bareAliases"}}},
"argument": {"variable": "aliasedAliases"}}},
"typeScheme": {
"variables": [],
"body": {"map": {"keys": {"variable": "hydra.core.packaging.ModuleName"}, "values": {"literal": "string"}}},
"constraints": []}}],
"body": {
"application": {
"function": {
"application": {
"function": {
"application": {
"function": {
"typeApplication": {
"body": {
"typeApplication": {"body": {"variable": "hydra.core.lib.maps.insert"}, "type": {"variable": "hydra.core.packaging.ModuleName"}}},
"type": {"literal": "string"}}},
"argument": {"variable": "ownNs"}}},
"argument": {"literal": {"string": ""}}}},
"argument": {"variable": "otherAliases"}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}},
"annotation": {
"map": [
{
"key": {"variable": "description"},
"value": {
"literal": {
"string": "Compute the printing alias for every module referenced by the given module's definitions, given the full declared-name universe of modules in scope (#5/#711); the printed module's own namespace is always mapped to the empty alias for self-reference shortening (#711/#803)"}}}]}}}}},
{
"term": {
"name": "hydra.core.print.packaging.moduleDefinition",
"signature": {
"typeParameters": [],
"parameters": [{"name": "arg0", "type": {"variable": "hydra.core.packaging.Module"}, "isLazy": false}],
"result": {"type": {"literal": "string"}}},
"body": {
"annotated": {
"body": {
"lambda": {
"parameter": "mod",
"domain": {"variable": "hydra.core.packaging.Module"},
"body": {
"application": {
"function": {
"application": {
"function": {"variable": "hydra.core.print.packaging.moduleDefinitionWith"},
"argument": {
"typeApplication": {
"body": {
"typeApplication": {"body": {"variable": "hydra.core.lib.maps.empty"}, "type": {"variable": "hydra.core.packaging.ModuleName"}}},
"type": {"set": {"variable": "hydra.core.model.Name"}}}}}},
"argument": {"variable": "mod"}}}}},
"annotation": {
"map": [
{
"key": {"variable": "description"},
"value": {
"literal": {"string": "Show a module as a string; context-free, so every real dependency stays aliased with a printed import line"}}}]}}}}},
{
"term": {
"name": "hydra.core.print.packaging.moduleDefinitionWith",
"signature": {
"typeParameters": [],
"parameters": [
{
"name": "arg0",
"type": {
"map": {"keys": {"variable": "hydra.core.packaging.ModuleName"}, "values": {"set": {"variable": "hydra.core.model.Name"}}}},
"isLazy": false},
{"name": "arg1", "type": {"variable": "hydra.core.packaging.Module"}, "isLazy": false}],
"result": {"type": {"literal": "string"}}},
"body": {
"annotated": {
"body": {
"lambda": {
"parameter": "universe",
"domain": {
"map": {"keys": {"variable": "hydra.core.packaging.ModuleName"}, "values": {"set": {"variable": "hydra.core.model.Name"}}}},
"body": {
"lambda": {
"parameter": "mod",
"domain": {"variable": "hydra.core.packaging.Module"},
"body": {
"let": {
"bindings": [
{
"name": "headerStr",
"term": {
"application": {
"function": {
"application": {
"function": {"variable": "hydra.core.print.packaging.withDefinitionDoc"},
"argument": {
"application": {
"function": {"project": {"typeName": "hydra.core.packaging.Module", "fieldName": "metadata"}},
"argument": {"variable": "mod"}}}}},
"argument": {
"application": {
"function": {"variable": "hydra.core.lib.strings.concat"},
"argument": {
"list": [
{"literal": {"string": "module "}},
{
"application": {
"function": {"variable": "hydra.core.print.packaging.moduleNameString"},
"argument": {
"application": {
"function": {"project": {"typeName": "hydra.core.packaging.Module", "fieldName": "name"}},
"argument": {"variable": "mod"}}}}}]}}}}},
"typeScheme": {"variables": [], "body": {"literal": "string"}, "constraints": []}}],
"body": {
"let": {
"bindings": [
{
"name": "aliases",
"term": {
"application": {
"function": {
"application": {"function": {"variable": "hydra.core.print.packaging.moduleAliasesWith"}, "argument": {"variable": "universe"}}},
"argument": {"variable": "mod"}}},
"typeScheme": {
"variables": [],
"body": {"map": {"keys": {"variable": "hydra.core.packaging.ModuleName"}, "values": {"literal": "string"}}},
"constraints": []}}],
"body": {
"let": {
"bindings": [
{
"name": "declaredByModule",
"term": {
"application": {
"function": {
"typeApplication": {
"body": {
"typeApplication": {"body": {"variable": "hydra.core.lib.maps.fromList"}, "type": {"variable": "hydra.core.packaging.ModuleName"}}},
"type": {"variable": "hydra.core.packaging.ModuleDependency"}}},
"argument": {
"application": {
"function": {
"application": {
"function": {
"typeApplication": {
"body": {
"typeApplication": {"body": {"variable": "hydra.core.lib.lists.map"}, "type": {"variable": "hydra.core.packaging.ModuleDependency"}}},
"type": {
"pair": {
"first": {"variable": "hydra.core.packaging.ModuleName"},
"second": {"variable": "hydra.core.packaging.ModuleDependency"}}}}},
"argument": {
"lambda": {
"parameter": "d",
"domain": {"variable": "hydra.core.packaging.ModuleDependency"},
"body": {
"typeApplication": {
"body": {
"typeApplication": {
"body": {
"pair": {
"first": {
"application": {
"function": {"project": {"typeName": "hydra.core.packaging.ModuleDependency", "fieldName": "module"}},
"argument": {"variable": "d"}}},
"second": {"variable": "d"}}},
"type": {"variable": "hydra.core.packaging.ModuleName"}}},
"type": {"variable": "hydra.core.packaging.ModuleDependency"}}}}}}},
"argument": {
"application": {
"function": {"project": {"typeName": "hydra.core.packaging.Module", "fieldName": "dependencies"}},
"argument": {"variable": "mod"}}}}}}},
"typeScheme": {
"variables": [],
"body": {
"map": {
"keys": {"variable": "hydra.core.packaging.ModuleName"},
"values": {"variable": "hydra.core.packaging.ModuleDependency"}}},
"constraints": []}}],
"body": {
"let": {
"bindings": [
{
"name": "ownNs",
"term": {
"application": {
"function": {"project": {"typeName": "hydra.core.packaging.Module", "fieldName": "name"}},
"argument": {"variable": "mod"}}},
"typeScheme": {"variables": [], "body": {"variable": "hydra.core.packaging.ModuleName"}, "constraints": []}}],
"body": {
"let": {
"bindings": [
{
"name": "usedDeps",
"term": {
"application": {
"function": {
"application": {
"function": {
"typeApplication": {
"body": {
"typeApplication": {"body": {"variable": "hydra.core.lib.lists.map"}, "type": {"variable": "hydra.core.packaging.ModuleName"}}},
"type": {"variable": "hydra.core.packaging.ModuleDependency"}}},
"argument": {
"lambda": {
"parameter": "nm",
"domain": {"variable": "hydra.core.packaging.ModuleName"},
"body": {
"application": {
"function": {
"application": {
"function": {
"application": {
"function": {
"typeApplication": {
"body": {
"typeApplication": {
"body": {"variable": "hydra.core.lib.maps.findWithDefault"},
"type": {"variable": "hydra.core.packaging.ModuleDependency"}}},
"type": {"variable": "hydra.core.packaging.ModuleName"}}},
"argument": {
"record": {
"typeName": "hydra.core.packaging.ModuleDependency",
"fields": [
{"name": "module", "term": {"variable": "nm"}},
{
"name": "package",
"term": {"typeApplication": {"body": {"optional": null}, "type": {"variable": "hydra.core.packaging.PackageName"}}}}]}}}},
"argument": {"variable": "nm"}}},
"argument": {"variable": "declaredByModule"}}}}}}},
"argument": {
"application": {
"function": {
"application": {
"function": {
"typeApplication": {"body": {"variable": "hydra.core.lib.lists.filter"}, "type": {"variable": "hydra.core.packaging.ModuleName"}}},
"argument": {
"lambda": {
"parameter": "nm",
"domain": {"variable": "hydra.core.packaging.ModuleName"},
"body": {
"application": {
"function": {"variable": "hydra.core.lib.logic.not"},
"argument": {
"application": {
"function": {
"application": {
"function": {
"typeApplication": {"body": {"variable": "hydra.core.lib.equality.equal"}, "type": {"variable": "hydra.core.packaging.ModuleName"}}},
"argument": {"variable": "nm"}}},
"argument": {"variable": "ownNs"}}}}}}}}},
"argument": {
"application": {
"function": {
"typeApplication": {
"body": {
"typeApplication": {"body": {"variable": "hydra.core.lib.maps.keys"}, "type": {"variable": "hydra.core.packaging.ModuleName"}}},
"type": {"literal": "string"}}},
"argument": {"variable": "aliases"}}}}}}},
"typeScheme": {"variables": [], "body": {"list": {"variable": "hydra.core.packaging.ModuleDependency"}}, "constraints": []}}],
"body": {
"let": {
"bindings": [
{
"name": "importStrs",
"term": {
"application": {
"function": {
"application": {
"function": {
"typeApplication": {
"body": {
"typeApplication": {"body": {"variable": "hydra.core.lib.lists.map"}, "type": {"variable": "hydra.core.packaging.ModuleDependency"}}},
"type": {"literal": "string"}}},
"argument": {
"application": {"function": {"variable": "hydra.core.print.packaging.importDecl"}, "argument": {"variable": "aliases"}}}}},
"argument": {"variable": "usedDeps"}}},
"typeScheme": {"variables": [], "body": {"list": {"literal": "string"}}, "constraints": []}}],
"body": {
"let": {
"bindings": [
{
"name": "defStrs",
"term": {
"application": {
"function": {
"application": {
"function": {
"typeApplication": {
"body": {
"typeApplication": {"body": {"variable": "hydra.core.lib.lists.map"}, "type": {"variable": "hydra.core.packaging.Definition"}}},
"type": {"literal": "string"}}},
"argument": {
"application": {"function": {"variable": "hydra.core.print.packaging.definition"}, "argument": {"variable": "aliases"}}}}},
"argument": {
"application": {
"function": {"project": {"typeName": "hydra.core.packaging.Module", "fieldName": "definitions"}},
"argument": {"variable": "mod"}}}}},
"typeScheme": {"variables": [], "body": {"list": {"literal": "string"}}, "constraints": []}}],
"body": {
"let": {
"bindings": [
{
"name": "sections",
"term": {
"application": {
"function": {
"application": {
"function": {
"application": {
"function": {"typeApplication": {"body": {"variable": "hydra.core.lib.logic.ifElse"}, "type": {"list": {"literal": "string"}}}},
"argument": {
"application": {
"function": {"typeApplication": {"body": {"variable": "hydra.core.lib.lists.isEmpty"}, "type": {"literal": "string"}}},
"argument": {"variable": "importStrs"}}}}},
"argument": {"variable": "defStrs"}}},
"argument": {
"application": {
"function": {
"application": {
"function": {"typeApplication": {"body": {"variable": "hydra.core.lib.lists.cons"}, "type": {"literal": "string"}}},
"argument": {
"application": {
"function": {"application": {"function": {"variable": "hydra.core.lib.strings.join"}, "argument": {"literal": {"string": "\n"}}}},
"argument": {"variable": "importStrs"}}}}},
"argument": {"variable": "defStrs"}}}}},
"typeScheme": {"variables": [], "body": {"list": {"literal": "string"}}, "constraints": []}}],
"body": {
"application": {
"function": {"application": {"function": {"variable": "hydra.core.lib.strings.join"}, "argument": {"literal": {"string": "\n\n"}}}},
"argument": {
"application": {
"function": {
"application": {
"function": {"typeApplication": {"body": {"variable": "hydra.core.lib.lists.cons"}, "type": {"literal": "string"}}},
"argument": {"variable": "headerStr"}}},
"argument": {"variable": "sections"}}}}}}}}}}}}}}}}}}}}}}}}},
"annotation": {
"map": [
{
"key": {"variable": "description"},
"value": {
"literal": {"string": "Show a module as a string, given the full declared-name universe of modules in scope (#5/#711)"}}}]}}}}},
{
"term": {
"name": "hydra.core.print.packaging.moduleNameString",
"signature": {
"typeParameters": [],
"parameters": [{"name": "arg0", "type": {"variable": "hydra.core.packaging.ModuleName"}, "isLazy": false}],
"result": {"type": {"literal": "string"}}},
"body": {
"annotated": {
"body": {
"lambda": {
"parameter": "n",
"domain": {"variable": "hydra.core.packaging.ModuleName"},
"body": {"application": {"function": {"unwrap": "hydra.core.packaging.ModuleName"}, "argument": {"variable": "n"}}}}},
"annotation": {"map": [{"key": {"variable": "description"}, "value": {"literal": {"string": "Show a module name as a string"}}}]}}}}},
{
"term": {
"name": "hydra.core.print.packaging.primitiveDefinition",
"signature": {
"typeParameters": [],
"parameters": [
{
"name": "arg0",
"type": {"map": {"keys": {"variable": "hydra.core.packaging.ModuleName"}, "values": {"literal": "string"}}},
"isLazy": false},
{"name": "arg1", "type": {"variable": "hydra.core.packaging.PrimitiveDefinition"}, "isLazy": false}],
"result": {"type": {"literal": "string"}}},
"body": {
"annotated": {
"body": {
"lambda": {
"parameter": "aliases",
"domain": {"map": {"keys": {"variable": "hydra.core.packaging.ModuleName"}, "values": {"literal": "string"}}},
"body": {
"lambda": {
"parameter": "pd",
"domain": {"variable": "hydra.core.packaging.PrimitiveDefinition"},
"body": {
"let": {
"bindings": [
{
"name": "localName",
"term": {
"application": {
"function": {"variable": "hydra.core.names.localNameOf"},
"argument": {
"application": {
"function": {"project": {"typeName": "hydra.core.packaging.PrimitiveDefinition", "fieldName": "name"}},
"argument": {"variable": "pd"}}}}},
"typeScheme": {"variables": [], "body": {"literal": "string"}, "constraints": []}}],
"body": {
"let": {
"bindings": [
{
"name": "impureStr",
"term": {
"application": {
"function": {
"application": {
"function": {
"application": {
"function": {"typeApplication": {"body": {"variable": "hydra.core.lib.logic.ifElse"}, "type": {"literal": "string"}}},
"argument": {
"application": {
"function": {"project": {"typeName": "hydra.core.packaging.PrimitiveDefinition", "fieldName": "isPure"}},
"argument": {"variable": "pd"}}}}},
"argument": {"literal": {"string": ""}}}},
"argument": {"literal": {"string": "impure "}}}},
"typeScheme": {"variables": [], "body": {"literal": "string"}, "constraints": []}}],
"body": {
"let": {
"bindings": [
{
"name": "partialStr",
"term": {
"application": {
"function": {
"application": {
"function": {
"application": {
"function": {"typeApplication": {"body": {"variable": "hydra.core.lib.logic.ifElse"}, "type": {"literal": "string"}}},
"argument": {
"application": {
"function": {"project": {"typeName": "hydra.core.packaging.PrimitiveDefinition", "fieldName": "isTotal"}},
"argument": {"variable": "pd"}}}}},
"argument": {"literal": {"string": ""}}}},
"argument": {"literal": {"string": "partial "}}}},
"typeScheme": {"variables": [], "body": {"literal": "string"}, "constraints": []}}],
"body": {
"let": {
"bindings": [
{
"name": "sig",
"term": {
"application": {
"function": {"project": {"typeName": "hydra.core.packaging.PrimitiveDefinition", "fieldName": "signature"}},
"argument": {"variable": "pd"}}},
"typeScheme": {"variables": [], "body": {"variable": "hydra.core.typing.TermSignature"}, "constraints": []}}],
"body": {
"let": {
"bindings": [
{
"name": "sigStr",
"term": {
"application": {
"function": {
"application": {"function": {"variable": "hydra.core.print.model.primitiveSignatureAliased"}, "argument": {"variable": "aliases"}}},
"argument": {"variable": "sig"}}},
"typeScheme": {"variables": [], "body": {"literal": "string"}, "constraints": []}}],
"body": {
"let": {
"bindings": [
{
"name": "implStr",
"term": {
"application": {
"function": {
"application": {
"function": {
"application": {
"function": {
"typeApplication": {
"body": {
"typeApplication": {"body": {"variable": "hydra.core.lib.optionals.match"}, "type": {"variable": "hydra.core.model.Term"}}},
"type": {"literal": "string"}}},
"argument": {
"application": {
"function": {"project": {"typeName": "hydra.core.packaging.PrimitiveDefinition", "fieldName": "defaultImplementation"}},
"argument": {"variable": "pd"}}}}},
"argument": {"literal": {"string": ""}}}},
"argument": {
"lambda": {
"parameter": "impl",
"domain": {"variable": "hydra.core.model.Term"},
"body": {
"application": {
"function": {"variable": "hydra.core.lib.strings.concat"},
"argument": {
"list": [
{"literal": {"string": " = "}},
{
"application": {
"function": {"application": {"function": {"variable": "hydra.core.print.model.termAliased"}, "argument": {"variable": "aliases"}}},
"argument": {"variable": "impl"}}}]}}}}}}},
"typeScheme": {"variables": [], "body": {"literal": "string"}, "constraints": []}}],
"body": {
"let": {
"bindings": [
{
"name": "declStr",
"term": {
"application": {
"function": {"variable": "hydra.core.lib.strings.concat"},
"argument": {
"list": [
{"variable": "impureStr"},
{"variable": "partialStr"},
{"literal": {"string": "primitive "}},
{"variable": "localName"},
{"literal": {"string": " "}},
{"variable": "sigStr"},
{"variable": "implStr"}]}}},
"typeScheme": {"variables": [], "body": {"literal": "string"}, "constraints": []}}],
"body": {
"let": {
"bindings": [
{
"name": "baseDoc",
"term": {
"application": {
"function": {
"application": {
"function": {
"application": {
"function": {
"typeApplication": {
"body": {
"typeApplication": {"body": {"variable": "hydra.core.lib.optionals.match"}, "type": {"variable": "hydra.core.packaging.EntityMetadata"}}},
"type": {"literal": "string"}}},
"argument": {
"application": {
"function": {"project": {"typeName": "hydra.core.packaging.PrimitiveDefinition", "fieldName": "metadata"}},
"argument": {"variable": "pd"}}}}},
"argument": {"literal": {"string": ""}}}},
"argument": {
"lambda": {
"parameter": "meta",
"domain": {"variable": "hydra.core.packaging.EntityMetadata"},
"body": {
"application": {"function": {"variable": "hydra.core.print.packaging.entityMetadataDoc"}, "argument": {"variable": "meta"}}}}}}},
"typeScheme": {"variables": [], "body": {"literal": "string"}, "constraints": []}}],
"body": {
"let": {
"bindings": [
{
"name": "sigDocLines",
"term": {
"application": {
"function": {
"application": {
"function": {
"typeApplication": {
"body": {"typeApplication": {"body": {"variable": "hydra.core.lib.lists.map"}, "type": {"literal": "string"}}},
"type": {"literal": "string"}}},
"argument": {
"lambda": {
"parameter": "l",
"domain": {"literal": "string"},
"body": {
"application": {
"function": {
"application": {"function": {"variable": "hydra.core.lib.strings.concat2"}, "argument": {"literal": {"string": "## "}}}},
"argument": {"variable": "l"}}}}}}},
"argument": {
"application": {"function": {"variable": "hydra.core.print.packaging.primitiveSignatureDocLines"}, "argument": {"variable": "sig"}}}}},
"typeScheme": {"variables": [], "body": {"list": {"literal": "string"}}, "constraints": []}}],
"body": {
"let": {
"bindings": [
{
"name": "sigDoc",
"term": {
"application": {
"function": {"application": {"function": {"variable": "hydra.core.lib.strings.join"}, "argument": {"literal": {"string": "\n"}}}},
"argument": {"variable": "sigDocLines"}}},
"typeScheme": {"variables": [], "body": {"literal": "string"}, "constraints": []}}],
"body": {
"let": {
"bindings": [
{
"name": "fullDoc",
"term": {
"application": {
"function": {
"application": {
"function": {
"application": {
"function": {"typeApplication": {"body": {"variable": "hydra.core.lib.logic.ifElse"}, "type": {"literal": "string"}}},
"argument": {"application": {"function": {"variable": "hydra.core.lib.strings.isEmpty"}, "argument": {"variable": "sigDoc"}}}}},
"argument": {"variable": "baseDoc"}}},
"argument": {
"application": {
"function": {
"application": {
"function": {
"application": {
"function": {"typeApplication": {"body": {"variable": "hydra.core.lib.logic.ifElse"}, "type": {"literal": "string"}}},
"argument": {"application": {"function": {"variable": "hydra.core.lib.strings.isEmpty"}, "argument": {"variable": "baseDoc"}}}}},
"argument": {"variable": "sigDoc"}}},
"argument": {
"application": {
"function": {"variable": "hydra.core.lib.strings.concat"},
"argument": {"list": [{"variable": "baseDoc"}, {"literal": {"string": "\n##\n"}}, {"variable": "sigDoc"}]}}}}}}},
"typeScheme": {"variables": [], "body": {"literal": "string"}, "constraints": []}}],
"body": {
"application": {
"function": {
"application": {
"function": {
"application": {
"function": {"typeApplication": {"body": {"variable": "hydra.core.lib.logic.ifElse"}, "type": {"literal": "string"}}},
"argument": {"application": {"function": {"variable": "hydra.core.lib.strings.isEmpty"}, "argument": {"variable": "fullDoc"}}}}},
"argument": {"variable": "declStr"}}},
"argument": {
"application": {
"function": {"variable": "hydra.core.lib.strings.concat"},
"argument": {"list": [{"variable": "fullDoc"}, {"literal": {"string": "\n"}}, {"variable": "declStr"}]}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}},
"annotation": {
"map": [
{
"key": {"variable": "description"},
"value": {
"literal": {
"string": "Show a primitive definition as a string, shortening nominal references via the given import-alias map (#803)"}}}]}}}}},
{
"term": {
"name": "hydra.core.print.packaging.primitiveSignatureDocLines",
"signature": {
"typeParameters": [],
"parameters": [{"name": "arg0", "type": {"variable": "hydra.core.typing.TermSignature"}, "isLazy": false}],
"result": {"type": {"list": {"literal": "string"}}}},
"body": {
"annotated": {
"body": {
"lambda": {
"parameter": "sig",
"domain": {"variable": "hydra.core.typing.TermSignature"},
"body": {
"let": {
"bindings": [
{
"name": "paramLines",
"term": {
"application": {
"function": {"typeApplication": {"body": {"variable": "hydra.core.lib.optionals.givens"}, "type": {"literal": "string"}}},
"argument": {
"application": {
"function": {
"application": {
"function": {
"typeApplication": {
"body": {
"typeApplication": {"body": {"variable": "hydra.core.lib.lists.map"}, "type": {"variable": "hydra.core.typing.Parameter"}}},
"type": {"optional": {"literal": "string"}}}},
"argument": {
"lambda": {
"parameter": "p",
"domain": {"variable": "hydra.core.typing.Parameter"},
"body": {
"application": {
"function": {
"application": {
"function": {
"typeApplication": {
"body": {"typeApplication": {"body": {"variable": "hydra.core.lib.optionals.map"}, "type": {"literal": "string"}}},
"type": {"literal": "string"}}},
"argument": {
"lambda": {
"parameter": "d",
"domain": {"literal": "string"},
"body": {
"application": {
"function": {"variable": "hydra.core.lib.strings.concat"},
"argument": {
"list": [
{"literal": {"string": "@param "}},
{
"application": {
"function": {"unwrap": "hydra.core.model.Name"},
"argument": {
"application": {
"function": {"project": {"typeName": "hydra.core.typing.Parameter", "fieldName": "name"}},
"argument": {"variable": "p"}}}}},
{"literal": {"string": ": "}},
{"variable": "d"}]}}}}}}},
"argument": {
"application": {
"function": {"project": {"typeName": "hydra.core.typing.Parameter", "fieldName": "description"}},
"argument": {"variable": "p"}}}}}}}}},
"argument": {
"application": {
"function": {"project": {"typeName": "hydra.core.typing.TermSignature", "fieldName": "parameters"}},
"argument": {"variable": "sig"}}}}}}},
"typeScheme": {"variables": [], "body": {"list": {"literal": "string"}}, "constraints": []}}],
"body": {
"let": {
"bindings": [
{
"name": "returnLine",
"term": {
"application": {
"function": {
"application": {
"function": {
"typeApplication": {
"body": {"typeApplication": {"body": {"variable": "hydra.core.lib.optionals.map"}, "type": {"literal": "string"}}},
"type": {"literal": "string"}}},
"argument": {
"lambda": {
"parameter": "d",
"domain": {"literal": "string"},
"body": {
"application": {
"function": {"variable": "hydra.core.lib.strings.concat"},
"argument": {"list": [{"literal": {"string": "@return "}}, {"variable": "d"}]}}}}}}},
"argument": {
"application": {
"function": {"project": {"typeName": "hydra.core.typing.Result", "fieldName": "description"}},
"argument": {
"application": {
"function": {"project": {"typeName": "hydra.core.typing.TermSignature", "fieldName": "result"}},
"argument": {"variable": "sig"}}}}}}},
"typeScheme": {"variables": [], "body": {"optional": {"literal": "string"}}, "constraints": []}}],
"body": {
"application": {
"function": {
"application": {
"function": {"typeApplication": {"body": {"variable": "hydra.core.lib.lists.concat2"}, "type": {"literal": "string"}}},
"argument": {"variable": "paramLines"}}},
"argument": {
"application": {
"function": {"typeApplication": {"body": {"variable": "hydra.core.lib.optionals.toList"}, "type": {"literal": "string"}}},
"argument": {"variable": "returnLine"}}}}}}}}}}},
"annotation": {
"map": [
{
"key": {"variable": "description"},
"value": {
"literal": {
"string": "Render a primitive signature's parameter/result descriptions as '@param'/'@return' lines, sans '##' prefix (#837)"}}}]}}}}},
{
"term": {
"name": "hydra.core.print.packaging.termDefinition",
"signature": {
"typeParameters": [],
"parameters": [
{
"name": "arg0",
"type": {"map": {"keys": {"variable": "hydra.core.packaging.ModuleName"}, "values": {"literal": "string"}}},
"isLazy": false},
{"name": "arg1", "type": {"variable": "hydra.core.packaging.TermDefinition"}, "isLazy": false}],
"result": {"type": {"literal": "string"}}},
"body": {
"annotated": {
"body": {
"lambda": {
"parameter": "aliases",
"domain": {"map": {"keys": {"variable": "hydra.core.packaging.ModuleName"}, "values": {"literal": "string"}}},
"body": {
"lambda": {
"parameter": "td",
"domain": {"variable": "hydra.core.packaging.TermDefinition"},
"body": {
"let": {
"bindings": [
{
"name": "localName",
"term": {
"application": {
"function": {"variable": "hydra.core.names.localNameOf"},
"argument": {
"application": {
"function": {"project": {"typeName": "hydra.core.packaging.TermDefinition", "fieldName": "name"}},
"argument": {"variable": "td"}}}}},
"typeScheme": {"variables": [], "body": {"literal": "string"}, "constraints": []}}],
"body": {
"let": {
"bindings": [
{
"name": "sigStr",
"term": {
"application": {
"function": {
"application": {
"function": {
"application": {
"function": {
"typeApplication": {
"body": {
"typeApplication": {"body": {"variable": "hydra.core.lib.optionals.match"}, "type": {"variable": "hydra.core.typing.TermSignature"}}},
"type": {"literal": "string"}}},
"argument": {
"application": {
"function": {"project": {"typeName": "hydra.core.packaging.TermDefinition", "fieldName": "signature"}},
"argument": {"variable": "td"}}}}},
"argument": {"literal": {"string": " "}}}},
"argument": {
"lambda": {
"parameter": "sig",
"domain": {"variable": "hydra.core.typing.TermSignature"},
"body": {
"application": {
"function": {"variable": "hydra.core.lib.strings.concat"},
"argument": {
"list": [
{"literal": {"string": " : "}},
{
"application": {
"function": {
"application": {"function": {"variable": "hydra.core.print.model.termSignatureAliased"}, "argument": {"variable": "aliases"}}},
"argument": {"variable": "sig"}}},
{"literal": {"string": " "}}]}}}}}}},
"typeScheme": {"variables": [], "body": {"literal": "string"}, "constraints": []}}],
"body": {
"let": {
"bindings": [
{
"name": "peeled",
"term": {
"application": {
"function": {"variable": "hydra.core.print.model.peelTermDescriptionAnnotation"},
"argument": {
"application": {
"function": {"project": {"typeName": "hydra.core.packaging.TermDefinition", "fieldName": "body"}},
"argument": {"variable": "td"}}}}},
"typeScheme": {
"variables": [],
"body": {"pair": {"first": {"optional": {"literal": "string"}}, "second": {"variable": "hydra.core.model.Term"}}},
"constraints": []}}],
"body": {
"let": {
"bindings": [
{
"name": "mdesc",
"term": {
"application": {
"function": {
"typeApplication": {
"body": {"typeApplication": {"body": {"variable": "hydra.core.lib.pairs.first"}, "type": {"optional": {"literal": "string"}}}},
"type": {"variable": "hydra.core.model.Term"}}},
"argument": {"variable": "peeled"}}},
"typeScheme": {"variables": [], "body": {"optional": {"literal": "string"}}, "constraints": []}}],
"body": {
"let": {
"bindings": [
{
"name": "body",
"term": {
"application": {
"function": {
"typeApplication": {
"body": {"typeApplication": {"body": {"variable": "hydra.core.lib.pairs.second"}, "type": {"optional": {"literal": "string"}}}},
"type": {"variable": "hydra.core.model.Term"}}},
"argument": {"variable": "peeled"}}},
"typeScheme": {"variables": [], "body": {"variable": "hydra.core.model.Term"}, "constraints": []}}],
"body": {
"let": {
"bindings": [
{
"name": "headStr",
"term": {
"application": {
"function": {"variable": "hydra.core.lib.strings.concat"},
"argument": {
"list": [{"literal": {"string": "term "}}, {"variable": "localName"}, {"variable": "sigStr"}, {"literal": {"string": "="}}]}}},
"typeScheme": {"variables": [], "body": {"literal": "string"}, "constraints": []}}],
"body": {
"let": {
"bindings": [
{
"name": "inlineBudget",
"term": {
"application": {
"function": {
"application": {
"function": {"typeApplication": {"body": {"variable": "hydra.core.lib.math.sub"}, "type": {"literal": {"integer": "int32"}}}},
"argument": {"variable": "hydra.core.serialization.maxLineWidth"}}},
"argument": {
"application": {
"function": {
"application": {
"function": {"typeApplication": {"body": {"variable": "hydra.core.lib.math.add"}, "type": {"literal": {"integer": "int32"}}}},
"argument": {"application": {"function": {"variable": "hydra.core.lib.strings.length"}, "argument": {"variable": "headStr"}}}}},
"argument": {"literal": {"integer": {"int32": 1}}}}}}},
"typeScheme": {"variables": [], "body": {"literal": {"integer": "int32"}}, "constraints": []}}],
"body": {
"let": {
"bindings": [
{
"name": "inlineBodyExpr",
"term": {
"application": {
"function": {
"application": {
"function": {
"application": {
"function": {
"application": {"function": {"variable": "hydra.core.print.model.termExprAtPrecBudget"}, "argument": {"variable": "inlineBudget"}}},
"argument": {"variable": "aliases"}}},
"argument": {"literal": {"integer": {"int32": 0}}}}},
"argument": {"variable": "body"}}},
"typeScheme": {"variables": [], "body": {"variable": "hydra.core.ast.Expr"}, "constraints": []}}],
"body": {
"let": {
"bindings": [
{
"name": "declStr",
"term": {
"application": {
"function": {
"application": {
"function": {
"application": {
"function": {"typeApplication": {"body": {"variable": "hydra.core.lib.logic.ifElse"}, "type": {"literal": "string"}}},
"argument": {
"application": {
"function": {
"application": {
"function": {"typeApplication": {"body": {"variable": "hydra.core.lib.ordering.lte"}, "type": {"literal": {"integer": "int32"}}}},
"argument": {
"application": {"function": {"variable": "hydra.core.serialization.expressionLength"}, "argument": {"variable": "inlineBodyExpr"}}}}},
"argument": {"variable": "inlineBudget"}}}}},
"argument": {
"application": {
"function": {"variable": "hydra.core.lib.strings.concat"},
"argument": {
"list": [
{"variable": "headStr"},
{"literal": {"string": " "}},
{
"application": {"function": {"variable": "hydra.core.serialization.printExpr"}, "argument": {"variable": "inlineBodyExpr"}}}]}}}}},
"argument": {
"let": {
"bindings": [
{
"name": "blockBodyExpr",
"term": {
"application": {
"function": {
"application": {
"function": {
"application": {
"function": {
"application": {
"function": {"variable": "hydra.core.print.model.termExprAtPrecBudget"},
"argument": {"variable": "hydra.core.serialization.maxLineWidth"}}},
"argument": {"variable": "aliases"}}},
"argument": {"literal": {"integer": {"int32": 0}}}}},
"argument": {"variable": "body"}}},
"typeScheme": {"variables": [], "body": {"variable": "hydra.core.ast.Expr"}, "constraints": []}}],
"body": {
"application": {
"function": {"variable": "hydra.core.lib.strings.concat"},
"argument": {
"list": [
{"variable": "headStr"},
{"literal": {"string": "\n"}},
{
"application": {
"function": {
"application": {
"function": {"variable": "hydra.core.serialization.customIndent"},
"argument": {"variable": "hydra.core.serialization.doubleSpace"}}},
"argument": {
"application": {"function": {"variable": "hydra.core.serialization.printExpr"}, "argument": {"variable": "blockBodyExpr"}}}}}]}}}}}}},
"typeScheme": {"variables": [], "body": {"literal": "string"}, "constraints": []}}],
"body": {
"let": {
"bindings": [
{
"name": "withDescDoc",
"term": {
"application": {
"function": {
"application": {
"function": {
"application": {
"function": {
"typeApplication": {
"body": {"typeApplication": {"body": {"variable": "hydra.core.lib.optionals.match"}, "type": {"literal": "string"}}},
"type": {"literal": "string"}}},
"argument": {"variable": "mdesc"}}},
"argument": {"variable": "declStr"}}},
"argument": {
"lambda": {
"parameter": "d",
"domain": {"literal": "string"},
"body": {
"application": {
"function": {"variable": "hydra.core.lib.strings.concat"},
"argument": {
"list": [
{
"application": {
"function": {"application": {"function": {"variable": "hydra.core.lib.strings.join"}, "argument": {"literal": {"string": "\n"}}}},
"argument": {
"application": {"function": {"variable": "hydra.core.print.packaging.docCommentLinesOf"}, "argument": {"variable": "d"}}}}},
{"literal": {"string": "\n"}},
{"variable": "declStr"}]}}}}}}},
"typeScheme": {"variables": [], "body": {"literal": "string"}, "constraints": []}}],
"body": {
"application": {
"function": {
"application": {
"function": {"variable": "hydra.core.print.packaging.withDefinitionDoc"},
"argument": {
"application": {
"function": {"project": {"typeName": "hydra.core.packaging.TermDefinition", "fieldName": "metadata"}},
"argument": {"variable": "td"}}}}},
"argument": {"variable": "withDescDoc"}}}}}}}}}}}}}}}}}}}}}}}}}}},
"annotation": {
"map": [
{
"key": {"variable": "description"},
"value": {
"literal": {"string": "Show a term definition as a string, shortening nominal references via the given import-alias map (#803)"}}}]}}}}},
{
"term": {
"name": "hydra.core.print.packaging.typeDefinition",
"signature": {
"typeParameters": [],
"parameters": [
{
"name": "arg0",
"type": {"map": {"keys": {"variable": "hydra.core.packaging.ModuleName"}, "values": {"literal": "string"}}},
"isLazy": false},
{"name": "arg1", "type": {"variable": "hydra.core.packaging.TypeDefinition"}, "isLazy": false}],
"result": {"type": {"literal": "string"}}},
"body": {
"annotated": {
"body": {
"lambda": {
"parameter": "aliases",
"domain": {"map": {"keys": {"variable": "hydra.core.packaging.ModuleName"}, "values": {"literal": "string"}}},
"body": {
"lambda": {
"parameter": "td",
"domain": {"variable": "hydra.core.packaging.TypeDefinition"},
"body": {
"let": {
"bindings": [
{
"name": "localName",
"term": {
"application": {
"function": {"variable": "hydra.core.names.localNameOf"},
"argument": {
"application": {
"function": {"project": {"typeName": "hydra.core.packaging.TypeDefinition", "fieldName": "name"}},
"argument": {"variable": "td"}}}}},
"typeScheme": {"variables": [], "body": {"literal": "string"}, "constraints": []}}],
"body": {
"let": {
"bindings": [
{
"name": "scheme",
"term": {
"application": {
"function": {"project": {"typeName": "hydra.core.packaging.TypeDefinition", "fieldName": "body"}},
"argument": {"variable": "td"}}},
"typeScheme": {"variables": [], "body": {"variable": "hydra.core.model.TypeScheme"}, "constraints": []}}],
"body": {
"let": {
"bindings": [
{
"name": "body",
"term": {
"application": {
"function": {"project": {"typeName": "hydra.core.model.TypeScheme", "fieldName": "body"}},
"argument": {"variable": "scheme"}}},
"typeScheme": {"variables": [], "body": {"variable": "hydra.core.model.Type"}, "constraints": []}}],
"body": {
"let": {
"bindings": [
{
"name": "peeled",
"term": {
"application": {"function": {"variable": "hydra.core.print.model.peelDescriptionAnnotation"}, "argument": {"variable": "body"}}},
"typeScheme": {
"variables": [],
"body": {"pair": {"first": {"optional": {"literal": "string"}}, "second": {"variable": "hydra.core.model.Type"}}},
"constraints": []}}],
"body": {
"let": {
"bindings": [
{
"name": "mdesc",
"term": {
"application": {
"function": {
"typeApplication": {
"body": {"typeApplication": {"body": {"variable": "hydra.core.lib.pairs.first"}, "type": {"optional": {"literal": "string"}}}},
"type": {"variable": "hydra.core.model.Type"}}},
"argument": {"variable": "peeled"}}},
"typeScheme": {"variables": [], "body": {"optional": {"literal": "string"}}, "constraints": []}}],
"body": {
"let": {
"bindings": [
{
"name": "unwrappedScheme",
"term": {
"record": {
"typeName": "hydra.core.model.TypeScheme",
"fields": [
{
"name": "variables",
"term": {
"application": {
"function": {"project": {"typeName": "hydra.core.model.TypeScheme", "fieldName": "variables"}},
"argument": {"variable": "scheme"}}}},
{
"name": "body",
"term": {
"application": {
"function": {
"typeApplication": {
"body": {"typeApplication": {"body": {"variable": "hydra.core.lib.pairs.second"}, "type": {"optional": {"literal": "string"}}}},
"type": {"variable": "hydra.core.model.Type"}}},
"argument": {"variable": "peeled"}}}},
{
"name": "constraints",
"term": {
"application": {
"function": {"project": {"typeName": "hydra.core.model.TypeScheme", "fieldName": "constraints"}},
"argument": {"variable": "scheme"}}}}]}},
"typeScheme": {"variables": [], "body": {"variable": "hydra.core.model.TypeScheme"}, "constraints": []}}],
"body": {
"let": {
"bindings": [
{
"name": "typeStr",
"term": {
"application": {
"function": {
"application": {"function": {"variable": "hydra.core.print.model.typeSchemeAliased"}, "argument": {"variable": "aliases"}}},
"argument": {"variable": "unwrappedScheme"}}},
"typeScheme": {"variables": [], "body": {"literal": "string"}, "constraints": []}}],
"body": {
"let": {
"bindings": [
{
"name": "declStr",
"term": {
"application": {
"function": {"variable": "hydra.core.lib.strings.concat"},
"argument": {
"list": [{"literal": {"string": "type "}}, {"variable": "localName"}, {"literal": {"string": " = "}}, {"variable": "typeStr"}]}}},
"typeScheme": {"variables": [], "body": {"literal": "string"}, "constraints": []}}],
"body": {
"let": {
"bindings": [
{
"name": "withDescDoc",
"term": {
"application": {
"function": {
"application": {
"function": {
"application": {
"function": {
"typeApplication": {
"body": {"typeApplication": {"body": {"variable": "hydra.core.lib.optionals.match"}, "type": {"literal": "string"}}},
"type": {"literal": "string"}}},
"argument": {"variable": "mdesc"}}},
"argument": {"variable": "declStr"}}},
"argument": {
"lambda": {
"parameter": "d",
"domain": {"literal": "string"},
"body": {
"application": {
"function": {"variable": "hydra.core.lib.strings.concat"},
"argument": {
"list": [
{
"application": {
"function": {"application": {"function": {"variable": "hydra.core.lib.strings.join"}, "argument": {"literal": {"string": "\n"}}}},
"argument": {
"application": {"function": {"variable": "hydra.core.print.packaging.docCommentLinesOf"}, "argument": {"variable": "d"}}}}},
{"literal": {"string": "\n"}},
{"variable": "declStr"}]}}}}}}},
"typeScheme": {"variables": [], "body": {"literal": "string"}, "constraints": []}}],
"body": {
"application": {
"function": {
"application": {
"function": {"variable": "hydra.core.print.packaging.withDefinitionDoc"},
"argument": {
"application": {
"function": {"project": {"typeName": "hydra.core.packaging.TypeDefinition", "fieldName": "metadata"}},
"argument": {"variable": "td"}}}}},
"argument": {"variable": "withDescDoc"}}}}}}}}}}}}}}}}}}}}}}}}},
"annotation": {
"map": [
{
"key": {"variable": "description"},
"value": {
"literal": {"string": "Show a type definition as a string, shortening nominal references via the given import-alias map (#803)"}}}]}}}}},
{
"term": {
"name": "hydra.core.print.packaging.withDefinitionDoc",
"signature": {
"typeParameters": [],
"parameters": [
{"name": "arg0", "type": {"optional": {"variable": "hydra.core.packaging.EntityMetadata"}}, "isLazy": false},
{"name": "arg1", "type": {"literal": "string"}, "isLazy": false}],
"result": {"type": {"literal": "string"}}},
"body": {
"annotated": {
"body": {
"lambda": {
"parameter": "mmeta",
"domain": {"optional": {"variable": "hydra.core.packaging.EntityMetadata"}},
"body": {
"lambda": {
"parameter": "declStr",
"domain": {"literal": "string"},
"body": {
"application": {
"function": {
"application": {
"function": {
"application": {
"function": {
"typeApplication": {
"body": {
"typeApplication": {"body": {"variable": "hydra.core.lib.optionals.match"}, "type": {"variable": "hydra.core.packaging.EntityMetadata"}}},
"type": {"literal": "string"}}},
"argument": {"variable": "mmeta"}}},
"argument": {"variable": "declStr"}}},
"argument": {
"lambda": {
"parameter": "meta",
"domain": {"variable": "hydra.core.packaging.EntityMetadata"},
"body": {
"let": {
"bindings": [
{
"name": "docBlock",
"term": {
"application": {"function": {"variable": "hydra.core.print.packaging.entityMetadataDoc"}, "argument": {"variable": "meta"}}},
"typeScheme": {"variables": [], "body": {"literal": "string"}, "constraints": []}}],
"body": {
"application": {
"function": {
"application": {
"function": {
"application": {
"function": {"typeApplication": {"body": {"variable": "hydra.core.lib.logic.ifElse"}, "type": {"literal": "string"}}},
"argument": {"application": {"function": {"variable": "hydra.core.lib.strings.isEmpty"}, "argument": {"variable": "docBlock"}}}}},
"argument": {"variable": "declStr"}}},
"argument": {
"application": {
"function": {"variable": "hydra.core.lib.strings.concat"},
"argument": {"list": [{"variable": "docBlock"}, {"literal": {"string": "\n"}}, {"variable": "declStr"}]}}}}}}}}}}}}}}},
"annotation": {
"map": [
{
"key": {"variable": "description"},
"value": {"literal": {"string": "Prepend a definition's '##' doc-comment block to its printed declaration, if present"}}}]}}}}}]}