hydra-kernel-0.18.1: hydra-kernel-json/hydra/core/print/model.json
{
"name": "hydra.core.print.model",
"metadata": {"description": "String representations of hydra.core.model types", "comments": [], "seeAlso": [], "provisions": []},
"dependencies": [
{"module": "hydra.core.ast"},
{"module": "hydra.core.lib.chars"},
{"module": "hydra.core.lib.eithers"},
{"module": "hydra.core.lib.equality"},
{"module": "hydra.core.lib.lists"},
{"module": "hydra.core.lib.literals"},
{"module": "hydra.core.lib.logic"},
{"module": "hydra.core.lib.maps"},
{"module": "hydra.core.lib.math"},
{"module": "hydra.core.lib.optionals"},
{"module": "hydra.core.lib.ordering"},
{"module": "hydra.core.lib.pairs"},
{"module": "hydra.core.lib.sets"},
{"module": "hydra.core.lib.strings"},
{"module": "hydra.core.model"},
{"module": "hydra.core.packaging"},
{"module": "hydra.core.serialization"},
{"module": "hydra.core.typing"}],
"definitions": [
{
"term": {
"name": "hydra.core.print.model.binding",
"signature": {
"typeParameters": [],
"parameters": [{"name": "arg0", "type": {"variable": "hydra.core.model.Binding"}, "isLazy": false}],
"result": {"type": {"literal": "string"}}},
"body": {
"annotated": {
"body": {
"application": {
"function": {"variable": "hydra.core.print.model.bindingAliased"},
"argument": {
"typeApplication": {
"body": {
"typeApplication": {"body": {"variable": "hydra.core.lib.maps.empty"}, "type": {"variable": "hydra.core.packaging.ModuleName"}}},
"type": {"literal": "string"}}}}},
"annotation": {"map": [{"key": {"variable": "description"}, "value": {"literal": {"string": "Show a binding as a string"}}}]}}}}},
{
"term": {
"name": "hydra.core.print.model.bindingAliased",
"signature": {
"typeParameters": [],
"parameters": [
{
"name": "arg0",
"type": {"map": {"keys": {"variable": "hydra.core.packaging.ModuleName"}, "values": {"literal": "string"}}},
"isLazy": false},
{"name": "arg1", "type": {"variable": "hydra.core.model.Binding"}, "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": "el",
"domain": {"variable": "hydra.core.model.Binding"},
"body": {
"let": {
"bindings": [
{
"name": "name",
"term": {
"application": {
"function": {"variable": "hydra.core.print.model.printName"},
"argument": {
"application": {"function": {"project": {"typeName": "hydra.core.model.Binding", "fieldName": "name"}}, "argument": {"variable": "el"}}}}},
"typeScheme": {"variables": [], "body": {"literal": "string"}, "constraints": []}}],
"body": {
"let": {
"bindings": [
{
"name": "t",
"term": {
"application": {"function": {"project": {"typeName": "hydra.core.model.Binding", "fieldName": "term"}}, "argument": {"variable": "el"}}},
"typeScheme": {"variables": [], "body": {"variable": "hydra.core.model.Term"}, "constraints": []}}],
"body": {
"let": {
"bindings": [
{
"name": "typeStr",
"term": {
"application": {
"function": {
"application": {
"function": {
"application": {
"function": {
"typeApplication": {
"body": {
"typeApplication": {"body": {"variable": "hydra.core.lib.optionals.match"}, "type": {"variable": "hydra.core.model.TypeScheme"}}},
"type": {"literal": "string"}}},
"argument": {
"application": {
"function": {"project": {"typeName": "hydra.core.model.Binding", "fieldName": "typeScheme"}},
"argument": {"variable": "el"}}}}},
"argument": {"literal": {"string": ""}}}},
"argument": {
"lambda": {
"parameter": "ts",
"domain": {"variable": "hydra.core.model.TypeScheme"},
"body": {
"application": {
"function": {"variable": "hydra.core.lib.strings.concat"},
"argument": {
"list": [
{"literal": {"string": ":("}},
{
"application": {
"function": {
"application": {"function": {"variable": "hydra.core.print.model.typeSchemeAliased"}, "argument": {"variable": "aliases"}}},
"argument": {"variable": "ts"}}},
{"literal": {"string": ")"}}]}}}}}}},
"typeScheme": {"variables": [], "body": {"literal": "string"}, "constraints": []}}],
"body": {
"application": {
"function": {"variable": "hydra.core.lib.strings.concat"},
"argument": {
"list": [
{"variable": "name"},
{"variable": "typeStr"},
{"literal": {"string": " := "}},
{
"application": {
"function": {"application": {"function": {"variable": "hydra.core.print.model.termAliased"}, "argument": {"variable": "aliases"}}},
"argument": {"variable": "t"}}}]}}}}}}}}}}}}},
"annotation": {
"map": [
{
"key": {"variable": "description"},
"value": {
"literal": {"string": "Show a binding as a string, shortening nominal references via the given import-alias map (#803)"}}}]}}}}},
{
"term": {
"name": "hydra.core.print.model.bindingExprAliased",
"signature": {
"typeParameters": [],
"parameters": [
{"name": "arg0", "type": {"literal": {"integer": "int32"}}, "isLazy": false},
{
"name": "arg1",
"type": {"map": {"keys": {"variable": "hydra.core.packaging.ModuleName"}, "values": {"literal": "string"}}},
"isLazy": false},
{"name": "arg2", "type": {"variable": "hydra.core.model.Binding"}, "isLazy": false}],
"result": {"type": {"variable": "hydra.core.ast.Expr"}}},
"body": {
"annotated": {
"body": {
"lambda": {
"parameter": "budget",
"domain": {"literal": {"integer": "int32"}},
"body": {
"lambda": {
"parameter": "aliases",
"domain": {"map": {"keys": {"variable": "hydra.core.packaging.ModuleName"}, "values": {"literal": "string"}}},
"body": {
"lambda": {
"parameter": "el",
"domain": {"variable": "hydra.core.model.Binding"},
"body": {
"let": {
"bindings": [
{
"name": "name",
"term": {
"application": {
"function": {"variable": "hydra.core.print.model.printName"},
"argument": {
"application": {"function": {"project": {"typeName": "hydra.core.model.Binding", "fieldName": "name"}}, "argument": {"variable": "el"}}}}},
"typeScheme": {"variables": [], "body": {"literal": "string"}, "constraints": []}}],
"body": {
"let": {
"bindings": [
{
"name": "t",
"term": {
"application": {"function": {"project": {"typeName": "hydra.core.model.Binding", "fieldName": "term"}}, "argument": {"variable": "el"}}},
"typeScheme": {"variables": [], "body": {"variable": "hydra.core.model.Term"}, "constraints": []}}],
"body": {
"let": {
"bindings": [
{
"name": "typeStr",
"term": {
"application": {
"function": {
"application": {
"function": {
"application": {
"function": {
"typeApplication": {
"body": {
"typeApplication": {"body": {"variable": "hydra.core.lib.optionals.match"}, "type": {"variable": "hydra.core.model.TypeScheme"}}},
"type": {"literal": "string"}}},
"argument": {
"application": {
"function": {"project": {"typeName": "hydra.core.model.Binding", "fieldName": "typeScheme"}},
"argument": {"variable": "el"}}}}},
"argument": {"literal": {"string": ""}}}},
"argument": {
"lambda": {
"parameter": "ts",
"domain": {"variable": "hydra.core.model.TypeScheme"},
"body": {
"application": {
"function": {"variable": "hydra.core.lib.strings.concat"},
"argument": {
"list": [
{"literal": {"string": ":("}},
{
"application": {
"function": {
"application": {"function": {"variable": "hydra.core.print.model.typeSchemeAliased"}, "argument": {"variable": "aliases"}}},
"argument": {"variable": "ts"}}},
{"literal": {"string": ")"}}]}}}}}}},
"typeScheme": {"variables": [], "body": {"literal": "string"}, "constraints": []}}],
"body": {
"let": {
"bindings": [
{
"name": "headStr",
"term": {
"application": {
"function": {"variable": "hydra.core.lib.strings.concat"},
"argument": {"list": [{"variable": "name"}, {"variable": "typeStr"}, {"literal": {"string": " := "}}]}}},
"typeScheme": {"variables": [], "body": {"literal": "string"}, "constraints": []}}],
"body": {
"let": {
"bindings": [
{
"name": "valueBudget",
"term": {
"application": {
"function": {
"application": {
"function": {"typeApplication": {"body": {"variable": "hydra.core.lib.math.sub"}, "type": {"literal": {"integer": "int32"}}}},
"argument": {"variable": "budget"}}},
"argument": {"application": {"function": {"variable": "hydra.core.lib.strings.length"}, "argument": {"variable": "headStr"}}}}},
"typeScheme": {"variables": [], "body": {"literal": {"integer": "int32"}}, "constraints": []}}],
"body": {
"let": {
"bindings": [
{
"name": "valueExpr",
"term": {
"application": {
"function": {
"application": {
"function": {
"application": {
"function": {
"application": {"function": {"variable": "hydra.core.print.model.termExprAtPrecBudget"}, "argument": {"variable": "valueBudget"}}},
"argument": {"variable": "aliases"}}},
"argument": {"literal": {"integer": {"int32": 0}}}}},
"argument": {"variable": "t"}}},
"typeScheme": {"variables": [], "body": {"variable": "hydra.core.ast.Expr"}, "constraints": []}}],
"body": {
"let": {
"bindings": [
{
"name": "headOp",
"term": {
"record": {
"typeName": "hydra.core.ast.Op",
"fields": [
{
"name": "symbol",
"term": {"application": {"function": {"variable": "hydra.core.serialization.sym"}, "argument": {"literal": {"string": ""}}}}},
{
"name": "padding",
"term": {
"record": {
"typeName": "hydra.core.ast.Padding",
"fields": [
{"name": "left", "term": {"inject": {"typeName": "hydra.core.ast.Ws", "field": {"name": "none", "term": "unit"}}}},
{"name": "right", "term": {"inject": {"typeName": "hydra.core.ast.Ws", "field": {"name": "none", "term": "unit"}}}}]}}},
{
"name": "precedence",
"term": {"wrap": {"typeName": "hydra.core.ast.Precedence", "body": {"literal": {"integer": {"int32": 0}}}}}},
{
"name": "associativity",
"term": {"inject": {"typeName": "hydra.core.ast.Associativity", "field": {"name": "none", "term": "unit"}}}}]}},
"typeScheme": {"variables": [], "body": {"variable": "hydra.core.ast.Op"}, "constraints": []}}],
"body": {
"application": {
"function": {
"application": {
"function": {
"application": {
"function": {"typeApplication": {"body": {"variable": "hydra.core.lib.logic.ifElse"}, "type": {"variable": "hydra.core.ast.Expr"}}},
"argument": {"application": {"function": {"variable": "hydra.core.print.model.isBracketedTerm"}, "argument": {"variable": "t"}}}}},
"argument": {
"application": {
"function": {
"application": {
"function": {"application": {"function": {"variable": "hydra.core.serialization.ifx"}, "argument": {"variable": "headOp"}}},
"argument": {"application": {"function": {"variable": "hydra.core.serialization.cst"}, "argument": {"variable": "headStr"}}}}},
"argument": {"variable": "valueExpr"}}}}},
"argument": {
"application": {
"function": {
"application": {
"function": {"variable": "hydra.core.serialization.indentSubsequentLines"},
"argument": {"variable": "hydra.core.serialization.doubleSpace"}}},
"argument": {
"application": {
"function": {
"application": {
"function": {"application": {"function": {"variable": "hydra.core.serialization.ifx"}, "argument": {"variable": "headOp"}}},
"argument": {"application": {"function": {"variable": "hydra.core.serialization.cst"}, "argument": {"variable": "headStr"}}}}},
"argument": {"variable": "valueExpr"}}}}}}}}}}}}}}}}}}}}}}}}}}},
"annotation": {
"map": [
{
"key": {"variable": "description"},
"value": {
"literal": {
"string": "Show a binding as a line-layout expression, shortening nominal references via the given import-alias map (#803)"}}}]}}}}},
{
"term": {
"name": "hydra.core.print.model.caseStatement",
"signature": {
"typeParameters": [],
"parameters": [
{
"name": "arg0",
"type": {"map": {"keys": {"variable": "hydra.core.packaging.ModuleName"}, "values": {"literal": "string"}}},
"isLazy": false},
{"name": "arg1", "type": {"variable": "hydra.core.model.CaseStatement"}, "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": "cs",
"domain": {"variable": "hydra.core.model.CaseStatement"},
"body": {
"let": {
"bindings": [
{
"name": "tname",
"term": {
"application": {
"function": {
"application": {"function": {"variable": "hydra.core.print.model.printNameAliased"}, "argument": {"variable": "aliases"}}},
"argument": {
"application": {
"function": {"project": {"typeName": "hydra.core.model.CaseStatement", "fieldName": "typeName"}},
"argument": {"variable": "cs"}}}}},
"typeScheme": {"variables": [], "body": {"literal": "string"}, "constraints": []}}],
"body": {
"let": {
"bindings": [
{
"name": "mdef",
"term": {
"application": {
"function": {"project": {"typeName": "hydra.core.model.CaseStatement", "fieldName": "default"}},
"argument": {"variable": "cs"}}},
"typeScheme": {"variables": [], "body": {"optional": {"variable": "hydra.core.model.Term"}}, "constraints": []}}],
"body": {
"let": {
"bindings": [
{
"name": "csCases",
"term": {
"application": {
"function": {"project": {"typeName": "hydra.core.model.CaseStatement", "fieldName": "cases"}},
"argument": {"variable": "cs"}}},
"typeScheme": {"variables": [], "body": {"list": {"variable": "hydra.core.model.CaseAlternative"}}, "constraints": []}}],
"body": {
"let": {
"bindings": [
{
"name": "caseFields",
"term": {
"application": {
"function": {
"application": {
"function": {
"typeApplication": {
"body": {
"typeApplication": {"body": {"variable": "hydra.core.lib.lists.map"}, "type": {"variable": "hydra.core.model.CaseAlternative"}}},
"type": {"variable": "hydra.core.model.Field"}}},
"argument": {
"lambda": {
"parameter": "alt",
"domain": {"variable": "hydra.core.model.CaseAlternative"},
"body": {
"record": {
"typeName": "hydra.core.model.Field",
"fields": [
{
"name": "name",
"term": {
"application": {
"function": {"project": {"typeName": "hydra.core.model.CaseAlternative", "fieldName": "name"}},
"argument": {"variable": "alt"}}}},
{
"name": "term",
"term": {
"application": {
"function": {"project": {"typeName": "hydra.core.model.CaseAlternative", "fieldName": "handler"}},
"argument": {"variable": "alt"}}}}]}}}}}},
"argument": {"variable": "csCases"}}},
"typeScheme": {"variables": [], "body": {"list": {"variable": "hydra.core.model.Field"}}, "constraints": []}}],
"body": {
"let": {
"bindings": [
{
"name": "defaultField",
"term": {
"application": {
"function": {
"application": {
"function": {
"application": {
"function": {
"typeApplication": {
"body": {
"typeApplication": {"body": {"variable": "hydra.core.lib.optionals.match"}, "type": {"variable": "hydra.core.model.Term"}}},
"type": {"list": {"variable": "hydra.core.model.Field"}}}},
"argument": {"variable": "mdef"}}},
"argument": {"typeApplication": {"body": {"list": []}, "type": {"variable": "hydra.core.model.Field"}}}}},
"argument": {
"lambda": {
"parameter": "d",
"domain": {"variable": "hydra.core.model.Term"},
"body": {
"list": [
{
"record": {
"typeName": "hydra.core.model.Field",
"fields": [
{"name": "name", "term": {"wrap": {"typeName": "hydra.core.model.Name", "body": {"literal": {"string": "_"}}}}},
{"name": "term", "term": {"variable": "d"}}]}}]}}}}},
"typeScheme": {"variables": [], "body": {"list": {"variable": "hydra.core.model.Field"}}, "constraints": []}}],
"body": {
"let": {
"bindings": [
{
"name": "allFields",
"term": {
"application": {
"function": {
"typeApplication": {"body": {"variable": "hydra.core.lib.lists.concat"}, "type": {"variable": "hydra.core.model.Field"}}},
"argument": {"list": [{"variable": "caseFields"}, {"variable": "defaultField"}]}}},
"typeScheme": {"variables": [], "body": {"list": {"variable": "hydra.core.model.Field"}}, "constraints": []}}],
"body": {
"application": {
"function": {"variable": "hydra.core.lib.strings.concat"},
"argument": {
"list": [
{"literal": {"string": "cases("}},
{"variable": "tname"},
{"literal": {"string": ")"}},
{
"application": {
"function": {"application": {"function": {"variable": "hydra.core.print.model.fields"}, "argument": {"variable": "aliases"}}},
"argument": {"variable": "allFields"}}}]}}}}}}}}}}}}}}}}}}},
"annotation": {
"map": [
{
"key": {"variable": "description"},
"value": {
"literal": {"string": "Show a case statement as a string, shortening nominal references via the given import-alias map (#803)"}}}]}}}}},
{
"term": {
"name": "hydra.core.print.model.caseStatementExprAliased",
"signature": {
"typeParameters": [],
"parameters": [
{"name": "arg0", "type": {"literal": {"integer": "int32"}}, "isLazy": false},
{
"name": "arg1",
"type": {"map": {"keys": {"variable": "hydra.core.packaging.ModuleName"}, "values": {"literal": "string"}}},
"isLazy": false},
{"name": "arg2", "type": {"variable": "hydra.core.model.CaseStatement"}, "isLazy": false}],
"result": {"type": {"variable": "hydra.core.ast.Expr"}}},
"body": {
"annotated": {
"body": {
"lambda": {
"parameter": "budget",
"domain": {"literal": {"integer": "int32"}},
"body": {
"lambda": {
"parameter": "aliases",
"domain": {"map": {"keys": {"variable": "hydra.core.packaging.ModuleName"}, "values": {"literal": "string"}}},
"body": {
"lambda": {
"parameter": "cs",
"domain": {"variable": "hydra.core.model.CaseStatement"},
"body": {
"let": {
"bindings": [
{
"name": "tname",
"term": {
"application": {
"function": {
"application": {"function": {"variable": "hydra.core.print.model.printNameAliased"}, "argument": {"variable": "aliases"}}},
"argument": {
"application": {
"function": {"project": {"typeName": "hydra.core.model.CaseStatement", "fieldName": "typeName"}},
"argument": {"variable": "cs"}}}}},
"typeScheme": {"variables": [], "body": {"literal": "string"}, "constraints": []}}],
"body": {
"let": {
"bindings": [
{
"name": "mdef",
"term": {
"application": {
"function": {"project": {"typeName": "hydra.core.model.CaseStatement", "fieldName": "default"}},
"argument": {"variable": "cs"}}},
"typeScheme": {"variables": [], "body": {"optional": {"variable": "hydra.core.model.Term"}}, "constraints": []}}],
"body": {
"let": {
"bindings": [
{
"name": "csCases",
"term": {
"application": {
"function": {"project": {"typeName": "hydra.core.model.CaseStatement", "fieldName": "cases"}},
"argument": {"variable": "cs"}}},
"typeScheme": {"variables": [], "body": {"list": {"variable": "hydra.core.model.CaseAlternative"}}, "constraints": []}}],
"body": {
"let": {
"bindings": [
{
"name": "caseFields",
"term": {
"application": {
"function": {
"application": {
"function": {
"typeApplication": {
"body": {
"typeApplication": {"body": {"variable": "hydra.core.lib.lists.map"}, "type": {"variable": "hydra.core.model.CaseAlternative"}}},
"type": {"variable": "hydra.core.model.Field"}}},
"argument": {
"lambda": {
"parameter": "alt",
"domain": {"variable": "hydra.core.model.CaseAlternative"},
"body": {
"record": {
"typeName": "hydra.core.model.Field",
"fields": [
{
"name": "name",
"term": {
"application": {
"function": {"project": {"typeName": "hydra.core.model.CaseAlternative", "fieldName": "name"}},
"argument": {"variable": "alt"}}}},
{
"name": "term",
"term": {
"application": {
"function": {"project": {"typeName": "hydra.core.model.CaseAlternative", "fieldName": "handler"}},
"argument": {"variable": "alt"}}}}]}}}}}},
"argument": {"variable": "csCases"}}},
"typeScheme": {"variables": [], "body": {"list": {"variable": "hydra.core.model.Field"}}, "constraints": []}}],
"body": {
"let": {
"bindings": [
{
"name": "defaultField",
"term": {
"application": {
"function": {
"application": {
"function": {
"application": {
"function": {
"typeApplication": {
"body": {
"typeApplication": {"body": {"variable": "hydra.core.lib.optionals.match"}, "type": {"variable": "hydra.core.model.Term"}}},
"type": {"list": {"variable": "hydra.core.model.Field"}}}},
"argument": {"variable": "mdef"}}},
"argument": {"typeApplication": {"body": {"list": []}, "type": {"variable": "hydra.core.model.Field"}}}}},
"argument": {
"lambda": {
"parameter": "d",
"domain": {"variable": "hydra.core.model.Term"},
"body": {
"list": [
{
"record": {
"typeName": "hydra.core.model.Field",
"fields": [
{"name": "name", "term": {"wrap": {"typeName": "hydra.core.model.Name", "body": {"literal": {"string": "_"}}}}},
{"name": "term", "term": {"variable": "d"}}]}}]}}}}},
"typeScheme": {"variables": [], "body": {"list": {"variable": "hydra.core.model.Field"}}, "constraints": []}}],
"body": {
"let": {
"bindings": [
{
"name": "allFields",
"term": {
"application": {
"function": {
"typeApplication": {"body": {"variable": "hydra.core.lib.lists.concat"}, "type": {"variable": "hydra.core.model.Field"}}},
"argument": {"list": [{"variable": "caseFields"}, {"variable": "defaultField"}]}}},
"typeScheme": {"variables": [], "body": {"list": {"variable": "hydra.core.model.Field"}}, "constraints": []}}],
"body": {
"let": {
"bindings": [
{
"name": "headStr",
"term": {
"application": {
"function": {"variable": "hydra.core.lib.strings.concat"},
"argument": {"list": [{"literal": {"string": "cases("}}, {"variable": "tname"}, {"literal": {"string": ")"}}]}}},
"typeScheme": {"variables": [], "body": {"literal": "string"}, "constraints": []}}],
"body": {
"let": {
"bindings": [
{
"name": "fieldBudget",
"term": {
"application": {
"function": {
"application": {
"function": {"typeApplication": {"body": {"variable": "hydra.core.lib.math.sub"}, "type": {"literal": {"integer": "int32"}}}},
"argument": {
"application": {
"function": {
"application": {
"function": {"typeApplication": {"body": {"variable": "hydra.core.lib.math.sub"}, "type": {"literal": {"integer": "int32"}}}},
"argument": {"variable": "budget"}}},
"argument": {"application": {"function": {"variable": "hydra.core.lib.strings.length"}, "argument": {"variable": "headStr"}}}}}}},
"argument": {"literal": {"integer": {"int32": 2}}}}},
"typeScheme": {"variables": [], "body": {"literal": {"integer": "int32"}}, "constraints": []}}],
"body": {
"let": {
"bindings": [
{
"name": "fieldExprs",
"term": {
"application": {
"function": {
"application": {
"function": {
"typeApplication": {
"body": {"typeApplication": {"body": {"variable": "hydra.core.lib.lists.map"}, "type": {"variable": "hydra.core.model.Field"}}},
"type": {"variable": "hydra.core.ast.Expr"}}},
"argument": {
"application": {
"function": {
"application": {"function": {"variable": "hydra.core.print.model.fieldExprAliased"}, "argument": {"variable": "fieldBudget"}}},
"argument": {"variable": "aliases"}}}}},
"argument": {"variable": "allFields"}}},
"typeScheme": {"variables": [], "body": {"list": {"variable": "hydra.core.ast.Expr"}}, "constraints": []}}],
"body": {
"let": {
"bindings": [
{
"name": "headExpr",
"term": {"application": {"function": {"variable": "hydra.core.serialization.cst"}, "argument": {"variable": "headStr"}}},
"typeScheme": {"variables": [], "body": {"variable": "hydra.core.ast.Expr"}, "constraints": []}}],
"body": {
"application": {
"function": {
"application": {
"function": {
"application": {
"function": {"variable": "hydra.core.serialization.ifx"},
"argument": {
"record": {
"typeName": "hydra.core.ast.Op",
"fields": [
{
"name": "symbol",
"term": {"application": {"function": {"variable": "hydra.core.serialization.sym"}, "argument": {"literal": {"string": ""}}}}},
{
"name": "padding",
"term": {
"record": {
"typeName": "hydra.core.ast.Padding",
"fields": [
{"name": "left", "term": {"inject": {"typeName": "hydra.core.ast.Ws", "field": {"name": "none", "term": "unit"}}}},
{"name": "right", "term": {"inject": {"typeName": "hydra.core.ast.Ws", "field": {"name": "none", "term": "unit"}}}}]}}},
{
"name": "precedence",
"term": {"wrap": {"typeName": "hydra.core.ast.Precedence", "body": {"literal": {"integer": {"int32": 0}}}}}},
{
"name": "associativity",
"term": {"inject": {"typeName": "hydra.core.ast.Associativity", "field": {"name": "none", "term": "unit"}}}}]}}}},
"argument": {"variable": "headExpr"}}},
"argument": {
"application": {
"function": {
"application": {
"function": {"application": {"function": {"variable": "hydra.core.serialization.chooseLayout"}, "argument": {"variable": "budget"}}},
"argument": {
"application": {
"function": {
"application": {
"function": {
"application": {
"function": {"variable": "hydra.core.serialization.curlyBracesList"},
"argument": {"typeApplication": {"body": {"optional": null}, "type": {"literal": "string"}}}}},
"argument": {"variable": "hydra.core.serialization.inlineStyle"}}},
"argument": {"variable": "fieldExprs"}}}}},
"argument": {
"application": {
"function": {
"application": {
"function": {
"application": {
"function": {"variable": "hydra.core.serialization.curlyBracesList"},
"argument": {"typeApplication": {"body": {"optional": null}, "type": {"literal": "string"}}}}},
"argument": {"variable": "hydra.core.serialization.halfBlockStyle"}}},
"argument": {"variable": "fieldExprs"}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}},
"annotation": {
"map": [
{
"key": {"variable": "description"},
"value": {
"literal": {
"string": "Show a case statement as a line-layout expression, shortening nominal references via the given import-alias map (#803)"}}}]}}}}},
{
"term": {
"name": "hydra.core.print.model.either",
"signature": {
"typeParameters": [{"name": "t0", "constraints": []}, {"name": "t1", "constraints": []}],
"parameters": [
{
"name": "arg0",
"type": {"function": {"domain": {"variable": "t0"}, "codomain": {"literal": "string"}}},
"isLazy": false},
{
"name": "arg1",
"type": {"function": {"domain": {"variable": "t1"}, "codomain": {"literal": "string"}}},
"isLazy": false},
{"name": "arg2", "type": {"either": {"left": {"variable": "t0"}, "right": {"variable": "t1"}}}, "isLazy": false}],
"result": {"type": {"literal": "string"}}},
"body": {
"typeLambda": {
"parameter": "t0",
"body": {
"typeLambda": {
"parameter": "t1",
"body": {
"annotated": {
"body": {
"lambda": {
"parameter": "showA",
"domain": {"function": {"domain": {"variable": "t0"}, "codomain": {"literal": "string"}}},
"body": {
"lambda": {
"parameter": "showB",
"domain": {"function": {"domain": {"variable": "t1"}, "codomain": {"literal": "string"}}},
"body": {
"lambda": {
"parameter": "e",
"domain": {"either": {"left": {"variable": "t0"}, "right": {"variable": "t1"}}},
"body": {
"application": {
"function": {
"application": {
"function": {
"application": {
"function": {
"typeApplication": {
"body": {
"typeApplication": {
"body": {"typeApplication": {"body": {"variable": "hydra.core.lib.eithers.either"}, "type": {"variable": "t0"}}},
"type": {"variable": "t1"}}},
"type": {"literal": "string"}}},
"argument": {
"lambda": {
"parameter": "a",
"domain": {"variable": "t0"},
"body": {
"application": {
"function": {
"application": {"function": {"variable": "hydra.core.lib.strings.concat2"}, "argument": {"literal": {"string": "left("}}}},
"argument": {
"application": {
"function": {
"application": {
"function": {"variable": "hydra.core.lib.strings.concat2"},
"argument": {"application": {"function": {"variable": "showA"}, "argument": {"variable": "a"}}}}},
"argument": {"literal": {"string": ")"}}}}}}}}}},
"argument": {
"lambda": {
"parameter": "b",
"domain": {"variable": "t1"},
"body": {
"application": {
"function": {
"application": {"function": {"variable": "hydra.core.lib.strings.concat2"}, "argument": {"literal": {"string": "right("}}}},
"argument": {
"application": {
"function": {
"application": {
"function": {"variable": "hydra.core.lib.strings.concat2"},
"argument": {"application": {"function": {"variable": "showB"}, "argument": {"variable": "b"}}}}},
"argument": {"literal": {"string": ")"}}}}}}}}}},
"argument": {"variable": "e"}}}}}}}}},
"annotation": {
"map": [
{
"key": {"variable": "description"},
"value": {"literal": {"string": "Show an Either value using given functions for left and right"}}}]}}}}}}}}},
{
"term": {
"name": "hydra.core.print.model.escapeBacktickChar",
"signature": {
"typeParameters": [],
"parameters": [{"name": "arg0", "type": {"literal": {"integer": "int32"}}, "isLazy": false}],
"result": {"type": {"literal": "string"}}},
"body": {
"annotated": {
"body": {
"lambda": {
"parameter": "c",
"domain": {"literal": {"integer": "int32"}},
"body": {
"let": {
"bindings": [
{
"name": "isChar",
"term": {
"lambda": {
"parameter": "code",
"domain": {"literal": {"integer": "int32"}},
"body": {
"application": {
"function": {
"application": {
"function": {"typeApplication": {"body": {"variable": "hydra.core.lib.equality.equal"}, "type": {"literal": {"integer": "int32"}}}},
"argument": {"variable": "c"}}},
"argument": {"variable": "code"}}}}},
"typeScheme": {
"variables": [],
"body": {"function": {"domain": {"literal": {"integer": "int32"}}, "codomain": {"literal": "boolean"}}},
"constraints": []}}],
"body": {
"application": {
"function": {
"application": {
"function": {
"application": {
"function": {"typeApplication": {"body": {"variable": "hydra.core.lib.logic.ifElse"}, "type": {"literal": "string"}}},
"argument": {"application": {"function": {"variable": "isChar"}, "argument": {"literal": {"integer": {"int32": 96}}}}}}},
"argument": {"literal": {"string": "\\`"}}}},
"argument": {
"application": {
"function": {
"application": {
"function": {
"application": {
"function": {"typeApplication": {"body": {"variable": "hydra.core.lib.logic.ifElse"}, "type": {"literal": "string"}}},
"argument": {"application": {"function": {"variable": "isChar"}, "argument": {"literal": {"integer": {"int32": 92}}}}}}},
"argument": {"literal": {"string": "\\\\"}}}},
"argument": {
"application": {
"function": {
"application": {
"function": {
"application": {
"function": {"typeApplication": {"body": {"variable": "hydra.core.lib.logic.ifElse"}, "type": {"literal": "string"}}},
"argument": {"application": {"function": {"variable": "isChar"}, "argument": {"literal": {"integer": {"int32": 8}}}}}}},
"argument": {"literal": {"string": "\\b"}}}},
"argument": {
"application": {
"function": {
"application": {
"function": {
"application": {
"function": {"typeApplication": {"body": {"variable": "hydra.core.lib.logic.ifElse"}, "type": {"literal": "string"}}},
"argument": {"application": {"function": {"variable": "isChar"}, "argument": {"literal": {"integer": {"int32": 12}}}}}}},
"argument": {"literal": {"string": "\\f"}}}},
"argument": {
"application": {
"function": {
"application": {
"function": {
"application": {
"function": {"typeApplication": {"body": {"variable": "hydra.core.lib.logic.ifElse"}, "type": {"literal": "string"}}},
"argument": {"application": {"function": {"variable": "isChar"}, "argument": {"literal": {"integer": {"int32": 10}}}}}}},
"argument": {"literal": {"string": "\\n"}}}},
"argument": {
"application": {
"function": {
"application": {
"function": {
"application": {
"function": {"typeApplication": {"body": {"variable": "hydra.core.lib.logic.ifElse"}, "type": {"literal": "string"}}},
"argument": {"application": {"function": {"variable": "isChar"}, "argument": {"literal": {"integer": {"int32": 13}}}}}}},
"argument": {"literal": {"string": "\\r"}}}},
"argument": {
"application": {
"function": {
"application": {
"function": {
"application": {
"function": {"typeApplication": {"body": {"variable": "hydra.core.lib.logic.ifElse"}, "type": {"literal": "string"}}},
"argument": {"application": {"function": {"variable": "isChar"}, "argument": {"literal": {"integer": {"int32": 9}}}}}}},
"argument": {"literal": {"string": "\\t"}}}},
"argument": {
"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.lt"}, "type": {"literal": {"integer": "int32"}}}},
"argument": {"variable": "c"}}},
"argument": {"literal": {"integer": {"int32": 32}}}}}}},
"argument": {
"application": {
"function": {"variable": "hydra.core.lib.strings.concat"},
"argument": {
"list": [
{"literal": {"string": "\\u00"}},
{"application": {"function": {"variable": "hydra.core.print.model.toHex2"}, "argument": {"variable": "c"}}}]}}}}},
"argument": {
"application": {"function": {"variable": "hydra.core.lib.strings.fromList"}, "argument": {"list": [{"variable": "c"}]}}}}}}}}}}}}}}}}}}}}}}},
"annotation": {
"map": [
{
"key": {"variable": "description"},
"value": {"literal": {"string": "Escape a single code point for backticked-name content."}}}]}}}}},
{
"term": {
"name": "hydra.core.print.model.escapeStringChar",
"signature": {
"typeParameters": [],
"parameters": [{"name": "arg0", "type": {"literal": {"integer": "int32"}}, "isLazy": false}],
"result": {"type": {"literal": "string"}}},
"body": {
"annotated": {
"body": {
"lambda": {
"parameter": "c",
"domain": {"literal": {"integer": "int32"}},
"body": {
"let": {
"bindings": [
{
"name": "isChar",
"term": {
"lambda": {
"parameter": "code",
"domain": {"literal": {"integer": "int32"}},
"body": {
"application": {
"function": {
"application": {
"function": {"typeApplication": {"body": {"variable": "hydra.core.lib.equality.equal"}, "type": {"literal": {"integer": "int32"}}}},
"argument": {"variable": "c"}}},
"argument": {"variable": "code"}}}}},
"typeScheme": {
"variables": [],
"body": {"function": {"domain": {"literal": {"integer": "int32"}}, "codomain": {"literal": "boolean"}}},
"constraints": []}}],
"body": {
"application": {
"function": {
"application": {
"function": {
"application": {
"function": {"typeApplication": {"body": {"variable": "hydra.core.lib.logic.ifElse"}, "type": {"literal": "string"}}},
"argument": {"application": {"function": {"variable": "isChar"}, "argument": {"literal": {"integer": {"int32": 34}}}}}}},
"argument": {"literal": {"string": "\\\""}}}},
"argument": {
"application": {
"function": {
"application": {
"function": {
"application": {
"function": {"typeApplication": {"body": {"variable": "hydra.core.lib.logic.ifElse"}, "type": {"literal": "string"}}},
"argument": {"application": {"function": {"variable": "isChar"}, "argument": {"literal": {"integer": {"int32": 92}}}}}}},
"argument": {"literal": {"string": "\\\\"}}}},
"argument": {
"application": {
"function": {
"application": {
"function": {
"application": {
"function": {"typeApplication": {"body": {"variable": "hydra.core.lib.logic.ifElse"}, "type": {"literal": "string"}}},
"argument": {"application": {"function": {"variable": "isChar"}, "argument": {"literal": {"integer": {"int32": 8}}}}}}},
"argument": {"literal": {"string": "\\b"}}}},
"argument": {
"application": {
"function": {
"application": {
"function": {
"application": {
"function": {"typeApplication": {"body": {"variable": "hydra.core.lib.logic.ifElse"}, "type": {"literal": "string"}}},
"argument": {"application": {"function": {"variable": "isChar"}, "argument": {"literal": {"integer": {"int32": 12}}}}}}},
"argument": {"literal": {"string": "\\f"}}}},
"argument": {
"application": {
"function": {
"application": {
"function": {
"application": {
"function": {"typeApplication": {"body": {"variable": "hydra.core.lib.logic.ifElse"}, "type": {"literal": "string"}}},
"argument": {"application": {"function": {"variable": "isChar"}, "argument": {"literal": {"integer": {"int32": 10}}}}}}},
"argument": {"literal": {"string": "\\n"}}}},
"argument": {
"application": {
"function": {
"application": {
"function": {
"application": {
"function": {"typeApplication": {"body": {"variable": "hydra.core.lib.logic.ifElse"}, "type": {"literal": "string"}}},
"argument": {"application": {"function": {"variable": "isChar"}, "argument": {"literal": {"integer": {"int32": 13}}}}}}},
"argument": {"literal": {"string": "\\r"}}}},
"argument": {
"application": {
"function": {
"application": {
"function": {
"application": {
"function": {"typeApplication": {"body": {"variable": "hydra.core.lib.logic.ifElse"}, "type": {"literal": "string"}}},
"argument": {"application": {"function": {"variable": "isChar"}, "argument": {"literal": {"integer": {"int32": 9}}}}}}},
"argument": {"literal": {"string": "\\t"}}}},
"argument": {
"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.lt"}, "type": {"literal": {"integer": "int32"}}}},
"argument": {"variable": "c"}}},
"argument": {"literal": {"integer": {"int32": 32}}}}}}},
"argument": {
"application": {
"function": {"variable": "hydra.core.lib.strings.concat"},
"argument": {
"list": [
{"literal": {"string": "\\u00"}},
{"application": {"function": {"variable": "hydra.core.print.model.toHex2"}, "argument": {"variable": "c"}}}]}}}}},
"argument": {
"application": {"function": {"variable": "hydra.core.lib.strings.fromList"}, "argument": {"list": [{"variable": "c"}]}}}}}}}}}}}}}}}}}}}}}}},
"annotation": {
"map": [
{
"key": {"variable": "description"},
"value": {"literal": {"string": "Escape a single code point for double-quoted string content."}}}]}}}}},
{
"term": {
"name": "hydra.core.print.model.field",
"signature": {
"typeParameters": [],
"parameters": [
{
"name": "arg0",
"type": {"map": {"keys": {"variable": "hydra.core.packaging.ModuleName"}, "values": {"literal": "string"}}},
"isLazy": false},
{"name": "arg1", "type": {"variable": "hydra.core.model.Field"}, "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": "field",
"domain": {"variable": "hydra.core.model.Field"},
"body": {
"let": {
"bindings": [
{
"name": "fname",
"term": {
"application": {
"function": {"variable": "hydra.core.print.model.printName"},
"argument": {
"application": {
"function": {"project": {"typeName": "hydra.core.model.Field", "fieldName": "name"}},
"argument": {"variable": "field"}}}}},
"typeScheme": {"variables": [], "body": {"literal": "string"}, "constraints": []}}],
"body": {
"let": {
"bindings": [
{
"name": "fterm",
"term": {
"application": {
"function": {"project": {"typeName": "hydra.core.model.Field", "fieldName": "term"}},
"argument": {"variable": "field"}}},
"typeScheme": {"variables": [], "body": {"variable": "hydra.core.model.Term"}, "constraints": []}}],
"body": {
"application": {
"function": {"variable": "hydra.core.lib.strings.concat"},
"argument": {
"list": [
{"variable": "fname"},
{"literal": {"string": " = "}},
{
"application": {
"function": {"application": {"function": {"variable": "hydra.core.print.model.termAliased"}, "argument": {"variable": "aliases"}}},
"argument": {"variable": "fterm"}}}]}}}}}}}}}}},
"annotation": {
"map": [
{
"key": {"variable": "description"},
"value": {
"literal": {"string": "Show a field as a string, shortening nominal references in its term via the given alias map (#803)"}}}]}}}}},
{
"term": {
"name": "hydra.core.print.model.fieldExprAliased",
"signature": {
"typeParameters": [],
"parameters": [
{"name": "arg0", "type": {"literal": {"integer": "int32"}}, "isLazy": false},
{
"name": "arg1",
"type": {"map": {"keys": {"variable": "hydra.core.packaging.ModuleName"}, "values": {"literal": "string"}}},
"isLazy": false},
{"name": "arg2", "type": {"variable": "hydra.core.model.Field"}, "isLazy": false}],
"result": {"type": {"variable": "hydra.core.ast.Expr"}}},
"body": {
"annotated": {
"body": {
"lambda": {
"parameter": "budget",
"domain": {"literal": {"integer": "int32"}},
"body": {
"lambda": {
"parameter": "aliases",
"domain": {"map": {"keys": {"variable": "hydra.core.packaging.ModuleName"}, "values": {"literal": "string"}}},
"body": {
"lambda": {
"parameter": "field",
"domain": {"variable": "hydra.core.model.Field"},
"body": {
"let": {
"bindings": [
{
"name": "fname",
"term": {
"application": {
"function": {"variable": "hydra.core.print.model.printName"},
"argument": {
"application": {
"function": {"project": {"typeName": "hydra.core.model.Field", "fieldName": "name"}},
"argument": {"variable": "field"}}}}},
"typeScheme": {"variables": [], "body": {"literal": "string"}, "constraints": []}}],
"body": {
"let": {
"bindings": [
{
"name": "fterm",
"term": {
"application": {
"function": {"project": {"typeName": "hydra.core.model.Field", "fieldName": "term"}},
"argument": {"variable": "field"}}},
"typeScheme": {"variables": [], "body": {"variable": "hydra.core.model.Term"}, "constraints": []}}],
"body": {
"let": {
"bindings": [
{
"name": "valueBudget",
"term": {
"application": {
"function": {
"application": {
"function": {"typeApplication": {"body": {"variable": "hydra.core.lib.math.sub"}, "type": {"literal": {"integer": "int32"}}}},
"argument": {"variable": "budget"}}},
"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": "fname"}}}}},
"argument": {"literal": {"integer": {"int32": 3}}}}}}},
"typeScheme": {"variables": [], "body": {"literal": {"integer": "int32"}}, "constraints": []}}],
"body": {
"let": {
"bindings": [
{
"name": "valueExpr",
"term": {
"application": {
"function": {
"application": {
"function": {
"application": {
"function": {
"application": {"function": {"variable": "hydra.core.print.model.termExprAtPrecBudget"}, "argument": {"variable": "valueBudget"}}},
"argument": {"variable": "aliases"}}},
"argument": {"literal": {"integer": {"int32": 0}}}}},
"argument": {"variable": "fterm"}}},
"typeScheme": {"variables": [], "body": {"variable": "hydra.core.ast.Expr"}, "constraints": []}}],
"body": {
"let": {
"bindings": [
{
"name": "eqOp",
"term": {
"record": {
"typeName": "hydra.core.ast.Op",
"fields": [
{
"name": "symbol",
"term": {"application": {"function": {"variable": "hydra.core.serialization.sym"}, "argument": {"literal": {"string": "="}}}}},
{
"name": "padding",
"term": {
"record": {
"typeName": "hydra.core.ast.Padding",
"fields": [
{"name": "left", "term": {"inject": {"typeName": "hydra.core.ast.Ws", "field": {"name": "space", "term": "unit"}}}},
{"name": "right", "term": {"inject": {"typeName": "hydra.core.ast.Ws", "field": {"name": "space", "term": "unit"}}}}]}}},
{
"name": "precedence",
"term": {"wrap": {"typeName": "hydra.core.ast.Precedence", "body": {"literal": {"integer": {"int32": 0}}}}}},
{
"name": "associativity",
"term": {"inject": {"typeName": "hydra.core.ast.Associativity", "field": {"name": "none", "term": "unit"}}}}]}},
"typeScheme": {"variables": [], "body": {"variable": "hydra.core.ast.Op"}, "constraints": []}}],
"body": {
"application": {
"function": {
"application": {
"function": {
"application": {
"function": {"typeApplication": {"body": {"variable": "hydra.core.lib.logic.ifElse"}, "type": {"variable": "hydra.core.ast.Expr"}}},
"argument": {"application": {"function": {"variable": "hydra.core.print.model.isBracketedTerm"}, "argument": {"variable": "fterm"}}}}},
"argument": {
"application": {
"function": {
"application": {
"function": {"application": {"function": {"variable": "hydra.core.serialization.ifx"}, "argument": {"variable": "eqOp"}}},
"argument": {"application": {"function": {"variable": "hydra.core.serialization.cst"}, "argument": {"variable": "fname"}}}}},
"argument": {"variable": "valueExpr"}}}}},
"argument": {
"application": {
"function": {
"application": {
"function": {"variable": "hydra.core.serialization.indentSubsequentLines"},
"argument": {"variable": "hydra.core.serialization.doubleSpace"}}},
"argument": {
"application": {
"function": {
"application": {
"function": {"application": {"function": {"variable": "hydra.core.serialization.ifx"}, "argument": {"variable": "eqOp"}}},
"argument": {"application": {"function": {"variable": "hydra.core.serialization.cst"}, "argument": {"variable": "fname"}}}}},
"argument": {"variable": "valueExpr"}}}}}}}}}}}}}}}}}}}}}}},
"annotation": {
"map": [
{
"key": {"variable": "description"},
"value": {
"literal": {
"string": "Show a field as a line-layout expression, shortening nominal references in its term via the given alias map (#803)"}}}]}}}}},
{
"term": {
"name": "hydra.core.print.model.fieldTermIsUnit",
"signature": {
"typeParameters": [],
"parameters": [{"name": "arg0", "type": {"variable": "hydra.core.model.Term"}, "isLazy": false}],
"result": {"type": {"literal": "boolean"}}},
"body": {
"annotated": {
"body": {
"lambda": {
"parameter": "t",
"domain": {"variable": "hydra.core.model.Term"},
"body": {
"application": {
"function": {
"cases": {
"typeName": "hydra.core.model.Term",
"default": {"literal": {"boolean": false}},
"cases": [{"name": "unit", "handler": {"lambda": {"parameter": "_", "domain": "unit", "body": {"literal": {"boolean": true}}}}}]}},
"argument": {"variable": "t"}}}}},
"annotation": {
"map": [
{
"key": {"variable": "description"},
"value": {"literal": {"string": "True iff a term is the unit term (for bareword unit-field sugar, #809)"}}}]}}}}},
{
"term": {
"name": "hydra.core.print.model.fieldType",
"signature": {
"typeParameters": [],
"parameters": [
{
"name": "arg0",
"type": {"map": {"keys": {"variable": "hydra.core.packaging.ModuleName"}, "values": {"literal": "string"}}},
"isLazy": false},
{"name": "arg1", "type": {"variable": "hydra.core.model.FieldType"}, "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": "ft",
"domain": {"variable": "hydra.core.model.FieldType"},
"body": {
"let": {
"bindings": [
{
"name": "fname",
"term": {
"application": {
"function": {"variable": "hydra.core.print.model.printName"},
"argument": {
"application": {
"function": {"project": {"typeName": "hydra.core.model.FieldType", "fieldName": "name"}},
"argument": {"variable": "ft"}}}}},
"typeScheme": {"variables": [], "body": {"literal": "string"}, "constraints": []}}],
"body": {
"let": {
"bindings": [
{
"name": "ftyp",
"term": {
"application": {
"function": {"project": {"typeName": "hydra.core.model.FieldType", "fieldName": "type"}},
"argument": {"variable": "ft"}}},
"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": "ftyp"}}},
"typeScheme": {
"variables": [],
"body": {"pair": {"first": {"optional": {"literal": "string"}}, "second": {"variable": "hydra.core.model.Type"}}},
"constraints": []}}],
"body": {
"application": {
"function": {"variable": "hydra.core.lib.strings.concat"},
"argument": {
"list": [
{"variable": "fname"},
{"literal": {"string": ": "}},
{
"application": {
"function": {"application": {"function": {"variable": "hydra.core.print.model.typeAliased"}, "argument": {"variable": "aliases"}}},
"argument": {
"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"}}}}}]}}}}}}}}}}}}},
"annotation": {
"map": [
{
"key": {"variable": "description"},
"value": {
"literal": {"string": "Show a field type as a string, shortening nominal references in its type via the given alias map (#803)"}}}]}}}}},
{
"term": {
"name": "hydra.core.print.model.fieldTypeExpr",
"signature": {
"typeParameters": [],
"parameters": [
{
"name": "arg0",
"type": {"map": {"keys": {"variable": "hydra.core.packaging.ModuleName"}, "values": {"literal": "string"}}},
"isLazy": false},
{"name": "arg1", "type": {"variable": "hydra.core.model.FieldType"}, "isLazy": false}],
"result": {"type": {"variable": "hydra.core.ast.Expr"}}},
"body": {
"annotated": {
"body": {
"lambda": {
"parameter": "aliases",
"domain": {"map": {"keys": {"variable": "hydra.core.packaging.ModuleName"}, "values": {"literal": "string"}}},
"body": {
"lambda": {
"parameter": "ft",
"domain": {"variable": "hydra.core.model.FieldType"},
"body": {
"let": {
"bindings": [
{
"name": "ftyp",
"term": {
"application": {
"function": {"project": {"typeName": "hydra.core.model.FieldType", "fieldName": "type"}},
"argument": {"variable": "ft"}}},
"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": "ftyp"}}},
"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": "fname",
"term": {
"application": {
"function": {"variable": "hydra.core.print.model.printName"},
"argument": {
"application": {
"function": {"project": {"typeName": "hydra.core.model.FieldType", "fieldName": "name"}},
"argument": {"variable": "ft"}}}}},
"typeScheme": {"variables": [], "body": {"literal": "string"}, "constraints": []}}],
"body": {
"let": {
"bindings": [
{
"name": "declLine",
"term": {
"application": {
"function": {"variable": "hydra.core.lib.strings.concat"},
"argument": {
"list": [
{"variable": "fname"},
{"literal": {"string": ": "}},
{
"application": {
"function": {"application": {"function": {"variable": "hydra.core.print.model.typeAliased"}, "argument": {"variable": "aliases"}}},
"argument": {
"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"}}}}}]}}},
"typeScheme": {"variables": [], "body": {"literal": "string"}, "constraints": []}}],
"body": {
"application": {
"function": {"variable": "hydra.core.serialization.cst"},
"argument": {
"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": "declLine"}}},
"argument": {
"lambda": {
"parameter": "d",
"domain": {"literal": "string"},
"body": {
"application": {
"function": {"variable": "hydra.core.lib.strings.concat"},
"argument": {"list": [{"literal": {"string": "## "}}, {"variable": "d"}, {"literal": {"string": "\n"}}, {"variable": "declLine"}]}}}}}}}}}}}}}}}}}}}}}}},
"annotation": {
"map": [
{
"key": {"variable": "description"},
"value": {
"literal": {
"string": "Show a field type as a block-layout expression, with its description (if any) as a preceding '##' comment line"}}}]}}}}},
{
"term": {
"name": "hydra.core.print.model.fields",
"signature": {
"typeParameters": [],
"parameters": [
{
"name": "arg0",
"type": {"map": {"keys": {"variable": "hydra.core.packaging.ModuleName"}, "values": {"literal": "string"}}},
"isLazy": false},
{"name": "arg1", "type": {"list": {"variable": "hydra.core.model.Field"}}, "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": "flds",
"domain": {"list": {"variable": "hydra.core.model.Field"}},
"body": {
"let": {
"bindings": [
{
"name": "fieldStrs",
"term": {
"application": {
"function": {
"application": {
"function": {
"typeApplication": {
"body": {"typeApplication": {"body": {"variable": "hydra.core.lib.lists.map"}, "type": {"variable": "hydra.core.model.Field"}}},
"type": {"literal": "string"}}},
"argument": {"application": {"function": {"variable": "hydra.core.print.model.field"}, "argument": {"variable": "aliases"}}}}},
"argument": {"variable": "flds"}}},
"typeScheme": {"variables": [], "body": {"list": {"literal": "string"}}, "constraints": []}}],
"body": {
"application": {
"function": {"variable": "hydra.core.lib.strings.concat"},
"argument": {
"list": [
{"literal": {"string": "{"}},
{
"application": {
"function": {"application": {"function": {"variable": "hydra.core.lib.strings.join"}, "argument": {"literal": {"string": ", "}}}},
"argument": {"variable": "fieldStrs"}}},
{"literal": {"string": "}"}}]}}}}}}}}},
"annotation": {
"map": [
{
"key": {"variable": "description"},
"value": {
"literal": {"string": "Show a list of fields as a string, shortening nominal references via the given alias map (#803)"}}}]}}}}},
{
"term": {
"name": "hydra.core.print.model.float",
"signature": {
"typeParameters": [],
"parameters": [{"name": "arg0", "type": {"variable": "hydra.core.model.FloatValue"}, "isLazy": false}],
"result": {"type": {"literal": "string"}}},
"body": {
"annotated": {
"body": {
"lambda": {
"parameter": "fv",
"domain": {"variable": "hydra.core.model.FloatValue"},
"body": {
"application": {
"function": {
"cases": {
"typeName": "hydra.core.model.FloatValue",
"cases": [
{
"name": "float32",
"handler": {
"lambda": {
"parameter": "v",
"domain": {"literal": {"float": "float32"}},
"body": {
"application": {
"function": {
"application": {
"function": {"variable": "hydra.core.lib.strings.concat2"},
"argument": {"application": {"function": {"variable": "hydra.core.lib.literals.printFloat32"}, "argument": {"variable": "v"}}}}},
"argument": {"literal": {"string": ":float32"}}}}}}},
{
"name": "float64",
"handler": {
"lambda": {
"parameter": "v",
"domain": {"literal": {"float": "float64"}},
"body": {
"application": {
"function": {
"application": {
"function": {"variable": "hydra.core.lib.strings.concat2"},
"argument": {"application": {"function": {"variable": "hydra.core.lib.literals.printFloat64"}, "argument": {"variable": "v"}}}}},
"argument": {"literal": {"string": ":float64"}}}}}}}]}},
"argument": {"variable": "fv"}}}}},
"annotation": {"map": [{"key": {"variable": "description"}, "value": {"literal": {"string": "Show a float value as a string"}}}]}}}}},
{
"term": {
"name": "hydra.core.print.model.floatType",
"signature": {
"typeParameters": [],
"parameters": [{"name": "arg0", "type": {"variable": "hydra.core.model.FloatType"}, "isLazy": false}],
"result": {"type": {"literal": "string"}}},
"body": {
"annotated": {
"body": {
"lambda": {
"parameter": "ft",
"domain": {"variable": "hydra.core.model.FloatType"},
"body": {
"application": {
"function": {
"cases": {
"typeName": "hydra.core.model.FloatType",
"cases": [
{
"name": "float32",
"handler": {"lambda": {"parameter": "_", "domain": "unit", "body": {"literal": {"string": "float32"}}}}},
{
"name": "float64",
"handler": {"lambda": {"parameter": "_", "domain": "unit", "body": {"literal": {"string": "float64"}}}}}]}},
"argument": {"variable": "ft"}}}}},
"annotation": {"map": [{"key": {"variable": "description"}, "value": {"literal": {"string": "Show a float type as a string"}}}]}}}}},
{
"term": {
"name": "hydra.core.print.model.gatherLambdaBinders",
"signature": {
"typeParameters": [],
"parameters": [
{
"name": "arg0",
"type": {
"list": {
"pair": {"first": {"variable": "hydra.core.model.Name"}, "second": {"optional": {"variable": "hydra.core.model.Type"}}}}},
"isLazy": false},
{"name": "arg1", "type": {"variable": "hydra.core.model.Term"}, "isLazy": false}],
"result": {
"type": {
"pair": {
"first": {
"list": {
"pair": {"first": {"variable": "hydra.core.model.Name"}, "second": {"optional": {"variable": "hydra.core.model.Type"}}}}},
"second": {"variable": "hydra.core.model.Term"}}}}},
"body": {
"annotated": {
"body": {
"lambda": {
"parameter": "prev",
"domain": {
"list": {
"pair": {"first": {"variable": "hydra.core.model.Name"}, "second": {"optional": {"variable": "hydra.core.model.Type"}}}}},
"body": {
"lambda": {
"parameter": "t",
"domain": {"variable": "hydra.core.model.Term"},
"body": {
"application": {
"function": {
"cases": {
"typeName": "hydra.core.model.Term",
"default": {
"typeApplication": {
"body": {
"typeApplication": {
"body": {
"pair": {
"first": {
"application": {
"function": {
"typeApplication": {
"body": {"variable": "hydra.core.lib.lists.reverse"},
"type": {
"pair": {"first": {"variable": "hydra.core.model.Name"}, "second": {"optional": {"variable": "hydra.core.model.Type"}}}}}},
"argument": {"variable": "prev"}}},
"second": {"variable": "t"}}},
"type": {
"list": {
"pair": {"first": {"variable": "hydra.core.model.Name"}, "second": {"optional": {"variable": "hydra.core.model.Type"}}}}}}},
"type": {"variable": "hydra.core.model.Term"}}},
"cases": [
{
"name": "lambda",
"handler": {
"lambda": {
"parameter": "l",
"domain": {"variable": "hydra.core.model.Lambda"},
"body": {
"let": {
"bindings": [
{
"name": "v",
"term": {
"application": {
"function": {"project": {"typeName": "hydra.core.model.Lambda", "fieldName": "parameter"}},
"argument": {"variable": "l"}}},
"typeScheme": {"variables": [], "body": {"variable": "hydra.core.model.Name"}, "constraints": []}}],
"body": {
"let": {
"bindings": [
{
"name": "mt",
"term": {
"application": {"function": {"project": {"typeName": "hydra.core.model.Lambda", "fieldName": "domain"}}, "argument": {"variable": "l"}}},
"typeScheme": {"variables": [], "body": {"optional": {"variable": "hydra.core.model.Type"}}, "constraints": []}}],
"body": {
"let": {
"bindings": [
{
"name": "body",
"term": {
"application": {"function": {"project": {"typeName": "hydra.core.model.Lambda", "fieldName": "body"}}, "argument": {"variable": "l"}}},
"typeScheme": {"variables": [], "body": {"variable": "hydra.core.model.Term"}, "constraints": []}}],
"body": {
"application": {
"function": {
"application": {
"function": {"variable": "hydra.core.print.model.gatherLambdaBinders"},
"argument": {
"application": {
"function": {
"application": {
"function": {
"typeApplication": {
"body": {"variable": "hydra.core.lib.lists.cons"},
"type": {
"pair": {"first": {"variable": "hydra.core.model.Name"}, "second": {"optional": {"variable": "hydra.core.model.Type"}}}}}},
"argument": {
"typeApplication": {
"body": {
"typeApplication": {
"body": {"pair": {"first": {"variable": "v"}, "second": {"variable": "mt"}}},
"type": {"variable": "hydra.core.model.Name"}}},
"type": {"optional": {"variable": "hydra.core.model.Type"}}}}}},
"argument": {"variable": "prev"}}}}},
"argument": {"variable": "body"}}}}}}}}}}}}]}},
"argument": {"variable": "t"}}}}}}},
"annotation": {
"map": [
{
"key": {"variable": "description"},
"value": {"literal": {"string": "Gather a chain of directly-nested Term.lambda binders, returning (binders, innermost body)"}}}]}}}}},
{
"term": {
"name": "hydra.core.print.model.gatherLetChain",
"signature": {
"typeParameters": [],
"parameters": [
{"name": "arg0", "type": {"list": {"list": {"variable": "hydra.core.model.Binding"}}}, "isLazy": false},
{"name": "arg1", "type": {"variable": "hydra.core.model.Term"}, "isLazy": false}],
"result": {
"type": {
"pair": {"first": {"list": {"list": {"variable": "hydra.core.model.Binding"}}}, "second": {"variable": "hydra.core.model.Term"}}}}},
"body": {
"annotated": {
"body": {
"lambda": {
"parameter": "prev",
"domain": {"list": {"list": {"variable": "hydra.core.model.Binding"}}},
"body": {
"lambda": {
"parameter": "t",
"domain": {"variable": "hydra.core.model.Term"},
"body": {
"application": {
"function": {
"cases": {
"typeName": "hydra.core.model.Term",
"default": {
"typeApplication": {
"body": {
"typeApplication": {
"body": {
"pair": {
"first": {
"application": {
"function": {
"typeApplication": {"body": {"variable": "hydra.core.lib.lists.reverse"}, "type": {"list": {"variable": "hydra.core.model.Binding"}}}},
"argument": {"variable": "prev"}}},
"second": {"variable": "t"}}},
"type": {"list": {"list": {"variable": "hydra.core.model.Binding"}}}}},
"type": {"variable": "hydra.core.model.Term"}}},
"cases": [
{
"name": "let",
"handler": {
"lambda": {
"parameter": "l",
"domain": {"variable": "hydra.core.model.Let"},
"body": {
"let": {
"bindings": [
{
"name": "bindings",
"term": {
"application": {"function": {"project": {"typeName": "hydra.core.model.Let", "fieldName": "bindings"}}, "argument": {"variable": "l"}}},
"typeScheme": {"variables": [], "body": {"list": {"variable": "hydra.core.model.Binding"}}, "constraints": []}}],
"body": {
"let": {
"bindings": [
{
"name": "body",
"term": {
"application": {"function": {"project": {"typeName": "hydra.core.model.Let", "fieldName": "body"}}, "argument": {"variable": "l"}}},
"typeScheme": {"variables": [], "body": {"variable": "hydra.core.model.Term"}, "constraints": []}}],
"body": {
"application": {
"function": {
"application": {
"function": {"variable": "hydra.core.print.model.gatherLetChain"},
"argument": {
"application": {
"function": {
"application": {
"function": {
"typeApplication": {"body": {"variable": "hydra.core.lib.lists.cons"}, "type": {"list": {"variable": "hydra.core.model.Binding"}}}},
"argument": {"variable": "bindings"}}},
"argument": {"variable": "prev"}}}}},
"argument": {"variable": "body"}}}}}}}}}}]}},
"argument": {"variable": "t"}}}}}}},
"annotation": {
"map": [
{
"key": {"variable": "description"},
"value": {"literal": {"string": "Gather a chain of directly-nested Term.let_ links, returning (binding-groups, innermost body)"}}}]}}}}},
{
"term": {
"name": "hydra.core.print.model.gatherTypeLambdaBinders",
"signature": {
"typeParameters": [],
"parameters": [
{"name": "arg0", "type": {"list": {"variable": "hydra.core.model.Name"}}, "isLazy": false},
{"name": "arg1", "type": {"variable": "hydra.core.model.Term"}, "isLazy": false}],
"result": {
"type": {"pair": {"first": {"list": {"variable": "hydra.core.model.Name"}}, "second": {"variable": "hydra.core.model.Term"}}}}},
"body": {
"annotated": {
"body": {
"lambda": {
"parameter": "prev",
"domain": {"list": {"variable": "hydra.core.model.Name"}},
"body": {
"lambda": {
"parameter": "t",
"domain": {"variable": "hydra.core.model.Term"},
"body": {
"application": {
"function": {
"cases": {
"typeName": "hydra.core.model.Term",
"default": {
"typeApplication": {
"body": {
"typeApplication": {
"body": {
"pair": {
"first": {
"application": {
"function": {
"typeApplication": {"body": {"variable": "hydra.core.lib.lists.reverse"}, "type": {"variable": "hydra.core.model.Name"}}},
"argument": {"variable": "prev"}}},
"second": {"variable": "t"}}},
"type": {"list": {"variable": "hydra.core.model.Name"}}}},
"type": {"variable": "hydra.core.model.Term"}}},
"cases": [
{
"name": "typeLambda",
"handler": {
"lambda": {
"parameter": "ta",
"domain": {"variable": "hydra.core.model.TypeLambda"},
"body": {
"let": {
"bindings": [
{
"name": "v",
"term": {
"application": {
"function": {"project": {"typeName": "hydra.core.model.TypeLambda", "fieldName": "parameter"}},
"argument": {"variable": "ta"}}},
"typeScheme": {"variables": [], "body": {"variable": "hydra.core.model.Name"}, "constraints": []}}],
"body": {
"let": {
"bindings": [
{
"name": "body",
"term": {
"application": {
"function": {"project": {"typeName": "hydra.core.model.TypeLambda", "fieldName": "body"}},
"argument": {"variable": "ta"}}},
"typeScheme": {"variables": [], "body": {"variable": "hydra.core.model.Term"}, "constraints": []}}],
"body": {
"application": {
"function": {
"application": {
"function": {"variable": "hydra.core.print.model.gatherTypeLambdaBinders"},
"argument": {
"application": {
"function": {
"application": {
"function": {"typeApplication": {"body": {"variable": "hydra.core.lib.lists.cons"}, "type": {"variable": "hydra.core.model.Name"}}},
"argument": {"variable": "v"}}},
"argument": {"variable": "prev"}}}}},
"argument": {"variable": "body"}}}}}}}}}}]}},
"argument": {"variable": "t"}}}}}}},
"annotation": {
"map": [
{
"key": {"variable": "description"},
"value": {
"literal": {"string": "Gather a chain of directly-nested Term.typeLambda binders, returning (binders, innermost body)"}}}]}}}}},
{
"term": {
"name": "hydra.core.print.model.hexDigit",
"signature": {
"typeParameters": [],
"parameters": [{"name": "arg0", "type": {"literal": {"integer": "int32"}}, "isLazy": false}],
"result": {"type": {"literal": "string"}}},
"body": {
"annotated": {
"body": {
"lambda": {
"parameter": "n",
"domain": {"literal": {"integer": "int32"}},
"body": {
"application": {
"function": {
"application": {
"function": {"typeApplication": {"body": {"variable": "hydra.core.lib.optionals.withDefault"}, "type": {"literal": "string"}}},
"argument": {"literal": {"string": "0"}}}},
"argument": {
"application": {
"function": {
"application": {
"function": {"typeApplication": {"body": {"variable": "hydra.core.lib.lists.at"}, "type": {"literal": "string"}}},
"argument": {"variable": "n"}}},
"argument": {
"list": [
{"literal": {"string": "0"}},
{"literal": {"string": "1"}},
{"literal": {"string": "2"}},
{"literal": {"string": "3"}},
{"literal": {"string": "4"}},
{"literal": {"string": "5"}},
{"literal": {"string": "6"}},
{"literal": {"string": "7"}},
{"literal": {"string": "8"}},
{"literal": {"string": "9"}},
{"literal": {"string": "a"}},
{"literal": {"string": "b"}},
{"literal": {"string": "c"}},
{"literal": {"string": "d"}},
{"literal": {"string": "e"}},
{"literal": {"string": "f"}}]}}}}}}},
"annotation": {
"map": [
{
"key": {"variable": "description"},
"value": {"literal": {"string": "Look up a hex digit (0-15) as a lowercase hex character."}}}]}}}}},
{
"term": {
"name": "hydra.core.print.model.injection",
"signature": {
"typeParameters": [],
"parameters": [
{
"name": "arg0",
"type": {"map": {"keys": {"variable": "hydra.core.packaging.ModuleName"}, "values": {"literal": "string"}}},
"isLazy": false},
{"name": "arg1", "type": {"variable": "hydra.core.model.Injection"}, "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": "inj",
"domain": {"variable": "hydra.core.model.Injection"},
"body": {
"let": {
"bindings": [
{
"name": "tname",
"term": {
"application": {
"function": {"project": {"typeName": "hydra.core.model.Injection", "fieldName": "typeName"}},
"argument": {"variable": "inj"}}},
"typeScheme": {"variables": [], "body": {"variable": "hydra.core.model.Name"}, "constraints": []}}],
"body": {
"let": {
"bindings": [
{
"name": "f",
"term": {
"application": {
"function": {"project": {"typeName": "hydra.core.model.Injection", "fieldName": "field"}},
"argument": {"variable": "inj"}}},
"typeScheme": {"variables": [], "body": {"variable": "hydra.core.model.Field"}, "constraints": []}}],
"body": {
"application": {
"function": {"variable": "hydra.core.lib.strings.concat"},
"argument": {
"list": [
{
"application": {
"function": {
"application": {"function": {"variable": "hydra.core.print.model.printNameAliased"}, "argument": {"variable": "aliases"}}},
"argument": {"variable": "tname"}}},
{
"application": {
"function": {"application": {"function": {"variable": "hydra.core.print.model.sugarFields"}, "argument": {"variable": "aliases"}}},
"argument": {"list": [{"variable": "f"}]}}}]}}}}}}}}}}},
"annotation": {
"map": [
{
"key": {"variable": "description"},
"value": {"literal": {"string": "Show an injection as a string, shortening the type name via the given import-alias map (#803)"}}}]}}}}},
{
"term": {
"name": "hydra.core.print.model.injectionExprAliased",
"signature": {
"typeParameters": [],
"parameters": [
{"name": "arg0", "type": {"literal": {"integer": "int32"}}, "isLazy": false},
{
"name": "arg1",
"type": {"map": {"keys": {"variable": "hydra.core.packaging.ModuleName"}, "values": {"literal": "string"}}},
"isLazy": false},
{"name": "arg2", "type": {"variable": "hydra.core.model.Injection"}, "isLazy": false}],
"result": {"type": {"variable": "hydra.core.ast.Expr"}}},
"body": {
"annotated": {
"body": {
"lambda": {
"parameter": "budget",
"domain": {"literal": {"integer": "int32"}},
"body": {
"lambda": {
"parameter": "aliases",
"domain": {"map": {"keys": {"variable": "hydra.core.packaging.ModuleName"}, "values": {"literal": "string"}}},
"body": {
"lambda": {
"parameter": "inj",
"domain": {"variable": "hydra.core.model.Injection"},
"body": {
"let": {
"bindings": [
{
"name": "tname",
"term": {
"application": {
"function": {"project": {"typeName": "hydra.core.model.Injection", "fieldName": "typeName"}},
"argument": {"variable": "inj"}}},
"typeScheme": {"variables": [], "body": {"variable": "hydra.core.model.Name"}, "constraints": []}}],
"body": {
"let": {
"bindings": [
{
"name": "f",
"term": {
"application": {
"function": {"project": {"typeName": "hydra.core.model.Injection", "fieldName": "field"}},
"argument": {"variable": "inj"}}},
"typeScheme": {"variables": [], "body": {"variable": "hydra.core.model.Field"}, "constraints": []}}],
"body": {
"let": {
"bindings": [
{
"name": "tnameStr",
"term": {
"application": {
"function": {
"application": {"function": {"variable": "hydra.core.print.model.printNameAliased"}, "argument": {"variable": "aliases"}}},
"argument": {"variable": "tname"}}},
"typeScheme": {"variables": [], "body": {"literal": "string"}, "constraints": []}}],
"body": {
"application": {
"function": {
"application": {
"function": {
"application": {
"function": {"variable": "hydra.core.serialization.ifx"},
"argument": {
"record": {
"typeName": "hydra.core.ast.Op",
"fields": [
{
"name": "symbol",
"term": {"application": {"function": {"variable": "hydra.core.serialization.sym"}, "argument": {"literal": {"string": ""}}}}},
{
"name": "padding",
"term": {
"record": {
"typeName": "hydra.core.ast.Padding",
"fields": [
{"name": "left", "term": {"inject": {"typeName": "hydra.core.ast.Ws", "field": {"name": "none", "term": "unit"}}}},
{"name": "right", "term": {"inject": {"typeName": "hydra.core.ast.Ws", "field": {"name": "none", "term": "unit"}}}}]}}},
{
"name": "precedence",
"term": {"wrap": {"typeName": "hydra.core.ast.Precedence", "body": {"literal": {"integer": {"int32": 0}}}}}},
{
"name": "associativity",
"term": {"inject": {"typeName": "hydra.core.ast.Associativity", "field": {"name": "none", "term": "unit"}}}}]}}}},
"argument": {"application": {"function": {"variable": "hydra.core.serialization.cst"}, "argument": {"variable": "tnameStr"}}}}},
"argument": {
"application": {
"function": {
"application": {
"function": {
"application": {
"function": {"variable": "hydra.core.print.model.sugarFieldsExprAliased"},
"argument": {
"application": {
"function": {
"application": {
"function": {"typeApplication": {"body": {"variable": "hydra.core.lib.math.sub"}, "type": {"literal": {"integer": "int32"}}}},
"argument": {"variable": "budget"}}},
"argument": {"application": {"function": {"variable": "hydra.core.lib.strings.length"}, "argument": {"variable": "tnameStr"}}}}}}},
"argument": {"variable": "aliases"}}},
"argument": {"list": [{"variable": "f"}]}}}}}}}}}}}}}}}}},
"annotation": {
"map": [
{
"key": {"variable": "description"},
"value": {
"literal": {
"string": "Show an injection as a line-layout expression, shortening the type name via the given import-alias map (#803)"}}}]}}}}},
{
"term": {
"name": "hydra.core.print.model.integer",
"signature": {
"typeParameters": [],
"parameters": [{"name": "arg0", "type": {"variable": "hydra.core.model.IntegerValue"}, "isLazy": false}],
"result": {"type": {"literal": "string"}}},
"body": {
"annotated": {
"body": {
"lambda": {
"parameter": "iv",
"domain": {"variable": "hydra.core.model.IntegerValue"},
"body": {
"application": {
"function": {
"cases": {
"typeName": "hydra.core.model.IntegerValue",
"cases": [
{
"name": "bigint",
"handler": {
"lambda": {
"parameter": "v",
"domain": {"literal": {"integer": "bigint"}},
"body": {
"application": {
"function": {
"application": {
"function": {"variable": "hydra.core.lib.strings.concat2"},
"argument": {"application": {"function": {"variable": "hydra.core.lib.literals.printBigint"}, "argument": {"variable": "v"}}}}},
"argument": {"literal": {"string": ":bigint"}}}}}}},
{
"name": "int8",
"handler": {
"lambda": {
"parameter": "v",
"domain": {"literal": {"integer": "int8"}},
"body": {
"application": {
"function": {
"application": {
"function": {"variable": "hydra.core.lib.strings.concat2"},
"argument": {"application": {"function": {"variable": "hydra.core.lib.literals.printInt8"}, "argument": {"variable": "v"}}}}},
"argument": {"literal": {"string": ":int8"}}}}}}},
{
"name": "int16",
"handler": {
"lambda": {
"parameter": "v",
"domain": {"literal": {"integer": "int16"}},
"body": {
"application": {
"function": {
"application": {
"function": {"variable": "hydra.core.lib.strings.concat2"},
"argument": {"application": {"function": {"variable": "hydra.core.lib.literals.printInt16"}, "argument": {"variable": "v"}}}}},
"argument": {"literal": {"string": ":int16"}}}}}}},
{
"name": "int32",
"handler": {
"lambda": {
"parameter": "v",
"domain": {"literal": {"integer": "int32"}},
"body": {
"application": {
"function": {
"application": {
"function": {"variable": "hydra.core.lib.strings.concat2"},
"argument": {"application": {"function": {"variable": "hydra.core.lib.literals.printInt32"}, "argument": {"variable": "v"}}}}},
"argument": {"literal": {"string": ":int32"}}}}}}},
{
"name": "int64",
"handler": {
"lambda": {
"parameter": "v",
"domain": {"literal": {"integer": "int64"}},
"body": {
"application": {
"function": {
"application": {
"function": {"variable": "hydra.core.lib.strings.concat2"},
"argument": {"application": {"function": {"variable": "hydra.core.lib.literals.printInt64"}, "argument": {"variable": "v"}}}}},
"argument": {"literal": {"string": ":int64"}}}}}}},
{
"name": "uint8",
"handler": {
"lambda": {
"parameter": "v",
"domain": {"literal": {"integer": "uint8"}},
"body": {
"application": {
"function": {
"application": {
"function": {"variable": "hydra.core.lib.strings.concat2"},
"argument": {"application": {"function": {"variable": "hydra.core.lib.literals.printUint8"}, "argument": {"variable": "v"}}}}},
"argument": {"literal": {"string": ":uint8"}}}}}}},
{
"name": "uint16",
"handler": {
"lambda": {
"parameter": "v",
"domain": {"literal": {"integer": "uint16"}},
"body": {
"application": {
"function": {
"application": {
"function": {"variable": "hydra.core.lib.strings.concat2"},
"argument": {"application": {"function": {"variable": "hydra.core.lib.literals.printUint16"}, "argument": {"variable": "v"}}}}},
"argument": {"literal": {"string": ":uint16"}}}}}}},
{
"name": "uint32",
"handler": {
"lambda": {
"parameter": "v",
"domain": {"literal": {"integer": "uint32"}},
"body": {
"application": {
"function": {
"application": {
"function": {"variable": "hydra.core.lib.strings.concat2"},
"argument": {"application": {"function": {"variable": "hydra.core.lib.literals.printUint32"}, "argument": {"variable": "v"}}}}},
"argument": {"literal": {"string": ":uint32"}}}}}}},
{
"name": "uint64",
"handler": {
"lambda": {
"parameter": "v",
"domain": {"literal": {"integer": "uint64"}},
"body": {
"application": {
"function": {
"application": {
"function": {"variable": "hydra.core.lib.strings.concat2"},
"argument": {"application": {"function": {"variable": "hydra.core.lib.literals.printUint64"}, "argument": {"variable": "v"}}}}},
"argument": {"literal": {"string": ":uint64"}}}}}}}]}},
"argument": {"variable": "iv"}}}}},
"annotation": {"map": [{"key": {"variable": "description"}, "value": {"literal": {"string": "Show an integer value as a string"}}}]}}}}},
{
"term": {
"name": "hydra.core.print.model.integerType",
"signature": {
"typeParameters": [],
"parameters": [{"name": "arg0", "type": {"variable": "hydra.core.model.IntegerType"}, "isLazy": false}],
"result": {"type": {"literal": "string"}}},
"body": {
"annotated": {
"body": {
"lambda": {
"parameter": "it",
"domain": {"variable": "hydra.core.model.IntegerType"},
"body": {
"application": {
"function": {
"cases": {
"typeName": "hydra.core.model.IntegerType",
"cases": [
{
"name": "bigint",
"handler": {"lambda": {"parameter": "_", "domain": "unit", "body": {"literal": {"string": "bigint"}}}}},
{"name": "int8", "handler": {"lambda": {"parameter": "_", "domain": "unit", "body": {"literal": {"string": "int8"}}}}},
{"name": "int16", "handler": {"lambda": {"parameter": "_", "domain": "unit", "body": {"literal": {"string": "int16"}}}}},
{"name": "int32", "handler": {"lambda": {"parameter": "_", "domain": "unit", "body": {"literal": {"string": "int32"}}}}},
{"name": "int64", "handler": {"lambda": {"parameter": "_", "domain": "unit", "body": {"literal": {"string": "int64"}}}}},
{"name": "uint8", "handler": {"lambda": {"parameter": "_", "domain": "unit", "body": {"literal": {"string": "uint8"}}}}},
{
"name": "uint16",
"handler": {"lambda": {"parameter": "_", "domain": "unit", "body": {"literal": {"string": "uint16"}}}}},
{
"name": "uint32",
"handler": {"lambda": {"parameter": "_", "domain": "unit", "body": {"literal": {"string": "uint32"}}}}},
{
"name": "uint64",
"handler": {"lambda": {"parameter": "_", "domain": "unit", "body": {"literal": {"string": "uint64"}}}}}]}},
"argument": {"variable": "it"}}}}},
"annotation": {"map": [{"key": {"variable": "description"}, "value": {"literal": {"string": "Show an integer type as a string"}}}]}}}}},
{
"term": {
"name": "hydra.core.print.model.isBareName",
"signature": {
"typeParameters": [],
"parameters": [{"name": "arg0", "type": {"literal": "string"}, "isLazy": false}],
"result": {"type": {"literal": "boolean"}}},
"body": {
"annotated": {
"body": {
"lambda": {
"parameter": "s",
"domain": {"literal": "string"},
"body": {
"let": {
"bindings": [
{
"name": "segs",
"term": {
"application": {
"function": {"application": {"function": {"variable": "hydra.core.lib.strings.splitOn"}, "argument": {"literal": {"string": "."}}}},
"argument": {"variable": "s"}}},
"typeScheme": {"variables": [], "body": {"list": {"literal": "string"}}, "constraints": []}}],
"body": {
"application": {
"function": {
"application": {
"function": {"variable": "hydra.core.lib.logic.and"},
"argument": {
"application": {
"function": {"variable": "hydra.core.lib.logic.not"},
"argument": {
"application": {
"function": {"typeApplication": {"body": {"variable": "hydra.core.lib.lists.isEmpty"}, "type": {"literal": "string"}}},
"argument": {"variable": "segs"}}}}}}},
"argument": {
"application": {
"function": {
"application": {
"function": {
"application": {
"function": {
"typeApplication": {
"body": {"typeApplication": {"body": {"variable": "hydra.core.lib.lists.foldl"}, "type": {"literal": "boolean"}}},
"type": {"literal": "string"}}},
"argument": {
"lambda": {
"parameter": "acc",
"domain": {"literal": "boolean"},
"body": {
"lambda": {
"parameter": "seg",
"domain": {"literal": "string"},
"body": {
"application": {
"function": {"application": {"function": {"variable": "hydra.core.lib.logic.and"}, "argument": {"variable": "acc"}}},
"argument": {"application": {"function": {"variable": "hydra.core.print.model.isBareSegment"}, "argument": {"variable": "seg"}}}}}}}}}}},
"argument": {"literal": {"boolean": true}}}},
"argument": {"variable": "segs"}}}}}}}}},
"annotation": {
"map": [
{
"key": {"variable": "description"},
"value": {"literal": {"string": "True iff a name is a nonempty sequence of dot-separated segments of alphanumeric characters."}}}]}}}}},
{
"term": {
"name": "hydra.core.print.model.isBareSegment",
"signature": {
"typeParameters": [],
"parameters": [{"name": "arg0", "type": {"literal": "string"}, "isLazy": false}],
"result": {"type": {"literal": "boolean"}}},
"body": {
"annotated": {
"body": {
"lambda": {
"parameter": "seg",
"domain": {"literal": "string"},
"body": {
"application": {
"function": {
"application": {
"function": {"variable": "hydra.core.lib.logic.and"},
"argument": {
"application": {
"function": {"variable": "hydra.core.lib.logic.not"},
"argument": {"application": {"function": {"variable": "hydra.core.lib.strings.isEmpty"}, "argument": {"variable": "seg"}}}}}}},
"argument": {
"application": {
"function": {
"application": {
"function": {
"application": {
"function": {
"typeApplication": {
"body": {"typeApplication": {"body": {"variable": "hydra.core.lib.lists.foldl"}, "type": {"literal": "boolean"}}},
"type": {"literal": {"integer": "int32"}}}},
"argument": {
"lambda": {
"parameter": "acc",
"domain": {"literal": "boolean"},
"body": {
"lambda": {
"parameter": "c",
"domain": {"literal": {"integer": "int32"}},
"body": {
"application": {
"function": {"application": {"function": {"variable": "hydra.core.lib.logic.and"}, "argument": {"variable": "acc"}}},
"argument": {"application": {"function": {"variable": "hydra.core.lib.chars.isAlphaNum"}, "argument": {"variable": "c"}}}}}}}}}}},
"argument": {"literal": {"boolean": true}}}},
"argument": {"application": {"function": {"variable": "hydra.core.lib.strings.toList"}, "argument": {"variable": "seg"}}}}}}}}},
"annotation": {
"map": [
{
"key": {"variable": "description"},
"value": {
"literal": {"string": "True iff a name segment is a nonempty sequence of alphanumeric characters (the bare alphabet)."}}}]}}}}},
{
"term": {
"name": "hydra.core.print.model.isBinderChainTerm",
"signature": {
"typeParameters": [],
"parameters": [{"name": "arg0", "type": {"variable": "hydra.core.model.Term"}, "isLazy": false}],
"result": {"type": {"literal": "boolean"}}},
"body": {
"annotated": {
"body": {
"lambda": {
"parameter": "t",
"domain": {"variable": "hydra.core.model.Term"},
"body": {
"application": {
"function": {
"cases": {
"typeName": "hydra.core.model.Term",
"default": {"literal": {"boolean": false}},
"cases": [
{
"name": "let",
"handler": {"lambda": {"parameter": "_", "domain": {"variable": "hydra.core.model.Let"}, "body": {"literal": {"boolean": true}}}}},
{
"name": "lambda",
"handler": {
"lambda": {"parameter": "_", "domain": {"variable": "hydra.core.model.Lambda"}, "body": {"literal": {"boolean": true}}}}}]}},
"argument": {"variable": "t"}}}}},
"annotation": {
"map": [
{
"key": {"variable": "description"},
"value": {
"literal": {"string": "True iff a term is a let or lambda (a binder-introducing construct, for #711 chained-binder line breaking)"}}}]}}}}},
{
"term": {
"name": "hydra.core.print.model.isBracketedTerm",
"signature": {
"typeParameters": [],
"parameters": [{"name": "arg0", "type": {"variable": "hydra.core.model.Term"}, "isLazy": false}],
"result": {"type": {"literal": "boolean"}}},
"body": {
"annotated": {
"body": {
"lambda": {
"parameter": "t",
"domain": {"variable": "hydra.core.model.Term"},
"body": {
"application": {
"function": {
"cases": {
"typeName": "hydra.core.model.Term",
"default": {"literal": {"boolean": false}},
"cases": [
{
"name": "record",
"handler": {
"lambda": {"parameter": "_", "domain": {"variable": "hydra.core.model.Record"}, "body": {"literal": {"boolean": true}}}}},
{
"name": "list",
"handler": {
"lambda": {"parameter": "_", "domain": {"list": {"variable": "hydra.core.model.Term"}}, "body": {"literal": {"boolean": true}}}}},
{
"name": "set",
"handler": {
"lambda": {"parameter": "_", "domain": {"set": {"variable": "hydra.core.model.Term"}}, "body": {"literal": {"boolean": true}}}}},
{
"name": "map",
"handler": {
"lambda": {
"parameter": "_",
"domain": {"map": {"keys": {"variable": "hydra.core.model.Term"}, "values": {"variable": "hydra.core.model.Term"}}},
"body": {"literal": {"boolean": true}}}}},
{
"name": "inject",
"handler": {
"lambda": {"parameter": "_", "domain": {"variable": "hydra.core.model.Injection"}, "body": {"literal": {"boolean": true}}}}},
{
"name": "wrap",
"handler": {
"lambda": {"parameter": "_", "domain": {"variable": "hydra.core.model.WrappedTerm"}, "body": {"literal": {"boolean": true}}}}}]}},
"argument": {"variable": "t"}}}}},
"annotation": {
"map": [
{
"key": {"variable": "description"},
"value": {
"literal": {
"string": "True iff a term prints as a self-indenting bracketed construct (record/list/set/map), for #711 double-indent avoidance"}}}]}}}}},
{
"term": {
"name": "hydra.core.print.model.isReservedWord",
"signature": {
"typeParameters": [],
"parameters": [{"name": "arg0", "type": {"literal": "string"}, "isLazy": false}],
"result": {"type": {"literal": "boolean"}}},
"body": {
"annotated": {
"body": {
"lambda": {
"parameter": "s",
"domain": {"literal": "string"},
"body": {
"application": {
"function": {
"application": {
"function": {"typeApplication": {"body": {"variable": "hydra.core.lib.sets.member"}, "type": {"literal": "string"}}},
"argument": {"variable": "s"}}},
"argument": {
"application": {
"function": {"typeApplication": {"body": {"variable": "hydra.core.lib.sets.fromList"}, "type": {"literal": "string"}}},
"argument": {
"list": [
{"literal": {"string": "_"}},
{"literal": {"string": "as"}},
{"literal": {"string": "bigint"}},
{"literal": {"string": "binary"}},
{"literal": {"string": "boolean"}},
{"literal": {"string": "cases"}},
{"literal": {"string": "decimal"}},
{"literal": {"string": "do"}},
{"literal": {"string": "effect"}},
{"literal": {"string": "either"}},
{"literal": {"string": "false"}},
{"literal": {"string": "float32"}},
{"literal": {"string": "float64"}},
{"literal": {"string": "forall"}},
{"literal": {"string": "from"}},
{"literal": {"string": "given"}},
{"literal": {"string": "impure"}},
{"literal": {"string": "in"}},
{"literal": {"string": "import"}},
{"literal": {"string": "inject"}},
{"literal": {"string": "int8"}},
{"literal": {"string": "int16"}},
{"literal": {"string": "int32"}},
{"literal": {"string": "int64"}},
{"literal": {"string": "left"}},
{"literal": {"string": "let"}},
{"literal": {"string": "list"}},
{"literal": {"string": "map"}},
{"literal": {"string": "module"}},
{"literal": {"string": "none"}},
{"literal": {"string": "optional"}},
{"literal": {"string": "partial"}},
{"literal": {"string": "primitive"}},
{"literal": {"string": "project"}},
{"literal": {"string": "record"}},
{"literal": {"string": "right"}},
{"literal": {"string": "set"}},
{"literal": {"string": "string"}},
{"literal": {"string": "term"}},
{"literal": {"string": "true"}},
{"literal": {"string": "type"}},
{"literal": {"string": "uint8"}},
{"literal": {"string": "uint16"}},
{"literal": {"string": "uint32"}},
{"literal": {"string": "uint64"}},
{"literal": {"string": "union"}},
{"literal": {"string": "unit"}},
{"literal": {"string": "unwrap"}},
{"literal": {"string": "void"}},
{"literal": {"string": "wrap"}},
{"literal": {"string": "NaN"}},
{"literal": {"string": "Infinity"}}]}}}}}}},
"annotation": {
"map": [
{
"key": {"variable": "description"},
"value": {
"literal": {"string": "True iff the given string is a reserved word which must be backtick-escaped when used as a name."}}}]}}}}},
{
"term": {
"name": "hydra.core.print.model.isVariableTerm",
"signature": {
"typeParameters": [],
"parameters": [{"name": "arg0", "type": {"variable": "hydra.core.model.Term"}, "isLazy": false}],
"result": {"type": {"literal": "boolean"}}},
"body": {
"annotated": {
"body": {
"lambda": {
"parameter": "t",
"domain": {"variable": "hydra.core.model.Term"},
"body": {
"application": {
"function": {
"cases": {
"typeName": "hydra.core.model.Term",
"default": {"literal": {"boolean": false}},
"cases": [
{
"name": "variable",
"handler": {"lambda": {"parameter": "_", "domain": {"variable": "hydra.core.model.Name"}, "body": {"literal": {"boolean": true}}}}}]}},
"argument": {"variable": "t"}}}}},
"annotation": {
"map": [
{
"key": {"variable": "description"},
"value": {"literal": {"string": "True iff a term is a bare variable reference (for wrap-sugar disambiguation, #809)"}}}]}}}}},
{
"term": {
"name": "hydra.core.print.model.lambda",
"signature": {
"typeParameters": [],
"parameters": [
{
"name": "arg0",
"type": {"map": {"keys": {"variable": "hydra.core.packaging.ModuleName"}, "values": {"literal": "string"}}},
"isLazy": false},
{"name": "arg1", "type": {"variable": "hydra.core.model.Lambda"}, "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": "l",
"domain": {"variable": "hydra.core.model.Lambda"},
"body": {
"let": {
"bindings": [
{
"name": "gathered",
"term": {
"application": {
"function": {
"application": {
"function": {"variable": "hydra.core.print.model.gatherLambdaBinders"},
"argument": {
"typeApplication": {
"body": {"list": []},
"type": {
"pair": {"first": {"variable": "hydra.core.model.Name"}, "second": {"optional": {"variable": "hydra.core.model.Type"}}}}}}}},
"argument": {"inject": {"typeName": "hydra.core.model.Term", "field": {"name": "lambda", "term": {"variable": "l"}}}}}},
"typeScheme": {
"variables": [],
"body": {
"pair": {
"first": {
"list": {
"pair": {"first": {"variable": "hydra.core.model.Name"}, "second": {"optional": {"variable": "hydra.core.model.Type"}}}}},
"second": {"variable": "hydra.core.model.Term"}}},
"constraints": []}}],
"body": {
"let": {
"bindings": [
{
"name": "binders",
"term": {
"application": {
"function": {
"typeApplication": {
"body": {
"typeApplication": {
"body": {"variable": "hydra.core.lib.pairs.first"},
"type": {
"list": {
"pair": {"first": {"variable": "hydra.core.model.Name"}, "second": {"optional": {"variable": "hydra.core.model.Type"}}}}}}},
"type": {"variable": "hydra.core.model.Term"}}},
"argument": {"variable": "gathered"}}},
"typeScheme": {
"variables": [],
"body": {
"list": {
"pair": {"first": {"variable": "hydra.core.model.Name"}, "second": {"optional": {"variable": "hydra.core.model.Type"}}}}},
"constraints": []}}],
"body": {
"let": {
"bindings": [
{
"name": "body",
"term": {
"application": {
"function": {
"typeApplication": {
"body": {
"typeApplication": {
"body": {"variable": "hydra.core.lib.pairs.second"},
"type": {
"list": {
"pair": {"first": {"variable": "hydra.core.model.Name"}, "second": {"optional": {"variable": "hydra.core.model.Type"}}}}}}},
"type": {"variable": "hydra.core.model.Term"}}},
"argument": {"variable": "gathered"}}},
"typeScheme": {"variables": [], "body": {"variable": "hydra.core.model.Term"}, "constraints": []}}],
"body": {
"let": {
"bindings": [
{
"name": "binderStr",
"term": {
"lambda": {
"parameter": "b",
"domain": {
"pair": {"first": {"variable": "hydra.core.model.Name"}, "second": {"optional": {"variable": "hydra.core.model.Type"}}}},
"body": {
"let": {
"bindings": [
{
"name": "v",
"term": {
"application": {
"function": {"variable": "hydra.core.print.model.printBinderName"},
"argument": {
"application": {
"function": {
"typeApplication": {
"body": {"typeApplication": {"body": {"variable": "hydra.core.lib.pairs.first"}, "type": {"variable": "hydra.core.model.Name"}}},
"type": {"optional": {"variable": "hydra.core.model.Type"}}}},
"argument": {"variable": "b"}}}}},
"typeScheme": {"variables": [], "body": {"literal": "string"}, "constraints": []}}],
"body": {
"let": {
"bindings": [
{
"name": "mt",
"term": {
"application": {
"function": {
"typeApplication": {
"body": {
"typeApplication": {"body": {"variable": "hydra.core.lib.pairs.second"}, "type": {"variable": "hydra.core.model.Name"}}},
"type": {"optional": {"variable": "hydra.core.model.Type"}}}},
"argument": {"variable": "b"}}},
"typeScheme": {"variables": [], "body": {"optional": {"variable": "hydra.core.model.Type"}}, "constraints": []}}],
"body": {
"application": {
"function": {
"application": {
"function": {
"application": {
"function": {
"typeApplication": {
"body": {
"typeApplication": {"body": {"variable": "hydra.core.lib.optionals.match"}, "type": {"variable": "hydra.core.model.Type"}}},
"type": {"literal": "string"}}},
"argument": {"variable": "mt"}}},
"argument": {"variable": "v"}}},
"argument": {
"lambda": {
"parameter": "t",
"domain": {"variable": "hydra.core.model.Type"},
"body": {
"application": {
"function": {"variable": "hydra.core.lib.strings.concat"},
"argument": {
"list": [
{"variable": "v"},
{"literal": {"string": ":"}},
{
"application": {
"function": {"application": {"function": {"variable": "hydra.core.print.model.typeAliased"}, "argument": {"variable": "aliases"}}},
"argument": {"variable": "t"}}}]}}}}}}}}}}}}},
"typeScheme": {
"variables": [],
"body": {
"function": {
"domain": {
"pair": {"first": {"variable": "hydra.core.model.Name"}, "second": {"optional": {"variable": "hydra.core.model.Type"}}}},
"codomain": {"literal": "string"}}},
"constraints": []}}],
"body": {
"application": {
"function": {"variable": "hydra.core.lib.strings.concat"},
"argument": {
"list": [
{"literal": {"string": "λ"}},
{
"application": {
"function": {"application": {"function": {"variable": "hydra.core.lib.strings.join"}, "argument": {"literal": {"string": ", "}}}},
"argument": {
"application": {
"function": {
"application": {
"function": {
"typeApplication": {
"body": {
"typeApplication": {
"body": {"variable": "hydra.core.lib.lists.map"},
"type": {
"pair": {"first": {"variable": "hydra.core.model.Name"}, "second": {"optional": {"variable": "hydra.core.model.Type"}}}}}},
"type": {"literal": "string"}}},
"argument": {"variable": "binderStr"}}},
"argument": {"variable": "binders"}}}}},
{"literal": {"string": "."}},
{
"application": {
"function": {"application": {"function": {"variable": "hydra.core.print.model.termAliased"}, "argument": {"variable": "aliases"}}},
"argument": {"variable": "body"}}}]}}}}}}}}}}}}}}},
"annotation": {
"map": [
{
"key": {"variable": "description"},
"value": {
"literal": {"string": "Show a lambda as a string, shortening nominal references in its domain/body via the given alias map (#803)"}}}]}}}}},
{
"term": {
"name": "hydra.core.print.model.lambdaExprAliased",
"signature": {
"typeParameters": [],
"parameters": [
{"name": "arg0", "type": {"literal": {"integer": "int32"}}, "isLazy": false},
{
"name": "arg1",
"type": {"map": {"keys": {"variable": "hydra.core.packaging.ModuleName"}, "values": {"literal": "string"}}},
"isLazy": false},
{"name": "arg2", "type": {"variable": "hydra.core.model.Lambda"}, "isLazy": false}],
"result": {"type": {"variable": "hydra.core.ast.Expr"}}},
"body": {
"annotated": {
"body": {
"lambda": {
"parameter": "budget",
"domain": {"literal": {"integer": "int32"}},
"body": {
"lambda": {
"parameter": "aliases",
"domain": {"map": {"keys": {"variable": "hydra.core.packaging.ModuleName"}, "values": {"literal": "string"}}},
"body": {
"lambda": {
"parameter": "l",
"domain": {"variable": "hydra.core.model.Lambda"},
"body": {
"let": {
"bindings": [
{
"name": "gathered",
"term": {
"application": {
"function": {
"application": {
"function": {"variable": "hydra.core.print.model.gatherLambdaBinders"},
"argument": {
"typeApplication": {
"body": {"list": []},
"type": {
"pair": {"first": {"variable": "hydra.core.model.Name"}, "second": {"optional": {"variable": "hydra.core.model.Type"}}}}}}}},
"argument": {"inject": {"typeName": "hydra.core.model.Term", "field": {"name": "lambda", "term": {"variable": "l"}}}}}},
"typeScheme": {
"variables": [],
"body": {
"pair": {
"first": {
"list": {
"pair": {"first": {"variable": "hydra.core.model.Name"}, "second": {"optional": {"variable": "hydra.core.model.Type"}}}}},
"second": {"variable": "hydra.core.model.Term"}}},
"constraints": []}}],
"body": {
"let": {
"bindings": [
{
"name": "binders",
"term": {
"application": {
"function": {
"typeApplication": {
"body": {
"typeApplication": {
"body": {"variable": "hydra.core.lib.pairs.first"},
"type": {
"list": {
"pair": {"first": {"variable": "hydra.core.model.Name"}, "second": {"optional": {"variable": "hydra.core.model.Type"}}}}}}},
"type": {"variable": "hydra.core.model.Term"}}},
"argument": {"variable": "gathered"}}},
"typeScheme": {
"variables": [],
"body": {
"list": {
"pair": {"first": {"variable": "hydra.core.model.Name"}, "second": {"optional": {"variable": "hydra.core.model.Type"}}}}},
"constraints": []}}],
"body": {
"let": {
"bindings": [
{
"name": "body",
"term": {
"application": {
"function": {
"typeApplication": {
"body": {
"typeApplication": {
"body": {"variable": "hydra.core.lib.pairs.second"},
"type": {
"list": {
"pair": {"first": {"variable": "hydra.core.model.Name"}, "second": {"optional": {"variable": "hydra.core.model.Type"}}}}}}},
"type": {"variable": "hydra.core.model.Term"}}},
"argument": {"variable": "gathered"}}},
"typeScheme": {"variables": [], "body": {"variable": "hydra.core.model.Term"}, "constraints": []}}],
"body": {
"let": {
"bindings": [
{
"name": "binderStr",
"term": {
"lambda": {
"parameter": "b",
"domain": {
"pair": {"first": {"variable": "hydra.core.model.Name"}, "second": {"optional": {"variable": "hydra.core.model.Type"}}}},
"body": {
"let": {
"bindings": [
{
"name": "v",
"term": {
"application": {
"function": {"variable": "hydra.core.print.model.printBinderName"},
"argument": {
"application": {
"function": {
"typeApplication": {
"body": {"typeApplication": {"body": {"variable": "hydra.core.lib.pairs.first"}, "type": {"variable": "hydra.core.model.Name"}}},
"type": {"optional": {"variable": "hydra.core.model.Type"}}}},
"argument": {"variable": "b"}}}}},
"typeScheme": {"variables": [], "body": {"literal": "string"}, "constraints": []}}],
"body": {
"let": {
"bindings": [
{
"name": "mt",
"term": {
"application": {
"function": {
"typeApplication": {
"body": {
"typeApplication": {"body": {"variable": "hydra.core.lib.pairs.second"}, "type": {"variable": "hydra.core.model.Name"}}},
"type": {"optional": {"variable": "hydra.core.model.Type"}}}},
"argument": {"variable": "b"}}},
"typeScheme": {"variables": [], "body": {"optional": {"variable": "hydra.core.model.Type"}}, "constraints": []}}],
"body": {
"application": {
"function": {
"application": {
"function": {
"application": {
"function": {
"typeApplication": {
"body": {
"typeApplication": {"body": {"variable": "hydra.core.lib.optionals.match"}, "type": {"variable": "hydra.core.model.Type"}}},
"type": {"literal": "string"}}},
"argument": {"variable": "mt"}}},
"argument": {"variable": "v"}}},
"argument": {
"lambda": {
"parameter": "t",
"domain": {"variable": "hydra.core.model.Type"},
"body": {
"application": {
"function": {"variable": "hydra.core.lib.strings.concat"},
"argument": {
"list": [
{"variable": "v"},
{"literal": {"string": ":"}},
{
"application": {
"function": {"application": {"function": {"variable": "hydra.core.print.model.typeAliased"}, "argument": {"variable": "aliases"}}},
"argument": {"variable": "t"}}}]}}}}}}}}}}}}},
"typeScheme": {
"variables": [],
"body": {
"function": {
"domain": {
"pair": {"first": {"variable": "hydra.core.model.Name"}, "second": {"optional": {"variable": "hydra.core.model.Type"}}}},
"codomain": {"literal": "string"}}},
"constraints": []}}],
"body": {
"let": {
"bindings": [
{
"name": "headStr",
"term": {
"application": {
"function": {"variable": "hydra.core.lib.strings.concat"},
"argument": {
"list": [
{"literal": {"string": "λ"}},
{
"application": {
"function": {"application": {"function": {"variable": "hydra.core.lib.strings.join"}, "argument": {"literal": {"string": ", "}}}},
"argument": {
"application": {
"function": {
"application": {
"function": {
"typeApplication": {
"body": {
"typeApplication": {
"body": {"variable": "hydra.core.lib.lists.map"},
"type": {
"pair": {"first": {"variable": "hydra.core.model.Name"}, "second": {"optional": {"variable": "hydra.core.model.Type"}}}}}},
"type": {"literal": "string"}}},
"argument": {"variable": "binderStr"}}},
"argument": {"variable": "binders"}}}}},
{"literal": {"string": "."}}]}}},
"typeScheme": {"variables": [], "body": {"literal": "string"}, "constraints": []}}],
"body": {
"let": {
"bindings": [
{
"name": "bodyBudget",
"term": {
"application": {
"function": {
"application": {
"function": {"typeApplication": {"body": {"variable": "hydra.core.lib.math.sub"}, "type": {"literal": {"integer": "int32"}}}},
"argument": {"variable": "budget"}}},
"argument": {"application": {"function": {"variable": "hydra.core.lib.strings.length"}, "argument": {"variable": "headStr"}}}}},
"typeScheme": {"variables": [], "body": {"literal": {"integer": "int32"}}, "constraints": []}}],
"body": {
"let": {
"bindings": [
{
"name": "bodyExpr",
"term": {
"application": {
"function": {
"application": {
"function": {
"application": {
"function": {
"application": {"function": {"variable": "hydra.core.print.model.termExprAtPrecBudget"}, "argument": {"variable": "bodyBudget"}}},
"argument": {"variable": "aliases"}}},
"argument": {"literal": {"integer": {"int32": 0}}}}},
"argument": {"variable": "body"}}},
"typeScheme": {"variables": [], "body": {"variable": "hydra.core.ast.Expr"}, "constraints": []}}],
"body": {
"let": {
"bindings": [
{
"name": "forceBreak",
"term": {
"application": {
"function": {
"application": {
"function": {"variable": "hydra.core.lib.logic.and"},
"argument": {
"application": {"function": {"variable": "hydra.core.print.model.isBinderChainTerm"}, "argument": {"variable": "body"}}}}},
"argument": {
"application": {
"function": {
"application": {
"function": {"typeApplication": {"body": {"variable": "hydra.core.lib.ordering.gt"}, "type": {"literal": {"integer": "int32"}}}},
"argument": {
"application": {
"function": {"variable": "hydra.core.serialization.expressionLength"},
"argument": {
"application": {
"function": {"variable": "hydra.core.serialization.spaceSep"},
"argument": {
"list": [
{"application": {"function": {"variable": "hydra.core.serialization.cst"}, "argument": {"variable": "headStr"}}},
{"variable": "bodyExpr"}]}}}}}}},
"argument": {"variable": "budget"}}}}},
"typeScheme": {"variables": [], "body": {"literal": "boolean"}, "constraints": []}}],
"body": {
"application": {
"function": {
"application": {
"function": {
"application": {
"function": {"typeApplication": {"body": {"variable": "hydra.core.lib.logic.ifElse"}, "type": {"variable": "hydra.core.ast.Expr"}}},
"argument": {"variable": "forceBreak"}}},
"argument": {
"application": {
"function": {
"application": {
"function": {
"application": {
"function": {"variable": "hydra.core.serialization.ifx"},
"argument": {
"record": {
"typeName": "hydra.core.ast.Op",
"fields": [
{
"name": "symbol",
"term": {"application": {"function": {"variable": "hydra.core.serialization.sym"}, "argument": {"literal": {"string": ""}}}}},
{
"name": "padding",
"term": {
"record": {
"typeName": "hydra.core.ast.Padding",
"fields": [
{"name": "left", "term": {"inject": {"typeName": "hydra.core.ast.Ws", "field": {"name": "none", "term": "unit"}}}},
{
"name": "right",
"term": {
"inject": {
"typeName": "hydra.core.ast.Ws",
"field": {"name": "breakAndIndent", "term": {"variable": "hydra.core.serialization.doubleSpace"}}}}}]}}},
{
"name": "precedence",
"term": {"wrap": {"typeName": "hydra.core.ast.Precedence", "body": {"literal": {"integer": {"int32": 0}}}}}},
{
"name": "associativity",
"term": {"inject": {"typeName": "hydra.core.ast.Associativity", "field": {"name": "none", "term": "unit"}}}}]}}}},
"argument": {"application": {"function": {"variable": "hydra.core.serialization.cst"}, "argument": {"variable": "headStr"}}}}},
"argument": {"variable": "bodyExpr"}}}}},
"argument": {
"application": {
"function": {
"application": {
"function": {"variable": "hydra.core.serialization.indentSubsequentLines"},
"argument": {"variable": "hydra.core.serialization.doubleSpace"}}},
"argument": {
"application": {
"function": {
"application": {
"function": {
"application": {
"function": {"variable": "hydra.core.serialization.ifx"},
"argument": {
"record": {
"typeName": "hydra.core.ast.Op",
"fields": [
{
"name": "symbol",
"term": {"application": {"function": {"variable": "hydra.core.serialization.sym"}, "argument": {"literal": {"string": ""}}}}},
{
"name": "padding",
"term": {
"record": {
"typeName": "hydra.core.ast.Padding",
"fields": [
{"name": "left", "term": {"inject": {"typeName": "hydra.core.ast.Ws", "field": {"name": "none", "term": "unit"}}}},
{"name": "right", "term": {"inject": {"typeName": "hydra.core.ast.Ws", "field": {"name": "none", "term": "unit"}}}}]}}},
{
"name": "precedence",
"term": {"wrap": {"typeName": "hydra.core.ast.Precedence", "body": {"literal": {"integer": {"int32": 0}}}}}},
{
"name": "associativity",
"term": {"inject": {"typeName": "hydra.core.ast.Associativity", "field": {"name": "none", "term": "unit"}}}}]}}}},
"argument": {"application": {"function": {"variable": "hydra.core.serialization.cst"}, "argument": {"variable": "headStr"}}}}},
"argument": {"variable": "bodyExpr"}}}}}}}}}}}}}}}}}}}}}}}}}}}}},
"annotation": {
"map": [
{
"key": {"variable": "description"},
"value": {
"literal": {
"string": "Show a lambda as a line-layout expression, shortening nominal references in its domain/body via the given alias map (#803)"}}}]}}}}},
{
"term": {
"name": "hydra.core.print.model.let",
"signature": {
"typeParameters": [],
"parameters": [{"name": "arg0", "type": {"variable": "hydra.core.model.Let"}, "isLazy": false}],
"result": {"type": {"literal": "string"}}},
"body": {
"annotated": {
"body": {
"application": {
"function": {"variable": "hydra.core.print.model.letAliased"},
"argument": {
"typeApplication": {
"body": {
"typeApplication": {"body": {"variable": "hydra.core.lib.maps.empty"}, "type": {"variable": "hydra.core.packaging.ModuleName"}}},
"type": {"literal": "string"}}}}},
"annotation": {"map": [{"key": {"variable": "description"}, "value": {"literal": {"string": "Show a let expression as a string"}}}]}}}}},
{
"term": {
"name": "hydra.core.print.model.letAliased",
"signature": {
"typeParameters": [],
"parameters": [
{
"name": "arg0",
"type": {"map": {"keys": {"variable": "hydra.core.packaging.ModuleName"}, "values": {"literal": "string"}}},
"isLazy": false},
{"name": "arg1", "type": {"variable": "hydra.core.model.Let"}, "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": "l",
"domain": {"variable": "hydra.core.model.Let"},
"body": {
"let": {
"bindings": [
{
"name": "bindings",
"term": {
"application": {"function": {"project": {"typeName": "hydra.core.model.Let", "fieldName": "bindings"}}, "argument": {"variable": "l"}}},
"typeScheme": {"variables": [], "body": {"list": {"variable": "hydra.core.model.Binding"}}, "constraints": []}}],
"body": {
"let": {
"bindings": [
{
"name": "env",
"term": {
"application": {"function": {"project": {"typeName": "hydra.core.model.Let", "fieldName": "body"}}, "argument": {"variable": "l"}}},
"typeScheme": {"variables": [], "body": {"variable": "hydra.core.model.Term"}, "constraints": []}}],
"body": {
"let": {
"bindings": [
{
"name": "bindingStrs",
"term": {
"application": {
"function": {
"application": {
"function": {
"typeApplication": {
"body": {
"typeApplication": {"body": {"variable": "hydra.core.lib.lists.map"}, "type": {"variable": "hydra.core.model.Binding"}}},
"type": {"literal": "string"}}},
"argument": {
"application": {"function": {"variable": "hydra.core.print.model.bindingAliased"}, "argument": {"variable": "aliases"}}}}},
"argument": {"variable": "bindings"}}},
"typeScheme": {"variables": [], "body": {"list": {"literal": "string"}}, "constraints": []}}],
"body": {
"application": {
"function": {"variable": "hydra.core.lib.strings.concat"},
"argument": {
"list": [
{"literal": {"string": "let "}},
{
"application": {
"function": {"application": {"function": {"variable": "hydra.core.lib.strings.join"}, "argument": {"literal": {"string": ", "}}}},
"argument": {"variable": "bindingStrs"}}},
{"literal": {"string": " in "}},
{
"application": {
"function": {"application": {"function": {"variable": "hydra.core.print.model.termAliased"}, "argument": {"variable": "aliases"}}},
"argument": {"variable": "env"}}}]}}}}}}}}}}}}},
"annotation": {
"map": [
{
"key": {"variable": "description"},
"value": {
"literal": {"string": "Show a let expression as a string, shortening nominal references via the given import-alias map (#803)"}}}]}}}}},
{
"term": {
"name": "hydra.core.print.model.letExprAliased",
"signature": {
"typeParameters": [],
"parameters": [
{"name": "arg0", "type": {"literal": {"integer": "int32"}}, "isLazy": false},
{
"name": "arg1",
"type": {"map": {"keys": {"variable": "hydra.core.packaging.ModuleName"}, "values": {"literal": "string"}}},
"isLazy": false},
{"name": "arg2", "type": {"variable": "hydra.core.model.Let"}, "isLazy": false}],
"result": {"type": {"variable": "hydra.core.ast.Expr"}}},
"body": {
"annotated": {
"body": {
"lambda": {
"parameter": "budget",
"domain": {"literal": {"integer": "int32"}},
"body": {
"lambda": {
"parameter": "aliases",
"domain": {"map": {"keys": {"variable": "hydra.core.packaging.ModuleName"}, "values": {"literal": "string"}}},
"body": {
"lambda": {
"parameter": "l",
"domain": {"variable": "hydra.core.model.Let"},
"body": {
"let": {
"bindings": [
{
"name": "gathered",
"term": {
"application": {
"function": {
"application": {
"function": {"variable": "hydra.core.print.model.gatherLetChain"},
"argument": {"typeApplication": {"body": {"list": []}, "type": {"list": {"variable": "hydra.core.model.Binding"}}}}}},
"argument": {"inject": {"typeName": "hydra.core.model.Term", "field": {"name": "let", "term": {"variable": "l"}}}}}},
"typeScheme": {
"variables": [],
"body": {
"pair": {"first": {"list": {"list": {"variable": "hydra.core.model.Binding"}}}, "second": {"variable": "hydra.core.model.Term"}}},
"constraints": []}}],
"body": {
"let": {
"bindings": [
{
"name": "bindingGroups",
"term": {
"application": {
"function": {
"typeApplication": {
"body": {
"typeApplication": {
"body": {"variable": "hydra.core.lib.pairs.first"},
"type": {"list": {"list": {"variable": "hydra.core.model.Binding"}}}}},
"type": {"variable": "hydra.core.model.Term"}}},
"argument": {"variable": "gathered"}}},
"typeScheme": {"variables": [], "body": {"list": {"list": {"variable": "hydra.core.model.Binding"}}}, "constraints": []}}],
"body": {
"let": {
"bindings": [
{
"name": "finalBody",
"term": {
"application": {
"function": {
"typeApplication": {
"body": {
"typeApplication": {
"body": {"variable": "hydra.core.lib.pairs.second"},
"type": {"list": {"list": {"variable": "hydra.core.model.Binding"}}}}},
"type": {"variable": "hydra.core.model.Term"}}},
"argument": {"variable": "gathered"}}},
"typeScheme": {"variables": [], "body": {"variable": "hydra.core.model.Term"}, "constraints": []}}],
"body": {
"let": {
"bindings": [
{
"name": "groupExprs",
"term": {
"application": {
"function": {
"application": {
"function": {
"typeApplication": {
"body": {
"typeApplication": {"body": {"variable": "hydra.core.lib.lists.map"}, "type": {"list": {"variable": "hydra.core.model.Binding"}}}},
"type": {"list": {"variable": "hydra.core.ast.Expr"}}}},
"argument": {
"lambda": {
"parameter": "bs",
"domain": {"list": {"variable": "hydra.core.model.Binding"}},
"body": {
"application": {
"function": {
"application": {
"function": {
"typeApplication": {
"body": {
"typeApplication": {"body": {"variable": "hydra.core.lib.lists.map"}, "type": {"variable": "hydra.core.model.Binding"}}},
"type": {"variable": "hydra.core.ast.Expr"}}},
"argument": {
"application": {
"function": {
"application": {
"function": {"variable": "hydra.core.print.model.bindingExprAliased"},
"argument": {
"application": {
"function": {
"application": {
"function": {"typeApplication": {"body": {"variable": "hydra.core.lib.math.sub"}, "type": {"literal": {"integer": "int32"}}}},
"argument": {"variable": "budget"}}},
"argument": {"literal": {"integer": {"int32": 4}}}}}}},
"argument": {"variable": "aliases"}}}}},
"argument": {"variable": "bs"}}}}}}},
"argument": {"variable": "bindingGroups"}}},
"typeScheme": {"variables": [], "body": {"list": {"list": {"variable": "hydra.core.ast.Expr"}}}, "constraints": []}}],
"body": {
"let": {
"bindings": [
{
"name": "groupInlineStrs",
"term": {
"application": {
"function": {
"application": {
"function": {
"typeApplication": {
"body": {
"typeApplication": {"body": {"variable": "hydra.core.lib.lists.map"}, "type": {"list": {"variable": "hydra.core.ast.Expr"}}}},
"type": {"variable": "hydra.core.ast.Expr"}}},
"argument": {
"lambda": {
"parameter": "bes",
"domain": {"list": {"variable": "hydra.core.ast.Expr"}},
"body": {
"application": {
"function": {
"application": {
"function": {"variable": "hydra.core.serialization.commaSep"},
"argument": {"variable": "hydra.core.serialization.inlineStyle"}}},
"argument": {"variable": "bes"}}}}}}},
"argument": {"variable": "groupExprs"}}},
"typeScheme": {"variables": [], "body": {"list": {"variable": "hydra.core.ast.Expr"}}, "constraints": []}}],
"body": {
"let": {
"bindings": [
{
"name": "bodyExpr",
"term": {
"application": {
"function": {
"application": {
"function": {
"application": {
"function": {
"application": {"function": {"variable": "hydra.core.print.model.termExprAtPrecBudget"}, "argument": {"variable": "budget"}}},
"argument": {"variable": "aliases"}}},
"argument": {"literal": {"integer": {"int32": 0}}}}},
"argument": {"variable": "finalBody"}}},
"typeScheme": {"variables": [], "body": {"variable": "hydra.core.ast.Expr"}, "constraints": []}}],
"body": {
"let": {
"bindings": [
{
"name": "inletOp",
"term": {
"record": {
"typeName": "hydra.core.ast.Op",
"fields": [
{
"name": "symbol",
"term": {"application": {"function": {"variable": "hydra.core.serialization.sym"}, "argument": {"literal": {"string": " in "}}}}},
{
"name": "padding",
"term": {
"record": {
"typeName": "hydra.core.ast.Padding",
"fields": [
{"name": "left", "term": {"inject": {"typeName": "hydra.core.ast.Ws", "field": {"name": "none", "term": "unit"}}}},
{"name": "right", "term": {"inject": {"typeName": "hydra.core.ast.Ws", "field": {"name": "none", "term": "unit"}}}}]}}},
{
"name": "precedence",
"term": {"wrap": {"typeName": "hydra.core.ast.Precedence", "body": {"literal": {"integer": {"int32": 0}}}}}},
{
"name": "associativity",
"term": {"inject": {"typeName": "hydra.core.ast.Associativity", "field": {"name": "none", "term": "unit"}}}}]}},
"typeScheme": {"variables": [], "body": {"variable": "hydra.core.ast.Op"}, "constraints": []}}],
"body": {
"let": {
"bindings": [
{
"name": "letPrefixOp",
"term": {
"record": {
"typeName": "hydra.core.ast.Op",
"fields": [
{
"name": "symbol",
"term": {"application": {"function": {"variable": "hydra.core.serialization.sym"}, "argument": {"literal": {"string": "let "}}}}},
{
"name": "padding",
"term": {
"record": {
"typeName": "hydra.core.ast.Padding",
"fields": [
{"name": "left", "term": {"inject": {"typeName": "hydra.core.ast.Ws", "field": {"name": "none", "term": "unit"}}}},
{"name": "right", "term": {"inject": {"typeName": "hydra.core.ast.Ws", "field": {"name": "none", "term": "unit"}}}}]}}},
{
"name": "precedence",
"term": {"wrap": {"typeName": "hydra.core.ast.Precedence", "body": {"literal": {"integer": {"int32": 0}}}}}},
{
"name": "associativity",
"term": {"inject": {"typeName": "hydra.core.ast.Associativity", "field": {"name": "none", "term": "unit"}}}}]}},
"typeScheme": {"variables": [], "body": {"variable": "hydra.core.ast.Op"}, "constraints": []}}],
"body": {
"let": {
"bindings": [
{
"name": "inlineForm",
"term": {
"application": {
"function": {
"application": {
"function": {
"application": {
"function": {
"typeApplication": {
"body": {"typeApplication": {"body": {"variable": "hydra.core.lib.lists.foldr"}, "type": {"variable": "hydra.core.ast.Expr"}}},
"type": {"variable": "hydra.core.ast.Expr"}}},
"argument": {
"lambda": {
"parameter": "ge",
"domain": {"variable": "hydra.core.ast.Expr"},
"body": {
"lambda": {
"parameter": "acc",
"domain": {"variable": "hydra.core.ast.Expr"},
"body": {
"application": {
"function": {
"application": {
"function": {"application": {"function": {"variable": "hydra.core.serialization.ifx"}, "argument": {"variable": "inletOp"}}},
"argument": {
"application": {
"function": {
"application": {
"function": {"application": {"function": {"variable": "hydra.core.serialization.ifx"}, "argument": {"variable": "letPrefixOp"}}},
"argument": {"application": {"function": {"variable": "hydra.core.serialization.cst"}, "argument": {"literal": {"string": ""}}}}}},
"argument": {"variable": "ge"}}}}},
"argument": {"variable": "acc"}}}}}}}}},
"argument": {"variable": "bodyExpr"}}},
"argument": {"variable": "groupInlineStrs"}}},
"typeScheme": {"variables": [], "body": {"variable": "hydra.core.ast.Expr"}, "constraints": []}}],
"body": {
"let": {
"bindings": [
{
"name": "letLineOp",
"term": {
"record": {
"typeName": "hydra.core.ast.Op",
"fields": [
{
"name": "symbol",
"term": {"application": {"function": {"variable": "hydra.core.serialization.sym"}, "argument": {"literal": {"string": "let "}}}}},
{
"name": "padding",
"term": {
"record": {
"typeName": "hydra.core.ast.Padding",
"fields": [
{"name": "left", "term": {"inject": {"typeName": "hydra.core.ast.Ws", "field": {"name": "none", "term": "unit"}}}},
{"name": "right", "term": {"inject": {"typeName": "hydra.core.ast.Ws", "field": {"name": "none", "term": "unit"}}}}]}}},
{
"name": "precedence",
"term": {"wrap": {"typeName": "hydra.core.ast.Precedence", "body": {"literal": {"integer": {"int32": 0}}}}}},
{
"name": "associativity",
"term": {"inject": {"typeName": "hydra.core.ast.Associativity", "field": {"name": "none", "term": "unit"}}}}]}},
"typeScheme": {"variables": [], "body": {"variable": "hydra.core.ast.Op"}, "constraints": []}}],
"body": {
"let": {
"bindings": [
{
"name": "blockForm",
"term": {
"application": {
"function": {
"application": {
"function": {
"application": {
"function": {"typeApplication": {"body": {"variable": "hydra.core.lib.logic.ifElse"}, "type": {"variable": "hydra.core.ast.Expr"}}},
"argument": {
"application": {
"function": {
"application": {
"function": {"typeApplication": {"body": {"variable": "hydra.core.lib.equality.equal"}, "type": {"literal": {"integer": "int32"}}}},
"argument": {
"application": {
"function": {"typeApplication": {"body": {"variable": "hydra.core.lib.lists.length"}, "type": {"variable": "hydra.core.ast.Expr"}}},
"argument": {"variable": "groupInlineStrs"}}}}},
"argument": {"literal": {"integer": {"int32": 1}}}}}}},
"argument": {
"let": {
"bindings": [
{
"name": "ge",
"term": {
"application": {
"function": {
"application": {
"function": {
"typeApplication": {"body": {"variable": "hydra.core.lib.optionals.withDefault"}, "type": {"variable": "hydra.core.ast.Expr"}}},
"argument": {"application": {"function": {"variable": "hydra.core.serialization.cst"}, "argument": {"literal": {"string": ""}}}}}},
"argument": {
"application": {
"function": {"typeApplication": {"body": {"variable": "hydra.core.lib.lists.head"}, "type": {"variable": "hydra.core.ast.Expr"}}},
"argument": {"variable": "groupInlineStrs"}}}}},
"typeScheme": {"variables": [], "body": {"variable": "hydra.core.ast.Expr"}, "constraints": []}}],
"body": {
"application": {
"function": {"variable": "hydra.core.serialization.newlineSep"},
"argument": {
"list": [
{
"application": {
"function": {
"application": {
"function": {"application": {"function": {"variable": "hydra.core.serialization.ifx"}, "argument": {"variable": "letLineOp"}}},
"argument": {"application": {"function": {"variable": "hydra.core.serialization.cst"}, "argument": {"literal": {"string": ""}}}}}},
"argument": {"variable": "ge"}}},
{
"application": {
"function": {
"application": {
"function": {
"application": {
"function": {"variable": "hydra.core.serialization.ifx"},
"argument": {
"record": {
"typeName": "hydra.core.ast.Op",
"fields": [
{
"name": "symbol",
"term": {"application": {"function": {"variable": "hydra.core.serialization.sym"}, "argument": {"literal": {"string": "in "}}}}},
{
"name": "padding",
"term": {
"record": {
"typeName": "hydra.core.ast.Padding",
"fields": [
{"name": "left", "term": {"inject": {"typeName": "hydra.core.ast.Ws", "field": {"name": "none", "term": "unit"}}}},
{"name": "right", "term": {"inject": {"typeName": "hydra.core.ast.Ws", "field": {"name": "none", "term": "unit"}}}}]}}},
{
"name": "precedence",
"term": {"wrap": {"typeName": "hydra.core.ast.Precedence", "body": {"literal": {"integer": {"int32": 0}}}}}},
{
"name": "associativity",
"term": {"inject": {"typeName": "hydra.core.ast.Associativity", "field": {"name": "none", "term": "unit"}}}}]}}}},
"argument": {"application": {"function": {"variable": "hydra.core.serialization.cst"}, "argument": {"literal": {"string": ""}}}}}},
"argument": {"variable": "bodyExpr"}}}]}}}}}}},
"argument": {
"let": {
"bindings": [
{
"name": "letLines",
"term": {
"application": {
"function": {
"application": {
"function": {
"typeApplication": {
"body": {"typeApplication": {"body": {"variable": "hydra.core.lib.lists.map"}, "type": {"variable": "hydra.core.ast.Expr"}}},
"type": {"variable": "hydra.core.ast.Expr"}}},
"argument": {
"lambda": {
"parameter": "ge",
"domain": {"variable": "hydra.core.ast.Expr"},
"body": {
"application": {
"function": {
"application": {
"function": {"application": {"function": {"variable": "hydra.core.serialization.ifx"}, "argument": {"variable": "letLineOp"}}},
"argument": {"application": {"function": {"variable": "hydra.core.serialization.cst"}, "argument": {"literal": {"string": ""}}}}}},
"argument": {
"application": {
"function": {
"application": {"function": {"variable": "hydra.core.serialization.suffix"}, "argument": {"literal": {"string": " in"}}}},
"argument": {"variable": "ge"}}}}}}}}},
"argument": {"variable": "groupInlineStrs"}}},
"typeScheme": {"variables": [], "body": {"list": {"variable": "hydra.core.ast.Expr"}}, "constraints": []}}],
"body": {
"application": {
"function": {"variable": "hydra.core.serialization.newlineSep"},
"argument": {
"application": {
"function": {"typeApplication": {"body": {"variable": "hydra.core.lib.lists.concat"}, "type": {"variable": "hydra.core.ast.Expr"}}},
"argument": {"list": [{"variable": "letLines"}, {"list": [{"variable": "bodyExpr"}]}]}}}}}}}}},
"typeScheme": {"variables": [], "body": {"variable": "hydra.core.ast.Expr"}, "constraints": []}}],
"body": {
"application": {
"function": {
"application": {
"function": {"application": {"function": {"variable": "hydra.core.serialization.chooseLayout"}, "argument": {"variable": "budget"}}},
"argument": {"variable": "inlineForm"}}},
"argument": {"variable": "blockForm"}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}},
"annotation": {
"map": [
{
"key": {"variable": "description"},
"value": {
"literal": {
"string": "Show a let expression as a line-layout expression, shortening nominal references via the given import-alias map (#803)"}}}]}}}}},
{
"term": {
"name": "hydra.core.print.model.list",
"signature": {
"typeParameters": [{"name": "t0", "constraints": []}],
"parameters": [
{
"name": "arg0",
"type": {"function": {"domain": {"variable": "t0"}, "codomain": {"literal": "string"}}},
"isLazy": false},
{"name": "arg1", "type": {"list": {"variable": "t0"}}, "isLazy": false}],
"result": {"type": {"literal": "string"}}},
"body": {
"typeLambda": {
"parameter": "t0",
"body": {
"annotated": {
"body": {
"lambda": {
"parameter": "f",
"domain": {"function": {"domain": {"variable": "t0"}, "codomain": {"literal": "string"}}},
"body": {
"lambda": {
"parameter": "xs",
"domain": {"list": {"variable": "t0"}},
"body": {
"let": {
"bindings": [
{
"name": "elementStrs",
"term": {
"application": {
"function": {
"application": {
"function": {
"typeApplication": {
"body": {"typeApplication": {"body": {"variable": "hydra.core.lib.lists.map"}, "type": {"variable": "t0"}}},
"type": {"literal": "string"}}},
"argument": {"variable": "f"}}},
"argument": {"variable": "xs"}}},
"typeScheme": {"variables": [], "body": {"list": {"literal": "string"}}, "constraints": []}}],
"body": {
"application": {
"function": {"variable": "hydra.core.lib.strings.concat"},
"argument": {
"list": [
{"literal": {"string": "["}},
{
"application": {
"function": {"application": {"function": {"variable": "hydra.core.lib.strings.join"}, "argument": {"literal": {"string": ", "}}}},
"argument": {"variable": "elementStrs"}}},
{"literal": {"string": "]"}}]}}}}}}}}},
"annotation": {
"map": [
{
"key": {"variable": "description"},
"value": {"literal": {"string": "Show a list using a given function to show each element"}}}]}}}}}}},
{
"term": {
"name": "hydra.core.print.model.literal",
"signature": {
"typeParameters": [],
"parameters": [{"name": "arg0", "type": {"variable": "hydra.core.model.Literal"}, "isLazy": false}],
"result": {"type": {"literal": "string"}}},
"body": {
"annotated": {
"body": {
"lambda": {
"parameter": "l",
"domain": {"variable": "hydra.core.model.Literal"},
"body": {
"application": {
"function": {
"cases": {
"typeName": "hydra.core.model.Literal",
"cases": [
{
"name": "binary",
"handler": {
"lambda": {
"parameter": "b",
"domain": {"literal": "binary"},
"body": {
"application": {
"function": {"variable": "hydra.core.lib.strings.concat"},
"argument": {
"list": [
{
"application": {
"function": {"variable": "hydra.core.lib.literals.printString"},
"argument": {"application": {"function": {"variable": "hydra.core.lib.literals.binaryToBase64"}, "argument": {"variable": "b"}}}}},
{"literal": {"string": ":binary"}}]}}}}}},
{
"name": "boolean",
"handler": {
"lambda": {
"parameter": "b",
"domain": {"literal": "boolean"},
"body": {
"application": {
"function": {
"application": {
"function": {
"application": {
"function": {"typeApplication": {"body": {"variable": "hydra.core.lib.logic.ifElse"}, "type": {"literal": "string"}}},
"argument": {"variable": "b"}}},
"argument": {"literal": {"string": "true"}}}},
"argument": {"literal": {"string": "false"}}}}}}},
{
"name": "decimal",
"handler": {
"lambda": {
"parameter": "d",
"domain": {"literal": "decimal"},
"body": {"application": {"function": {"variable": "hydra.core.lib.literals.printDecimal"}, "argument": {"variable": "d"}}}}}},
{
"name": "float",
"handler": {
"lambda": {
"parameter": "fv",
"domain": {"variable": "hydra.core.model.FloatValue"},
"body": {"application": {"function": {"variable": "hydra.core.print.model.float"}, "argument": {"variable": "fv"}}}}}},
{
"name": "integer",
"handler": {
"lambda": {
"parameter": "iv",
"domain": {"variable": "hydra.core.model.IntegerValue"},
"body": {"application": {"function": {"variable": "hydra.core.print.model.integer"}, "argument": {"variable": "iv"}}}}}},
{
"name": "string",
"handler": {
"lambda": {
"parameter": "s",
"domain": {"literal": "string"},
"body": {"application": {"function": {"variable": "hydra.core.print.model.printStringLit"}, "argument": {"variable": "s"}}}}}}]}},
"argument": {"variable": "l"}}}}},
"annotation": {"map": [{"key": {"variable": "description"}, "value": {"literal": {"string": "Show a literal as a string"}}}]}}}}},
{
"term": {
"name": "hydra.core.print.model.literalType",
"signature": {
"typeParameters": [],
"parameters": [{"name": "arg0", "type": {"variable": "hydra.core.model.LiteralType"}, "isLazy": false}],
"result": {"type": {"literal": "string"}}},
"body": {
"annotated": {
"body": {
"lambda": {
"parameter": "lt",
"domain": {"variable": "hydra.core.model.LiteralType"},
"body": {
"application": {
"function": {
"cases": {
"typeName": "hydra.core.model.LiteralType",
"cases": [
{
"name": "binary",
"handler": {"lambda": {"parameter": "_", "domain": "unit", "body": {"literal": {"string": "binary"}}}}},
{
"name": "boolean",
"handler": {"lambda": {"parameter": "_", "domain": "unit", "body": {"literal": {"string": "boolean"}}}}},
{
"name": "decimal",
"handler": {"lambda": {"parameter": "_", "domain": "unit", "body": {"literal": {"string": "decimal"}}}}},
{
"name": "float",
"handler": {
"lambda": {
"parameter": "ft",
"domain": {"variable": "hydra.core.model.FloatType"},
"body": {"application": {"function": {"variable": "hydra.core.print.model.floatType"}, "argument": {"variable": "ft"}}}}}},
{
"name": "integer",
"handler": {
"lambda": {
"parameter": "it",
"domain": {"variable": "hydra.core.model.IntegerType"},
"body": {"application": {"function": {"variable": "hydra.core.print.model.integerType"}, "argument": {"variable": "it"}}}}}},
{
"name": "string",
"handler": {"lambda": {"parameter": "_", "domain": "unit", "body": {"literal": {"string": "string"}}}}}]}},
"argument": {"variable": "lt"}}}}},
"annotation": {"map": [{"key": {"variable": "description"}, "value": {"literal": {"string": "Show a literal type as a string"}}}]}}}}},
{
"term": {
"name": "hydra.core.print.model.map",
"signature": {
"typeParameters": [{"name": "t0", "constraints": [{"simple": "ordering"}]}, {"name": "t1", "constraints": []}],
"parameters": [
{
"name": "arg0",
"type": {"function": {"domain": {"variable": "t0"}, "codomain": {"literal": "string"}}},
"isLazy": false},
{
"name": "arg1",
"type": {"function": {"domain": {"variable": "t1"}, "codomain": {"literal": "string"}}},
"isLazy": false},
{"name": "arg2", "type": {"map": {"keys": {"variable": "t0"}, "values": {"variable": "t1"}}}, "isLazy": false}],
"result": {"type": {"literal": "string"}}},
"body": {
"typeLambda": {
"parameter": "t0",
"body": {
"typeLambda": {
"parameter": "t1",
"body": {
"annotated": {
"body": {
"lambda": {
"parameter": "showK",
"domain": {"function": {"domain": {"variable": "t0"}, "codomain": {"literal": "string"}}},
"body": {
"lambda": {
"parameter": "showV",
"domain": {"function": {"domain": {"variable": "t1"}, "codomain": {"literal": "string"}}},
"body": {
"lambda": {
"parameter": "m",
"domain": {"map": {"keys": {"variable": "t0"}, "values": {"variable": "t1"}}},
"body": {
"let": {
"bindings": [
{
"name": "pairStrs",
"term": {
"application": {
"function": {
"application": {
"function": {
"typeApplication": {
"body": {
"typeApplication": {
"body": {"variable": "hydra.core.lib.lists.map"},
"type": {"pair": {"first": {"variable": "t0"}, "second": {"variable": "t1"}}}}},
"type": {"literal": "string"}}},
"argument": {
"lambda": {
"parameter": "p",
"domain": {"pair": {"first": {"variable": "t0"}, "second": {"variable": "t1"}}},
"body": {
"application": {
"function": {"variable": "hydra.core.lib.strings.concat"},
"argument": {
"list": [
{
"application": {
"function": {"variable": "showK"},
"argument": {
"application": {
"function": {
"typeApplication": {
"body": {"typeApplication": {"body": {"variable": "hydra.core.lib.pairs.first"}, "type": {"variable": "t0"}}},
"type": {"variable": "t1"}}},
"argument": {"variable": "p"}}}}},
{"literal": {"string": "="}},
{
"application": {
"function": {"variable": "showV"},
"argument": {
"application": {
"function": {
"typeApplication": {
"body": {"typeApplication": {"body": {"variable": "hydra.core.lib.pairs.second"}, "type": {"variable": "t0"}}},
"type": {"variable": "t1"}}},
"argument": {"variable": "p"}}}}}]}}}}}}},
"argument": {
"application": {
"function": {
"application": {
"function": {
"typeApplication": {
"body": {
"typeApplication": {
"body": {"variable": "hydra.core.lib.lists.sortBy"},
"type": {"pair": {"first": {"variable": "t0"}, "second": {"variable": "t1"}}}}},
"type": {"variable": "t0"}}},
"argument": {
"typeApplication": {
"body": {"typeApplication": {"body": {"variable": "hydra.core.lib.pairs.first"}, "type": {"variable": "t0"}}},
"type": {"variable": "t1"}}}}},
"argument": {
"application": {
"function": {
"typeApplication": {
"body": {"typeApplication": {"body": {"variable": "hydra.core.lib.maps.toList"}, "type": {"variable": "t0"}}},
"type": {"variable": "t1"}}},
"argument": {"variable": "m"}}}}}}},
"typeScheme": {"variables": [], "body": {"list": {"literal": "string"}}, "constraints": []}}],
"body": {
"application": {
"function": {"variable": "hydra.core.lib.strings.concat"},
"argument": {
"list": [
{"literal": {"string": "{"}},
{
"application": {
"function": {"application": {"function": {"variable": "hydra.core.lib.strings.join"}, "argument": {"literal": {"string": ", "}}}},
"argument": {"variable": "pairStrs"}}},
{"literal": {"string": "}"}}]}}}}}}}}}}},
"annotation": {
"map": [
{
"key": {"variable": "description"},
"value": {"literal": {"string": "Show a map using given functions to show keys and values, in canonical (ascending key) order"}}}]}}}}}}}}},
{
"term": {
"name": "hydra.core.print.model.optional",
"signature": {
"typeParameters": [{"name": "t0", "constraints": []}],
"parameters": [
{
"name": "arg0",
"type": {"function": {"domain": {"variable": "t0"}, "codomain": {"literal": "string"}}},
"isLazy": false},
{"name": "arg1", "type": {"optional": {"variable": "t0"}}, "isLazy": false}],
"result": {"type": {"literal": "string"}}},
"body": {
"typeLambda": {
"parameter": "t0",
"body": {
"annotated": {
"body": {
"lambda": {
"parameter": "f",
"domain": {"function": {"domain": {"variable": "t0"}, "codomain": {"literal": "string"}}},
"body": {
"lambda": {
"parameter": "mx",
"domain": {"optional": {"variable": "t0"}},
"body": {
"application": {
"function": {
"application": {
"function": {
"application": {
"function": {
"typeApplication": {
"body": {"typeApplication": {"body": {"variable": "hydra.core.lib.optionals.match"}, "type": {"variable": "t0"}}},
"type": {"literal": "string"}}},
"argument": {"variable": "mx"}}},
"argument": {"literal": {"string": "none"}}}},
"argument": {
"lambda": {
"parameter": "x",
"domain": {"variable": "t0"},
"body": {
"application": {
"function": {
"application": {"function": {"variable": "hydra.core.lib.strings.concat2"}, "argument": {"literal": {"string": "given("}}}},
"argument": {
"application": {
"function": {
"application": {
"function": {"variable": "hydra.core.lib.strings.concat2"},
"argument": {"application": {"function": {"variable": "f"}, "argument": {"variable": "x"}}}}},
"argument": {"literal": {"string": ")"}}}}}}}}}}}}}},
"annotation": {
"map": [
{
"key": {"variable": "description"},
"value": {"literal": {"string": "Show an optional value using a given function to show the element"}}}]}}}}}}},
{
"term": {
"name": "hydra.core.print.model.pair",
"signature": {
"typeParameters": [{"name": "t0", "constraints": []}, {"name": "t1", "constraints": []}],
"parameters": [
{
"name": "arg0",
"type": {"function": {"domain": {"variable": "t0"}, "codomain": {"literal": "string"}}},
"isLazy": false},
{
"name": "arg1",
"type": {"function": {"domain": {"variable": "t1"}, "codomain": {"literal": "string"}}},
"isLazy": false},
{"name": "arg2", "type": {"pair": {"first": {"variable": "t0"}, "second": {"variable": "t1"}}}, "isLazy": false}],
"result": {"type": {"literal": "string"}}},
"body": {
"typeLambda": {
"parameter": "t0",
"body": {
"typeLambda": {
"parameter": "t1",
"body": {
"annotated": {
"body": {
"lambda": {
"parameter": "showA",
"domain": {"function": {"domain": {"variable": "t0"}, "codomain": {"literal": "string"}}},
"body": {
"lambda": {
"parameter": "showB",
"domain": {"function": {"domain": {"variable": "t1"}, "codomain": {"literal": "string"}}},
"body": {
"lambda": {
"parameter": "p",
"domain": {"pair": {"first": {"variable": "t0"}, "second": {"variable": "t1"}}},
"body": {
"application": {
"function": {"variable": "hydra.core.lib.strings.concat"},
"argument": {
"list": [
{"literal": {"string": "("}},
{
"application": {
"function": {"variable": "showA"},
"argument": {
"application": {
"function": {
"typeApplication": {
"body": {"typeApplication": {"body": {"variable": "hydra.core.lib.pairs.first"}, "type": {"variable": "t0"}}},
"type": {"variable": "t1"}}},
"argument": {"variable": "p"}}}}},
{"literal": {"string": ", "}},
{
"application": {
"function": {"variable": "showB"},
"argument": {
"application": {
"function": {
"typeApplication": {
"body": {"typeApplication": {"body": {"variable": "hydra.core.lib.pairs.second"}, "type": {"variable": "t0"}}},
"type": {"variable": "t1"}}},
"argument": {"variable": "p"}}}}},
{"literal": {"string": ")"}}]}}}}}}}}},
"annotation": {
"map": [
{
"key": {"variable": "description"},
"value": {"literal": {"string": "Show a pair using given functions to show each element"}}}]}}}}}}}}},
{
"term": {
"name": "hydra.core.print.model.peelDescriptionAnnotation",
"signature": {
"typeParameters": [],
"parameters": [{"name": "arg0", "type": {"variable": "hydra.core.model.Type"}, "isLazy": false}],
"result": {"type": {"pair": {"first": {"optional": {"literal": "string"}}, "second": {"variable": "hydra.core.model.Type"}}}}},
"body": {
"annotated": {
"body": {
"lambda": {
"parameter": "typ",
"domain": {"variable": "hydra.core.model.Type"},
"body": {
"application": {
"function": {
"cases": {
"typeName": "hydra.core.model.Type",
"default": {
"typeApplication": {
"body": {
"typeApplication": {
"body": {
"pair": {
"first": {"typeApplication": {"body": {"optional": null}, "type": {"literal": "string"}}},
"second": {"variable": "typ"}}},
"type": {"optional": {"literal": "string"}}}},
"type": {"variable": "hydra.core.model.Type"}}},
"cases": [
{
"name": "annotated",
"handler": {
"lambda": {
"parameter": "at",
"domain": {"variable": "hydra.core.model.AnnotatedType"},
"body": {
"let": {
"bindings": [
{
"name": "body",
"term": {
"application": {
"function": {"project": {"typeName": "hydra.core.model.AnnotatedType", "fieldName": "body"}},
"argument": {"variable": "at"}}},
"typeScheme": {"variables": [], "body": {"variable": "hydra.core.model.Type"}, "constraints": []}}],
"body": {
"let": {
"bindings": [
{
"name": "ann",
"term": {
"application": {
"function": {"project": {"typeName": "hydra.core.model.AnnotatedType", "fieldName": "annotation"}},
"argument": {"variable": "at"}}},
"typeScheme": {"variables": [], "body": {"variable": "hydra.core.model.Term"}, "constraints": []}}],
"body": {
"application": {
"function": {
"cases": {
"typeName": "hydra.core.model.Term",
"default": {
"typeApplication": {
"body": {
"typeApplication": {
"body": {
"pair": {
"first": {"typeApplication": {"body": {"optional": null}, "type": {"literal": "string"}}},
"second": {"variable": "typ"}}},
"type": {"optional": {"literal": "string"}}}},
"type": {"variable": "hydra.core.model.Type"}}},
"cases": [
{
"name": "map",
"handler": {
"lambda": {
"parameter": "m",
"domain": {"map": {"keys": {"variable": "hydra.core.model.Term"}, "values": {"variable": "hydra.core.model.Term"}}},
"body": {
"let": {
"bindings": [
{
"name": "entries",
"term": {
"application": {
"function": {
"typeApplication": {
"body": {"typeApplication": {"body": {"variable": "hydra.core.lib.maps.toList"}, "type": {"variable": "hydra.core.model.Term"}}},
"type": {"variable": "hydra.core.model.Term"}}},
"argument": {"variable": "m"}}},
"typeScheme": {
"variables": [],
"body": {"list": {"pair": {"first": {"variable": "hydra.core.model.Term"}, "second": {"variable": "hydra.core.model.Term"}}}},
"constraints": []}}],
"body": {
"application": {
"function": {
"application": {
"function": {
"application": {
"function": {
"typeApplication": {
"body": {"variable": "hydra.core.lib.logic.ifElse"},
"type": {"pair": {"first": {"optional": {"literal": "string"}}, "second": {"variable": "hydra.core.model.Type"}}}}},
"argument": {
"application": {
"function": {
"application": {
"function": {"typeApplication": {"body": {"variable": "hydra.core.lib.equality.equal"}, "type": {"literal": {"integer": "int32"}}}},
"argument": {
"application": {
"function": {
"typeApplication": {
"body": {"variable": "hydra.core.lib.lists.length"},
"type": {"pair": {"first": {"variable": "hydra.core.model.Term"}, "second": {"variable": "hydra.core.model.Term"}}}}},
"argument": {"variable": "entries"}}}}},
"argument": {"literal": {"integer": {"int32": 1}}}}}}},
"argument": {
"let": {
"bindings": [
{
"name": "entry",
"term": {
"application": {
"function": {
"application": {
"function": {
"typeApplication": {
"body": {"variable": "hydra.core.lib.optionals.withDefault"},
"type": {"pair": {"first": {"variable": "hydra.core.model.Term"}, "second": {"variable": "hydra.core.model.Term"}}}}},
"argument": {
"typeApplication": {
"body": {
"typeApplication": {
"body": {
"pair": {
"first": {"inject": {"typeName": "hydra.core.model.Term", "field": {"name": "unit", "term": "unit"}}},
"second": {"inject": {"typeName": "hydra.core.model.Term", "field": {"name": "unit", "term": "unit"}}}}},
"type": {"variable": "hydra.core.model.Term"}}},
"type": {"variable": "hydra.core.model.Term"}}}}},
"argument": {
"application": {
"function": {
"typeApplication": {
"body": {"variable": "hydra.core.lib.lists.head"},
"type": {"pair": {"first": {"variable": "hydra.core.model.Term"}, "second": {"variable": "hydra.core.model.Term"}}}}},
"argument": {"variable": "entries"}}}}},
"typeScheme": {
"variables": [],
"body": {"pair": {"first": {"variable": "hydra.core.model.Term"}, "second": {"variable": "hydra.core.model.Term"}}},
"constraints": []}}],
"body": {
"let": {
"bindings": [
{
"name": "k",
"term": {
"application": {
"function": {
"typeApplication": {
"body": {"typeApplication": {"body": {"variable": "hydra.core.lib.pairs.first"}, "type": {"variable": "hydra.core.model.Term"}}},
"type": {"variable": "hydra.core.model.Term"}}},
"argument": {"variable": "entry"}}},
"typeScheme": {"variables": [], "body": {"variable": "hydra.core.model.Term"}, "constraints": []}}],
"body": {
"let": {
"bindings": [
{
"name": "v",
"term": {
"application": {
"function": {
"typeApplication": {
"body": {
"typeApplication": {"body": {"variable": "hydra.core.lib.pairs.second"}, "type": {"variable": "hydra.core.model.Term"}}},
"type": {"variable": "hydra.core.model.Term"}}},
"argument": {"variable": "entry"}}},
"typeScheme": {"variables": [], "body": {"variable": "hydra.core.model.Term"}, "constraints": []}}],
"body": {
"application": {
"function": {
"cases": {
"typeName": "hydra.core.model.Term",
"default": {
"typeApplication": {
"body": {
"typeApplication": {
"body": {
"pair": {
"first": {"typeApplication": {"body": {"optional": null}, "type": {"literal": "string"}}},
"second": {"variable": "typ"}}},
"type": {"optional": {"literal": "string"}}}},
"type": {"variable": "hydra.core.model.Type"}}},
"cases": [
{
"name": "variable",
"handler": {
"lambda": {
"parameter": "n",
"domain": {"variable": "hydra.core.model.Name"},
"body": {
"application": {
"function": {
"application": {
"function": {
"application": {
"function": {
"typeApplication": {
"body": {"variable": "hydra.core.lib.logic.ifElse"},
"type": {"pair": {"first": {"optional": {"literal": "string"}}, "second": {"variable": "hydra.core.model.Type"}}}}},
"argument": {
"application": {
"function": {
"application": {
"function": {"typeApplication": {"body": {"variable": "hydra.core.lib.equality.equal"}, "type": {"literal": "string"}}},
"argument": {"application": {"function": {"unwrap": "hydra.core.model.Name"}, "argument": {"variable": "n"}}}}},
"argument": {"literal": {"string": "description"}}}}}},
"argument": {
"application": {
"function": {
"cases": {
"typeName": "hydra.core.model.Term",
"default": {
"typeApplication": {
"body": {
"typeApplication": {
"body": {
"pair": {
"first": {"typeApplication": {"body": {"optional": null}, "type": {"literal": "string"}}},
"second": {"variable": "typ"}}},
"type": {"optional": {"literal": "string"}}}},
"type": {"variable": "hydra.core.model.Type"}}},
"cases": [
{
"name": "literal",
"handler": {
"lambda": {
"parameter": "l",
"domain": {"variable": "hydra.core.model.Literal"},
"body": {
"application": {
"function": {
"cases": {
"typeName": "hydra.core.model.Literal",
"default": {
"typeApplication": {
"body": {
"typeApplication": {
"body": {
"pair": {
"first": {"typeApplication": {"body": {"optional": null}, "type": {"literal": "string"}}},
"second": {"variable": "typ"}}},
"type": {"optional": {"literal": "string"}}}},
"type": {"variable": "hydra.core.model.Type"}}},
"cases": [
{
"name": "string",
"handler": {
"lambda": {
"parameter": "s",
"domain": {"literal": "string"},
"body": {
"typeApplication": {
"body": {
"typeApplication": {
"body": {"pair": {"first": {"optional": {"variable": "s"}}, "second": {"variable": "body"}}},
"type": {"optional": {"literal": "string"}}}},
"type": {"variable": "hydra.core.model.Type"}}}}}}]}},
"argument": {"variable": "l"}}}}}}]}},
"argument": {"variable": "v"}}}}},
"argument": {
"typeApplication": {
"body": {
"typeApplication": {
"body": {
"pair": {
"first": {"typeApplication": {"body": {"optional": null}, "type": {"literal": "string"}}},
"second": {"variable": "typ"}}},
"type": {"optional": {"literal": "string"}}}},
"type": {"variable": "hydra.core.model.Type"}}}}}}}}]}},
"argument": {"variable": "k"}}}}}}}}}}},
"argument": {
"typeApplication": {
"body": {
"typeApplication": {
"body": {
"pair": {
"first": {"typeApplication": {"body": {"optional": null}, "type": {"literal": "string"}}},
"second": {"variable": "typ"}}},
"type": {"optional": {"literal": "string"}}}},
"type": {"variable": "hydra.core.model.Type"}}}}}}}}}}]}},
"argument": {"variable": "ann"}}}}}}}}}}]}},
"argument": {"variable": "typ"}}}}},
"annotation": {
"map": [
{
"key": {"variable": "description"},
"value": {
"literal": {"string": "Peel a single '@{description = ...}' annotation off a type, returning (description, body) if found"}}}]}}}}},
{
"term": {
"name": "hydra.core.print.model.peelTermDescriptionAnnotation",
"signature": {
"typeParameters": [],
"parameters": [{"name": "arg0", "type": {"variable": "hydra.core.model.Term"}, "isLazy": false}],
"result": {"type": {"pair": {"first": {"optional": {"literal": "string"}}, "second": {"variable": "hydra.core.model.Term"}}}}},
"body": {
"annotated": {
"body": {
"lambda": {
"parameter": "t",
"domain": {"variable": "hydra.core.model.Term"},
"body": {
"application": {
"function": {
"cases": {
"typeName": "hydra.core.model.Term",
"default": {
"typeApplication": {
"body": {
"typeApplication": {
"body": {
"pair": {"first": {"typeApplication": {"body": {"optional": null}, "type": {"literal": "string"}}}, "second": {"variable": "t"}}},
"type": {"optional": {"literal": "string"}}}},
"type": {"variable": "hydra.core.model.Term"}}},
"cases": [
{
"name": "annotated",
"handler": {
"lambda": {
"parameter": "at",
"domain": {"variable": "hydra.core.model.AnnotatedTerm"},
"body": {
"let": {
"bindings": [
{
"name": "body",
"term": {
"application": {
"function": {"project": {"typeName": "hydra.core.model.AnnotatedTerm", "fieldName": "body"}},
"argument": {"variable": "at"}}},
"typeScheme": {"variables": [], "body": {"variable": "hydra.core.model.Term"}, "constraints": []}}],
"body": {
"let": {
"bindings": [
{
"name": "ann",
"term": {
"application": {
"function": {"project": {"typeName": "hydra.core.model.AnnotatedTerm", "fieldName": "annotation"}},
"argument": {"variable": "at"}}},
"typeScheme": {"variables": [], "body": {"variable": "hydra.core.model.Term"}, "constraints": []}}],
"body": {
"application": {
"function": {
"cases": {
"typeName": "hydra.core.model.Term",
"default": {
"typeApplication": {
"body": {
"typeApplication": {
"body": {
"pair": {"first": {"typeApplication": {"body": {"optional": null}, "type": {"literal": "string"}}}, "second": {"variable": "t"}}},
"type": {"optional": {"literal": "string"}}}},
"type": {"variable": "hydra.core.model.Term"}}},
"cases": [
{
"name": "map",
"handler": {
"lambda": {
"parameter": "m",
"domain": {"map": {"keys": {"variable": "hydra.core.model.Term"}, "values": {"variable": "hydra.core.model.Term"}}},
"body": {
"let": {
"bindings": [
{
"name": "descKey",
"term": {
"inject": {
"typeName": "hydra.core.model.Term",
"field": {
"name": "variable",
"term": {"wrap": {"typeName": "hydra.core.model.Name", "body": {"literal": {"string": "description"}}}}}}},
"typeScheme": {"variables": [], "body": {"variable": "hydra.core.model.Term"}, "constraints": []}}],
"body": {
"let": {
"bindings": [
{
"name": "mdescVal",
"term": {
"application": {
"function": {
"application": {
"function": {
"typeApplication": {
"body": {"typeApplication": {"body": {"variable": "hydra.core.lib.maps.lookup"}, "type": {"variable": "hydra.core.model.Term"}}},
"type": {"variable": "hydra.core.model.Term"}}},
"argument": {"variable": "descKey"}}},
"argument": {"variable": "m"}}},
"typeScheme": {"variables": [], "body": {"optional": {"variable": "hydra.core.model.Term"}}, "constraints": []}}],
"body": {
"let": {
"bindings": [
{
"name": "descStr",
"term": {
"application": {
"function": {
"application": {
"function": {
"application": {
"function": {
"typeApplication": {
"body": {
"typeApplication": {"body": {"variable": "hydra.core.lib.optionals.match"}, "type": {"variable": "hydra.core.model.Term"}}},
"type": {"optional": {"literal": "string"}}}},
"argument": {"variable": "mdescVal"}}},
"argument": {"typeApplication": {"body": {"optional": null}, "type": {"literal": "string"}}}}},
"argument": {
"lambda": {
"parameter": "v",
"domain": {"variable": "hydra.core.model.Term"},
"body": {
"application": {
"function": {
"cases": {
"typeName": "hydra.core.model.Term",
"default": {"typeApplication": {"body": {"optional": null}, "type": {"literal": "string"}}},
"cases": [
{
"name": "literal",
"handler": {
"lambda": {
"parameter": "l",
"domain": {"variable": "hydra.core.model.Literal"},
"body": {
"application": {
"function": {
"cases": {
"typeName": "hydra.core.model.Literal",
"default": {"typeApplication": {"body": {"optional": null}, "type": {"literal": "string"}}},
"cases": [
{
"name": "string",
"handler": {"lambda": {"parameter": "s", "domain": {"literal": "string"}, "body": {"optional": {"variable": "s"}}}}}]}},
"argument": {"variable": "l"}}}}}}]}},
"argument": {"variable": "v"}}}}}}},
"typeScheme": {"variables": [], "body": {"optional": {"literal": "string"}}, "constraints": []}}],
"body": {
"application": {
"function": {
"application": {
"function": {
"application": {
"function": {
"typeApplication": {
"body": {"typeApplication": {"body": {"variable": "hydra.core.lib.optionals.match"}, "type": {"literal": "string"}}},
"type": {"pair": {"first": {"optional": {"literal": "string"}}, "second": {"variable": "hydra.core.model.Term"}}}}},
"argument": {"variable": "descStr"}}},
"argument": {
"typeApplication": {
"body": {
"typeApplication": {
"body": {
"pair": {"first": {"typeApplication": {"body": {"optional": null}, "type": {"literal": "string"}}}, "second": {"variable": "t"}}},
"type": {"optional": {"literal": "string"}}}},
"type": {"variable": "hydra.core.model.Term"}}}}},
"argument": {
"lambda": {
"parameter": "s",
"domain": {"literal": "string"},
"body": {
"let": {
"bindings": [
{
"name": "rest",
"term": {
"application": {
"function": {
"application": {
"function": {
"typeApplication": {
"body": {"typeApplication": {"body": {"variable": "hydra.core.lib.maps.delete"}, "type": {"variable": "hydra.core.model.Term"}}},
"type": {"variable": "hydra.core.model.Term"}}},
"argument": {"variable": "descKey"}}},
"argument": {"variable": "m"}}},
"typeScheme": {
"variables": [],
"body": {"map": {"keys": {"variable": "hydra.core.model.Term"}, "values": {"variable": "hydra.core.model.Term"}}},
"constraints": []}}],
"body": {
"let": {
"bindings": [
{
"name": "remainingTerm",
"term": {
"application": {
"function": {
"application": {
"function": {
"application": {
"function": {
"typeApplication": {"body": {"variable": "hydra.core.lib.logic.ifElse"}, "type": {"variable": "hydra.core.model.Term"}}},
"argument": {
"application": {
"function": {
"typeApplication": {
"body": {
"typeApplication": {"body": {"variable": "hydra.core.lib.maps.isEmpty"}, "type": {"variable": "hydra.core.model.Term"}}},
"type": {"variable": "hydra.core.model.Term"}}},
"argument": {"variable": "rest"}}}}},
"argument": {"variable": "body"}}},
"argument": {
"inject": {
"typeName": "hydra.core.model.Term",
"field": {
"name": "annotated",
"term": {
"record": {
"typeName": "hydra.core.model.AnnotatedTerm",
"fields": [
{"name": "body", "term": {"variable": "body"}},
{
"name": "annotation",
"term": {"inject": {"typeName": "hydra.core.model.Term", "field": {"name": "map", "term": {"variable": "rest"}}}}}]}}}}}}},
"typeScheme": {"variables": [], "body": {"variable": "hydra.core.model.Term"}, "constraints": []}}],
"body": {
"typeApplication": {
"body": {
"typeApplication": {
"body": {"pair": {"first": {"optional": {"variable": "s"}}, "second": {"variable": "remainingTerm"}}},
"type": {"optional": {"literal": "string"}}}},
"type": {"variable": "hydra.core.model.Term"}}}}}}}}}}}}}}}}}}}}]}},
"argument": {"variable": "ann"}}}}}}}}}}]}},
"argument": {"variable": "t"}}}}},
"annotation": {
"map": [
{
"key": {"variable": "description"},
"value": {"literal": {"string": "Peel a 'description' entry off a term's outermost '@{...}' annotation map, if present"}}}]}}}}},
{
"term": {
"name": "hydra.core.print.model.primitiveSignatureAliased",
"signature": {
"typeParameters": [],
"parameters": [
{
"name": "arg0",
"type": {"map": {"keys": {"variable": "hydra.core.packaging.ModuleName"}, "values": {"literal": "string"}}},
"isLazy": false},
{"name": "arg1", "type": {"variable": "hydra.core.typing.TermSignature"}, "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": "sig",
"domain": {"variable": "hydra.core.typing.TermSignature"},
"body": {
"let": {
"bindings": [
{
"name": "typeParams",
"term": {
"application": {
"function": {"project": {"typeName": "hydra.core.typing.TermSignature", "fieldName": "typeParameters"}},
"argument": {"variable": "sig"}}},
"typeScheme": {"variables": [], "body": {"list": {"variable": "hydra.core.typing.TypeParameter"}}, "constraints": []}}],
"body": {
"let": {
"bindings": [
{
"name": "params",
"term": {
"application": {
"function": {"project": {"typeName": "hydra.core.typing.TermSignature", "fieldName": "parameters"}},
"argument": {"variable": "sig"}}},
"typeScheme": {"variables": [], "body": {"list": {"variable": "hydra.core.typing.Parameter"}}, "constraints": []}}],
"body": {
"let": {
"bindings": [
{
"name": "result",
"term": {
"application": {
"function": {"project": {"typeName": "hydra.core.typing.TermSignature", "fieldName": "result"}},
"argument": {"variable": "sig"}}},
"typeScheme": {"variables": [], "body": {"variable": "hydra.core.typing.Result"}, "constraints": []}}],
"body": {
"let": {
"bindings": [
{
"name": "varNames",
"term": {
"application": {
"function": {
"application": {
"function": {
"typeApplication": {
"body": {
"typeApplication": {"body": {"variable": "hydra.core.lib.lists.map"}, "type": {"variable": "hydra.core.typing.TypeParameter"}}},
"type": {"literal": "string"}}},
"argument": {
"lambda": {
"parameter": "tp",
"domain": {"variable": "hydra.core.typing.TypeParameter"},
"body": {
"application": {
"function": {"variable": "hydra.core.print.model.printBinderName"},
"argument": {
"application": {
"function": {"project": {"typeName": "hydra.core.typing.TypeParameter", "fieldName": "name"}},
"argument": {"variable": "tp"}}}}}}}}},
"argument": {"variable": "typeParams"}}},
"typeScheme": {"variables": [], "body": {"list": {"literal": "string"}}, "constraints": []}}],
"body": {
"let": {
"bindings": [
{
"name": "constraintClassName",
"term": {
"lambda": {
"parameter": "c",
"domain": {"variable": "hydra.core.model.TypeClassConstraint"},
"body": {
"application": {
"function": {
"cases": {
"typeName": "hydra.core.model.TypeClassConstraint",
"cases": [
{
"name": "simple",
"handler": {
"lambda": {
"parameter": "n",
"domain": {"variable": "hydra.core.model.Name"},
"body": {"application": {"function": {"unwrap": "hydra.core.model.Name"}, "argument": {"variable": "n"}}}}}}]}},
"argument": {"variable": "c"}}}}},
"typeScheme": {
"variables": [],
"body": {"function": {"domain": {"variable": "hydra.core.model.TypeClassConstraint"}, "codomain": {"literal": "string"}}},
"constraints": []}}],
"body": {
"let": {
"bindings": [
{
"name": "toConstraintPairsForParam",
"term": {
"lambda": {
"parameter": "tp",
"domain": {"variable": "hydra.core.typing.TypeParameter"},
"body": {
"let": {
"bindings": [
{
"name": "v",
"term": {
"application": {
"function": {"project": {"typeName": "hydra.core.typing.TypeParameter", "fieldName": "name"}},
"argument": {"variable": "tp"}}},
"typeScheme": {"variables": [], "body": {"variable": "hydra.core.model.Name"}, "constraints": []}}],
"body": {
"application": {
"function": {
"application": {
"function": {
"typeApplication": {
"body": {
"typeApplication": {"body": {"variable": "hydra.core.lib.lists.map"}, "type": {"variable": "hydra.core.model.TypeClassConstraint"}}},
"type": {"literal": "string"}}},
"argument": {
"lambda": {
"parameter": "c",
"domain": {"variable": "hydra.core.model.TypeClassConstraint"},
"body": {
"application": {
"function": {"variable": "hydra.core.lib.strings.concat"},
"argument": {
"list": [
{"application": {"function": {"variable": "constraintClassName"}, "argument": {"variable": "c"}}},
{"literal": {"string": " "}},
{"application": {"function": {"unwrap": "hydra.core.model.Name"}, "argument": {"variable": "v"}}}]}}}}}}},
"argument": {
"application": {
"function": {
"application": {
"function": {
"typeApplication": {
"body": {
"typeApplication": {"body": {"variable": "hydra.core.lib.lists.sortBy"}, "type": {"variable": "hydra.core.model.TypeClassConstraint"}}},
"type": {"literal": "string"}}},
"argument": {"variable": "constraintClassName"}}},
"argument": {
"application": {
"function": {"project": {"typeName": "hydra.core.typing.TypeParameter", "fieldName": "constraints"}},
"argument": {"variable": "tp"}}}}}}}}}}},
"typeScheme": {
"variables": [],
"body": {"function": {"domain": {"variable": "hydra.core.typing.TypeParameter"}, "codomain": {"list": {"literal": "string"}}}},
"constraints": []}}],
"body": {
"let": {
"bindings": [
{
"name": "tc",
"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": {"variable": "hydra.core.typing.TypeParameter"}}},
"type": {"list": {"literal": "string"}}}},
"argument": {"variable": "toConstraintPairsForParam"}}},
"argument": {"variable": "typeParams"}}}}},
"typeScheme": {"variables": [], "body": {"list": {"literal": "string"}}, "constraints": []}}],
"body": {
"let": {
"bindings": [
{
"name": "paramStr",
"term": {
"lambda": {
"parameter": "p",
"domain": {"variable": "hydra.core.typing.Parameter"},
"body": {
"let": {
"bindings": [
{
"name": "tyStr",
"term": {
"application": {
"function": {
"application": {
"function": {"application": {"function": {"variable": "hydra.core.print.model.typeAtPrec"}, "argument": {"variable": "aliases"}}},
"argument": {"literal": {"integer": {"int32": 2}}}}},
"argument": {
"application": {
"function": {"project": {"typeName": "hydra.core.typing.Parameter", "fieldName": "type"}},
"argument": {"variable": "p"}}}}},
"typeScheme": {"variables": [], "body": {"literal": "string"}, "constraints": []}}],
"body": {
"let": {
"bindings": [
{
"name": "lazyStr",
"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.typing.Parameter", "fieldName": "isLazy"}},
"argument": {"variable": "p"}}}}},
"argument": {"literal": {"string": "lazy "}}}},
"argument": {"literal": {"string": ""}}}},
"typeScheme": {"variables": [], "body": {"literal": "string"}, "constraints": []}}],
"body": {
"application": {
"function": {"variable": "hydra.core.lib.strings.concat"},
"argument": {
"list": [
{
"application": {
"function": {"unwrap": "hydra.core.model.Name"},
"argument": {
"application": {
"function": {"project": {"typeName": "hydra.core.typing.Parameter", "fieldName": "name"}},
"argument": {"variable": "p"}}}}},
{"literal": {"string": ": "}},
{"variable": "lazyStr"},
{"variable": "tyStr"}]}}}}}}}}},
"typeScheme": {
"variables": [],
"body": {"function": {"domain": {"variable": "hydra.core.typing.Parameter"}, "codomain": {"literal": "string"}}},
"constraints": []}}],
"body": {
"let": {
"bindings": [
{
"name": "paramStrs",
"term": {
"application": {
"function": {
"application": {
"function": {
"typeApplication": {
"body": {
"typeApplication": {"body": {"variable": "hydra.core.lib.lists.map"}, "type": {"variable": "hydra.core.typing.Parameter"}}},
"type": {"literal": "string"}}},
"argument": {"variable": "paramStr"}}},
"argument": {"variable": "params"}}},
"typeScheme": {"variables": [], "body": {"list": {"literal": "string"}}, "constraints": []}}],
"body": {
"let": {
"bindings": [
{
"name": "resultStr",
"term": {
"application": {
"function": {
"application": {
"function": {"application": {"function": {"variable": "hydra.core.print.model.typeAtPrec"}, "argument": {"variable": "aliases"}}},
"argument": {"literal": {"integer": {"int32": 2}}}}},
"argument": {
"application": {
"function": {"project": {"typeName": "hydra.core.typing.Result", "fieldName": "type"}},
"argument": {"variable": "result"}}}}},
"typeScheme": {"variables": [], "body": {"literal": "string"}, "constraints": []}}],
"body": {
"let": {
"bindings": [
{
"name": "headerStr",
"term": {
"application": {
"function": {
"application": {
"function": {
"application": {
"function": {"typeApplication": {"body": {"variable": "hydra.core.lib.logic.ifElse"}, "type": {"literal": "string"}}},
"argument": {
"application": {
"function": {"typeApplication": {"body": {"variable": "hydra.core.lib.lists.isEmpty"}, "type": {"literal": "string"}}},
"argument": {"variable": "varNames"}}}}},
"argument": {"literal": {"string": ""}}}},
"argument": {
"application": {
"function": {"variable": "hydra.core.lib.strings.concat"},
"argument": {
"list": [
{"literal": {"string": "∀"}},
{
"application": {
"function": {"application": {"function": {"variable": "hydra.core.lib.strings.join"}, "argument": {"literal": {"string": ", "}}}},
"argument": {"variable": "varNames"}}},
{"literal": {"string": "."}},
{
"application": {
"function": {
"application": {
"function": {
"application": {
"function": {"typeApplication": {"body": {"variable": "hydra.core.lib.logic.ifElse"}, "type": {"literal": "string"}}},
"argument": {
"application": {
"function": {"typeApplication": {"body": {"variable": "hydra.core.lib.lists.isEmpty"}, "type": {"literal": "string"}}},
"argument": {"variable": "tc"}}}}},
"argument": {"literal": {"string": ""}}}},
"argument": {
"application": {
"function": {"variable": "hydra.core.lib.strings.concat"},
"argument": {
"list": [
{"literal": {"string": "("}},
{
"application": {
"function": {"application": {"function": {"variable": "hydra.core.lib.strings.join"}, "argument": {"literal": {"string": ", "}}}},
"argument": {"variable": "tc"}}},
{"literal": {"string": ") ⇒ "}}]}}}}}]}}}}},
"typeScheme": {"variables": [], "body": {"literal": "string"}, "constraints": []}}],
"body": {
"application": {
"function": {"variable": "hydra.core.lib.strings.concat"},
"argument": {
"list": [
{"variable": "headerStr"},
{"literal": {"string": "("}},
{
"application": {
"function": {"application": {"function": {"variable": "hydra.core.lib.strings.join"}, "argument": {"literal": {"string": ", "}}}},
"argument": {"variable": "paramStrs"}}},
{"literal": {"string": ") : "}},
{"variable": "resultStr"}]}}}}}}}}}}}}}}}}}}}}}}}}}}}}},
"annotation": {
"map": [
{
"key": {"variable": "description"},
"value": {
"literal": {
"string": "Show a primitive's signature as a string: a named parameter list and result type, shortening nominal references via the given alias map (#837)"}}}]}}}}},
{
"term": {
"name": "hydra.core.print.model.printBacktickedName",
"signature": {
"typeParameters": [],
"parameters": [{"name": "arg0", "type": {"literal": "string"}, "isLazy": false}],
"result": {"type": {"literal": "string"}}},
"body": {
"annotated": {
"body": {
"lambda": {
"parameter": "s",
"domain": {"literal": "string"},
"body": {
"application": {
"function": {"variable": "hydra.core.lib.strings.concat"},
"argument": {
"list": [
{"literal": {"string": "`"}},
{
"application": {
"function": {"variable": "hydra.core.lib.strings.concat"},
"argument": {
"application": {
"function": {
"application": {
"function": {
"typeApplication": {
"body": {"typeApplication": {"body": {"variable": "hydra.core.lib.lists.map"}, "type": {"literal": {"integer": "int32"}}}},
"type": {"literal": "string"}}},
"argument": {"variable": "hydra.core.print.model.escapeBacktickChar"}}},
"argument": {"application": {"function": {"variable": "hydra.core.lib.strings.toList"}, "argument": {"variable": "s"}}}}}}},
{"literal": {"string": "`"}}]}}}}},
"annotation": {
"map": [
{
"key": {"variable": "description"},
"value": {"literal": {"string": "Render a name in backticked form, escaping its content per #2.4."}}}]}}}}},
{
"term": {
"name": "hydra.core.print.model.printBinderName",
"signature": {
"typeParameters": [],
"parameters": [{"name": "arg0", "type": {"variable": "hydra.core.model.Name"}, "isLazy": false}],
"result": {"type": {"literal": "string"}}},
"body": {
"annotated": {
"body": {
"lambda": {
"parameter": "n",
"domain": {"variable": "hydra.core.model.Name"},
"body": {
"let": {
"bindings": [
{
"name": "s",
"term": {"application": {"function": {"unwrap": "hydra.core.model.Name"}, "argument": {"variable": "n"}}},
"typeScheme": {"variables": [], "body": {"literal": "string"}, "constraints": []}}],
"body": {
"application": {
"function": {
"application": {
"function": {
"application": {
"function": {"typeApplication": {"body": {"variable": "hydra.core.lib.logic.ifElse"}, "type": {"literal": "string"}}},
"argument": {
"application": {
"function": {
"application": {
"function": {"variable": "hydra.core.lib.logic.and"},
"argument": {"application": {"function": {"variable": "hydra.core.print.model.isBareSegment"}, "argument": {"variable": "s"}}}}},
"argument": {
"application": {
"function": {"variable": "hydra.core.lib.logic.not"},
"argument": {"application": {"function": {"variable": "hydra.core.print.model.isReservedWord"}, "argument": {"variable": "s"}}}}}}}}},
"argument": {"variable": "s"}}},
"argument": {"application": {"function": {"variable": "hydra.core.print.model.printBacktickedName"}, "argument": {"variable": "s"}}}}}}}}},
"annotation": {
"map": [
{
"key": {"variable": "description"},
"value": {"literal": {"string": "Show a binder-head name as a string; a dot forces backtick-escaping here (#2.4 case 3)."}}}]}}}}},
{
"term": {
"name": "hydra.core.print.model.printName",
"signature": {
"typeParameters": [],
"parameters": [{"name": "arg0", "type": {"variable": "hydra.core.model.Name"}, "isLazy": false}],
"result": {"type": {"literal": "string"}}},
"body": {
"annotated": {
"body": {
"lambda": {
"parameter": "n",
"domain": {"variable": "hydra.core.model.Name"},
"body": {
"let": {
"bindings": [
{
"name": "s",
"term": {"application": {"function": {"unwrap": "hydra.core.model.Name"}, "argument": {"variable": "n"}}},
"typeScheme": {"variables": [], "body": {"literal": "string"}, "constraints": []}}],
"body": {
"application": {
"function": {
"application": {
"function": {
"application": {
"function": {"typeApplication": {"body": {"variable": "hydra.core.lib.logic.ifElse"}, "type": {"literal": "string"}}},
"argument": {
"application": {
"function": {
"application": {
"function": {"variable": "hydra.core.lib.logic.and"},
"argument": {"application": {"function": {"variable": "hydra.core.print.model.isBareName"}, "argument": {"variable": "s"}}}}},
"argument": {
"application": {
"function": {"variable": "hydra.core.lib.logic.not"},
"argument": {"application": {"function": {"variable": "hydra.core.print.model.isReservedWord"}, "argument": {"variable": "s"}}}}}}}}},
"argument": {"variable": "s"}}},
"argument": {"application": {"function": {"variable": "hydra.core.print.model.printBacktickedName"}, "argument": {"variable": "s"}}}}}}}}},
"annotation": {
"map": [
{
"key": {"variable": "description"},
"value": {"literal": {"string": "Show a name as a string, backtick-escaping iff it is not bare or is a reserved word (#2.4)."}}}]}}}}},
{
"term": {
"name": "hydra.core.print.model.printNameAliased",
"signature": {
"typeParameters": [],
"parameters": [
{
"name": "arg0",
"type": {"map": {"keys": {"variable": "hydra.core.packaging.ModuleName"}, "values": {"literal": "string"}}},
"isLazy": false},
{"name": "arg1", "type": {"variable": "hydra.core.model.Name"}, "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": "n",
"domain": {"variable": "hydra.core.model.Name"},
"body": {
"let": {
"bindings": [
{
"name": "s",
"term": {"application": {"function": {"unwrap": "hydra.core.model.Name"}, "argument": {"variable": "n"}}},
"typeScheme": {"variables": [], "body": {"literal": "string"}, "constraints": []}}],
"body": {
"let": {
"bindings": [
{
"name": "segs",
"term": {
"application": {
"function": {"application": {"function": {"variable": "hydra.core.lib.strings.splitOn"}, "argument": {"literal": {"string": "."}}}},
"argument": {"variable": "s"}}},
"typeScheme": {"variables": [], "body": {"list": {"literal": "string"}}, "constraints": []}}],
"body": {
"let": {
"bindings": [
{
"name": "segCount",
"term": {
"application": {
"function": {"typeApplication": {"body": {"variable": "hydra.core.lib.lists.length"}, "type": {"literal": "string"}}},
"argument": {"variable": "segs"}}},
"typeScheme": {"variables": [], "body": {"literal": {"integer": "int32"}}, "constraints": []}}],
"body": {
"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.lt"}, "type": {"literal": {"integer": "int32"}}}},
"argument": {"variable": "segCount"}}},
"argument": {"literal": {"integer": {"int32": 2}}}}}}},
"argument": {"application": {"function": {"variable": "hydra.core.print.model.printName"}, "argument": {"variable": "n"}}}}},
"argument": {
"let": {
"bindings": [
{
"name": "dropCount",
"term": {
"application": {
"function": {
"application": {
"function": {"typeApplication": {"body": {"variable": "hydra.core.lib.math.sub"}, "type": {"literal": {"integer": "int32"}}}},
"argument": {"variable": "segCount"}}},
"argument": {"literal": {"integer": {"int32": 1}}}}},
"typeScheme": {"variables": [], "body": {"literal": {"integer": "int32"}}, "constraints": []}}],
"body": {
"let": {
"bindings": [
{
"name": "localName",
"term": {
"application": {
"function": {"application": {"function": {"variable": "hydra.core.lib.strings.join"}, "argument": {"literal": {"string": "."}}}},
"argument": {
"application": {
"function": {
"application": {
"function": {"typeApplication": {"body": {"variable": "hydra.core.lib.lists.drop"}, "type": {"literal": "string"}}},
"argument": {"variable": "dropCount"}}},
"argument": {"variable": "segs"}}}}},
"typeScheme": {"variables": [], "body": {"literal": "string"}, "constraints": []}}],
"body": {
"let": {
"bindings": [
{
"name": "modStr",
"term": {
"application": {
"function": {"application": {"function": {"variable": "hydra.core.lib.strings.join"}, "argument": {"literal": {"string": "."}}}},
"argument": {
"application": {
"function": {
"application": {
"function": {"typeApplication": {"body": {"variable": "hydra.core.lib.lists.take"}, "type": {"literal": "string"}}},
"argument": {"variable": "dropCount"}}},
"argument": {"variable": "segs"}}}}},
"typeScheme": {"variables": [], "body": {"literal": "string"}, "constraints": []}}],
"body": {
"let": {
"bindings": [
{
"name": "modName",
"term": {"wrap": {"typeName": "hydra.core.packaging.ModuleName", "body": {"variable": "modStr"}}},
"typeScheme": {"variables": [], "body": {"variable": "hydra.core.packaging.ModuleName"}, "constraints": []}}],
"body": {
"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": "modName"}}},
"argument": {"variable": "aliases"}}}}},
"argument": {"application": {"function": {"variable": "hydra.core.print.model.printName"}, "argument": {"variable": "n"}}}}},
"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": {
"application": {
"function": {"variable": "hydra.core.print.model.printName"},
"argument": {"wrap": {"typeName": "hydra.core.model.Name", "body": {"variable": "localName"}}}}}}},
"argument": {
"application": {
"function": {"variable": "hydra.core.print.model.printName"},
"argument": {
"wrap": {
"typeName": "hydra.core.model.Name",
"body": {
"application": {
"function": {"variable": "hydra.core.lib.strings.concat"},
"argument": {"list": [{"variable": "alias"}, {"literal": {"string": "."}}, {"variable": "localName"}]}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}},
"annotation": {
"map": [
{
"key": {"variable": "description"},
"value": {
"literal": {"string": "Show a nominal name, shortened via the given import-alias map when its module is aliased (#803)."}}}]}}}}},
{
"term": {
"name": "hydra.core.print.model.printStringLit",
"signature": {
"typeParameters": [],
"parameters": [{"name": "arg0", "type": {"literal": "string"}, "isLazy": false}],
"result": {"type": {"literal": "string"}}},
"body": {
"annotated": {
"body": {
"lambda": {
"parameter": "s",
"domain": {"literal": "string"},
"body": {
"application": {
"function": {"variable": "hydra.core.lib.strings.concat"},
"argument": {
"list": [
{"literal": {"string": "\""}},
{
"application": {
"function": {"variable": "hydra.core.lib.strings.concat"},
"argument": {
"application": {
"function": {
"application": {
"function": {
"typeApplication": {
"body": {"typeApplication": {"body": {"variable": "hydra.core.lib.lists.map"}, "type": {"literal": {"integer": "int32"}}}},
"type": {"literal": "string"}}},
"argument": {"variable": "hydra.core.print.model.escapeStringChar"}}},
"argument": {"application": {"function": {"variable": "hydra.core.lib.strings.toList"}, "argument": {"variable": "s"}}}}}}},
{"literal": {"string": "\""}}]}}}}},
"annotation": {
"map": [
{
"key": {"variable": "description"},
"value": {"literal": {"string": "Render a string as a double-quoted string-literal token, escaping its content per #2.5."}}}]}}}}},
{
"term": {
"name": "hydra.core.print.model.projection",
"signature": {
"typeParameters": [],
"parameters": [
{
"name": "arg0",
"type": {"map": {"keys": {"variable": "hydra.core.packaging.ModuleName"}, "values": {"literal": "string"}}},
"isLazy": false},
{"name": "arg1", "type": {"variable": "hydra.core.model.Projection"}, "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": "proj",
"domain": {"variable": "hydra.core.model.Projection"},
"body": {
"let": {
"bindings": [
{
"name": "tname",
"term": {
"application": {
"function": {
"application": {"function": {"variable": "hydra.core.print.model.printNameAliased"}, "argument": {"variable": "aliases"}}},
"argument": {
"application": {
"function": {"project": {"typeName": "hydra.core.model.Projection", "fieldName": "typeName"}},
"argument": {"variable": "proj"}}}}},
"typeScheme": {"variables": [], "body": {"literal": "string"}, "constraints": []}}],
"body": {
"let": {
"bindings": [
{
"name": "fname",
"term": {
"application": {
"function": {
"application": {"function": {"variable": "hydra.core.print.model.printNameAliased"}, "argument": {"variable": "aliases"}}},
"argument": {
"application": {
"function": {"project": {"typeName": "hydra.core.model.Projection", "fieldName": "fieldName"}},
"argument": {"variable": "proj"}}}}},
"typeScheme": {"variables": [], "body": {"literal": "string"}, "constraints": []}}],
"body": {
"application": {
"function": {"variable": "hydra.core.lib.strings.concat"},
"argument": {"list": [{"variable": "tname"}, {"literal": {"string": "["}}, {"variable": "fname"}, {"literal": {"string": "]"}}]}}}}}}}}}}},
"annotation": {
"map": [
{
"key": {"variable": "description"},
"value": {"literal": {"string": "Show a projection as a string, shortening the type name via the given import-alias map (#803)"}}}]}}}}},
{
"term": {
"name": "hydra.core.print.model.set",
"signature": {
"typeParameters": [{"name": "t0", "constraints": [{"simple": "ordering"}]}],
"parameters": [
{
"name": "arg0",
"type": {"function": {"domain": {"variable": "t0"}, "codomain": {"literal": "string"}}},
"isLazy": false},
{"name": "arg1", "type": {"set": {"variable": "t0"}}, "isLazy": false}],
"result": {"type": {"literal": "string"}}},
"body": {
"typeLambda": {
"parameter": "t0",
"body": {
"annotated": {
"body": {
"lambda": {
"parameter": "f",
"domain": {"function": {"domain": {"variable": "t0"}, "codomain": {"literal": "string"}}},
"body": {
"lambda": {
"parameter": "xs",
"domain": {"set": {"variable": "t0"}},
"body": {
"let": {
"bindings": [
{
"name": "elementStrs",
"term": {
"application": {
"function": {
"application": {
"function": {
"typeApplication": {
"body": {"typeApplication": {"body": {"variable": "hydra.core.lib.lists.map"}, "type": {"variable": "t0"}}},
"type": {"literal": "string"}}},
"argument": {"variable": "f"}}},
"argument": {
"application": {
"function": {"typeApplication": {"body": {"variable": "hydra.core.lib.lists.sort"}, "type": {"variable": "t0"}}},
"argument": {
"application": {
"function": {"typeApplication": {"body": {"variable": "hydra.core.lib.sets.toList"}, "type": {"variable": "t0"}}},
"argument": {"variable": "xs"}}}}}}},
"typeScheme": {"variables": [], "body": {"list": {"literal": "string"}}, "constraints": []}}],
"body": {
"application": {
"function": {"variable": "hydra.core.lib.strings.concat"},
"argument": {
"list": [
{"literal": {"string": "{"}},
{
"application": {
"function": {"application": {"function": {"variable": "hydra.core.lib.strings.join"}, "argument": {"literal": {"string": ", "}}}},
"argument": {"variable": "elementStrs"}}},
{"literal": {"string": "}"}}]}}}}}}}}},
"annotation": {
"map": [
{
"key": {"variable": "description"},
"value": {"literal": {"string": "Show a set using a given function to show each element, in canonical (ascending) order"}}}]}}}}}}},
{
"term": {
"name": "hydra.core.print.model.sugarField",
"signature": {
"typeParameters": [],
"parameters": [
{
"name": "arg0",
"type": {"map": {"keys": {"variable": "hydra.core.packaging.ModuleName"}, "values": {"literal": "string"}}},
"isLazy": false},
{"name": "arg1", "type": {"variable": "hydra.core.model.Field"}, "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": "field",
"domain": {"variable": "hydra.core.model.Field"},
"body": {
"let": {
"bindings": [
{
"name": "fname",
"term": {
"application": {
"function": {"variable": "hydra.core.print.model.printName"},
"argument": {
"application": {
"function": {"project": {"typeName": "hydra.core.model.Field", "fieldName": "name"}},
"argument": {"variable": "field"}}}}},
"typeScheme": {"variables": [], "body": {"literal": "string"}, "constraints": []}}],
"body": {
"let": {
"bindings": [
{
"name": "fterm",
"term": {
"application": {
"function": {"project": {"typeName": "hydra.core.model.Field", "fieldName": "term"}},
"argument": {"variable": "field"}}},
"typeScheme": {"variables": [], "body": {"variable": "hydra.core.model.Term"}, "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.print.model.fieldTermIsUnit"}, "argument": {"variable": "fterm"}}}}},
"argument": {"variable": "fname"}}},
"argument": {
"application": {
"function": {"variable": "hydra.core.lib.strings.concat"},
"argument": {
"list": [
{"variable": "fname"},
{"literal": {"string": " = "}},
{
"application": {
"function": {"application": {"function": {"variable": "hydra.core.print.model.termAliased"}, "argument": {"variable": "aliases"}}},
"argument": {"variable": "fterm"}}}]}}}}}}}}}}}}},
"annotation": {
"map": [
{
"key": {"variable": "description"},
"value": {
"literal": {"string": "Show a single field in sugar form: bareword 'name' for a unit value, else 'name = term' (#809)"}}}]}}}}},
{
"term": {
"name": "hydra.core.print.model.sugarFieldExprAliased",
"signature": {
"typeParameters": [],
"parameters": [
{"name": "arg0", "type": {"literal": {"integer": "int32"}}, "isLazy": false},
{
"name": "arg1",
"type": {"map": {"keys": {"variable": "hydra.core.packaging.ModuleName"}, "values": {"literal": "string"}}},
"isLazy": false},
{"name": "arg2", "type": {"variable": "hydra.core.model.Field"}, "isLazy": false}],
"result": {"type": {"variable": "hydra.core.ast.Expr"}}},
"body": {
"annotated": {
"body": {
"lambda": {
"parameter": "budget",
"domain": {"literal": {"integer": "int32"}},
"body": {
"lambda": {
"parameter": "aliases",
"domain": {"map": {"keys": {"variable": "hydra.core.packaging.ModuleName"}, "values": {"literal": "string"}}},
"body": {
"lambda": {
"parameter": "field",
"domain": {"variable": "hydra.core.model.Field"},
"body": {
"let": {
"bindings": [
{
"name": "fname",
"term": {
"application": {
"function": {"variable": "hydra.core.print.model.printName"},
"argument": {
"application": {
"function": {"project": {"typeName": "hydra.core.model.Field", "fieldName": "name"}},
"argument": {"variable": "field"}}}}},
"typeScheme": {"variables": [], "body": {"literal": "string"}, "constraints": []}}],
"body": {
"let": {
"bindings": [
{
"name": "fterm",
"term": {
"application": {
"function": {"project": {"typeName": "hydra.core.model.Field", "fieldName": "term"}},
"argument": {"variable": "field"}}},
"typeScheme": {"variables": [], "body": {"variable": "hydra.core.model.Term"}, "constraints": []}}],
"body": {
"application": {
"function": {
"application": {
"function": {
"application": {
"function": {"typeApplication": {"body": {"variable": "hydra.core.lib.logic.ifElse"}, "type": {"variable": "hydra.core.ast.Expr"}}},
"argument": {"application": {"function": {"variable": "hydra.core.print.model.fieldTermIsUnit"}, "argument": {"variable": "fterm"}}}}},
"argument": {"application": {"function": {"variable": "hydra.core.serialization.cst"}, "argument": {"variable": "fname"}}}}},
"argument": {
"let": {
"bindings": [
{
"name": "valueBudget",
"term": {
"application": {
"function": {
"application": {
"function": {"typeApplication": {"body": {"variable": "hydra.core.lib.math.sub"}, "type": {"literal": {"integer": "int32"}}}},
"argument": {"variable": "budget"}}},
"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": "fname"}}}}},
"argument": {"literal": {"integer": {"int32": 3}}}}}}},
"typeScheme": {"variables": [], "body": {"literal": {"integer": "int32"}}, "constraints": []}}],
"body": {
"let": {
"bindings": [
{
"name": "valueExpr",
"term": {
"application": {
"function": {
"application": {
"function": {
"application": {
"function": {
"application": {"function": {"variable": "hydra.core.print.model.termExprAtPrecBudget"}, "argument": {"variable": "valueBudget"}}},
"argument": {"variable": "aliases"}}},
"argument": {"literal": {"integer": {"int32": 0}}}}},
"argument": {"variable": "fterm"}}},
"typeScheme": {"variables": [], "body": {"variable": "hydra.core.ast.Expr"}, "constraints": []}}],
"body": {
"let": {
"bindings": [
{
"name": "eqOp",
"term": {
"record": {
"typeName": "hydra.core.ast.Op",
"fields": [
{
"name": "symbol",
"term": {"application": {"function": {"variable": "hydra.core.serialization.sym"}, "argument": {"literal": {"string": "="}}}}},
{
"name": "padding",
"term": {
"record": {
"typeName": "hydra.core.ast.Padding",
"fields": [
{"name": "left", "term": {"inject": {"typeName": "hydra.core.ast.Ws", "field": {"name": "space", "term": "unit"}}}},
{"name": "right", "term": {"inject": {"typeName": "hydra.core.ast.Ws", "field": {"name": "space", "term": "unit"}}}}]}}},
{
"name": "precedence",
"term": {"wrap": {"typeName": "hydra.core.ast.Precedence", "body": {"literal": {"integer": {"int32": 0}}}}}},
{
"name": "associativity",
"term": {"inject": {"typeName": "hydra.core.ast.Associativity", "field": {"name": "none", "term": "unit"}}}}]}},
"typeScheme": {"variables": [], "body": {"variable": "hydra.core.ast.Op"}, "constraints": []}}],
"body": {
"application": {
"function": {
"application": {
"function": {
"application": {
"function": {"typeApplication": {"body": {"variable": "hydra.core.lib.logic.ifElse"}, "type": {"variable": "hydra.core.ast.Expr"}}},
"argument": {"application": {"function": {"variable": "hydra.core.print.model.isBracketedTerm"}, "argument": {"variable": "fterm"}}}}},
"argument": {
"application": {
"function": {
"application": {
"function": {"application": {"function": {"variable": "hydra.core.serialization.ifx"}, "argument": {"variable": "eqOp"}}},
"argument": {"application": {"function": {"variable": "hydra.core.serialization.cst"}, "argument": {"variable": "fname"}}}}},
"argument": {"variable": "valueExpr"}}}}},
"argument": {
"application": {
"function": {
"application": {
"function": {"variable": "hydra.core.serialization.indentSubsequentLines"},
"argument": {"variable": "hydra.core.serialization.doubleSpace"}}},
"argument": {
"application": {
"function": {
"application": {
"function": {"application": {"function": {"variable": "hydra.core.serialization.ifx"}, "argument": {"variable": "eqOp"}}},
"argument": {"application": {"function": {"variable": "hydra.core.serialization.cst"}, "argument": {"variable": "fname"}}}}},
"argument": {"variable": "valueExpr"}}}}}}}}}}}}}}}}}}}}}}}}},
"annotation": {
"map": [
{
"key": {"variable": "description"},
"value": {
"literal": {
"string": "Show a single field as a line-layout sugar expression: bareword 'name' for a unit value, else 'name = term' (#809)"}}}]}}}}},
{
"term": {
"name": "hydra.core.print.model.sugarFields",
"signature": {
"typeParameters": [],
"parameters": [
{
"name": "arg0",
"type": {"map": {"keys": {"variable": "hydra.core.packaging.ModuleName"}, "values": {"literal": "string"}}},
"isLazy": false},
{"name": "arg1", "type": {"list": {"variable": "hydra.core.model.Field"}}, "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": "flds",
"domain": {"list": {"variable": "hydra.core.model.Field"}},
"body": {
"let": {
"bindings": [
{
"name": "fieldStrs",
"term": {
"application": {
"function": {
"application": {
"function": {
"typeApplication": {
"body": {"typeApplication": {"body": {"variable": "hydra.core.lib.lists.map"}, "type": {"variable": "hydra.core.model.Field"}}},
"type": {"literal": "string"}}},
"argument": {"application": {"function": {"variable": "hydra.core.print.model.sugarField"}, "argument": {"variable": "aliases"}}}}},
"argument": {"variable": "flds"}}},
"typeScheme": {"variables": [], "body": {"list": {"literal": "string"}}, "constraints": []}}],
"body": {
"application": {
"function": {"variable": "hydra.core.lib.strings.concat"},
"argument": {
"list": [
{"literal": {"string": "{"}},
{
"application": {
"function": {"application": {"function": {"variable": "hydra.core.lib.strings.join"}, "argument": {"literal": {"string": ", "}}}},
"argument": {"variable": "fieldStrs"}}},
{"literal": {"string": "}"}}]}}}}}}}}},
"annotation": {
"map": [
{
"key": {"variable": "description"},
"value": {"literal": {"string": "Show fields as nominal-construction sugar, abbreviating unit-valued fields bareword (#809)"}}}]}}}}},
{
"term": {
"name": "hydra.core.print.model.sugarFieldsExprAliased",
"signature": {
"typeParameters": [],
"parameters": [
{"name": "arg0", "type": {"literal": {"integer": "int32"}}, "isLazy": false},
{
"name": "arg1",
"type": {"map": {"keys": {"variable": "hydra.core.packaging.ModuleName"}, "values": {"literal": "string"}}},
"isLazy": false},
{"name": "arg2", "type": {"list": {"variable": "hydra.core.model.Field"}}, "isLazy": false}],
"result": {"type": {"variable": "hydra.core.ast.Expr"}}},
"body": {
"annotated": {
"body": {
"lambda": {
"parameter": "budget",
"domain": {"literal": {"integer": "int32"}},
"body": {
"lambda": {
"parameter": "aliases",
"domain": {"map": {"keys": {"variable": "hydra.core.packaging.ModuleName"}, "values": {"literal": "string"}}},
"body": {
"lambda": {
"parameter": "flds",
"domain": {"list": {"variable": "hydra.core.model.Field"}},
"body": {
"let": {
"bindings": [
{
"name": "fieldExprs",
"term": {
"application": {
"function": {
"application": {
"function": {
"typeApplication": {
"body": {"typeApplication": {"body": {"variable": "hydra.core.lib.lists.map"}, "type": {"variable": "hydra.core.model.Field"}}},
"type": {"variable": "hydra.core.ast.Expr"}}},
"argument": {
"application": {
"function": {
"application": {
"function": {"variable": "hydra.core.print.model.sugarFieldExprAliased"},
"argument": {
"application": {
"function": {
"application": {
"function": {"typeApplication": {"body": {"variable": "hydra.core.lib.math.sub"}, "type": {"literal": {"integer": "int32"}}}},
"argument": {"variable": "budget"}}},
"argument": {"literal": {"integer": {"int32": 2}}}}}}},
"argument": {"variable": "aliases"}}}}},
"argument": {"variable": "flds"}}},
"typeScheme": {"variables": [], "body": {"list": {"variable": "hydra.core.ast.Expr"}}, "constraints": []}}],
"body": {
"application": {
"function": {
"application": {
"function": {"application": {"function": {"variable": "hydra.core.serialization.chooseLayout"}, "argument": {"variable": "budget"}}},
"argument": {
"application": {
"function": {
"application": {
"function": {
"application": {
"function": {"variable": "hydra.core.serialization.curlyBracesList"},
"argument": {"typeApplication": {"body": {"optional": null}, "type": {"literal": "string"}}}}},
"argument": {"variable": "hydra.core.serialization.inlineStyle"}}},
"argument": {"variable": "fieldExprs"}}}}},
"argument": {
"application": {
"function": {
"application": {
"function": {
"application": {
"function": {"variable": "hydra.core.serialization.curlyBracesList"},
"argument": {"typeApplication": {"body": {"optional": null}, "type": {"literal": "string"}}}}},
"argument": {"variable": "hydra.core.serialization.halfBlockStyle"}}},
"argument": {"variable": "fieldExprs"}}}}}}}}}}}}},
"annotation": {
"map": [
{
"key": {"variable": "description"},
"value": {
"literal": {
"string": "Show fields as a line-layout nominal-construction-sugar expression, abbreviating unit-valued fields bareword (#809)"}}}]}}}}},
{
"term": {
"name": "hydra.core.print.model.term",
"signature": {
"typeParameters": [],
"parameters": [{"name": "arg0", "type": {"variable": "hydra.core.model.Term"}, "isLazy": false}],
"result": {"type": {"literal": "string"}}},
"body": {
"annotated": {
"body": {
"application": {
"function": {"variable": "hydra.core.print.model.termAliased"},
"argument": {
"typeApplication": {
"body": {
"typeApplication": {"body": {"variable": "hydra.core.lib.maps.empty"}, "type": {"variable": "hydra.core.packaging.ModuleName"}}},
"type": {"literal": "string"}}}}},
"annotation": {"map": [{"key": {"variable": "description"}, "value": {"literal": {"string": "Show a term as a string"}}}]}}}}},
{
"term": {
"name": "hydra.core.print.model.termAliased",
"signature": {
"typeParameters": [],
"parameters": [
{
"name": "arg0",
"type": {"map": {"keys": {"variable": "hydra.core.packaging.ModuleName"}, "values": {"literal": "string"}}},
"isLazy": false},
{"name": "arg1", "type": {"variable": "hydra.core.model.Term"}, "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": "t",
"domain": {"variable": "hydra.core.model.Term"},
"body": {
"application": {
"function": {"variable": "hydra.core.serialization.printExpr"},
"argument": {
"application": {
"function": {
"application": {"function": {"variable": "hydra.core.print.model.termExprAliased"}, "argument": {"variable": "aliases"}}},
"argument": {"variable": "t"}}}}}}}}},
"annotation": {
"map": [
{
"key": {"variable": "description"},
"value": {"literal": {"string": "Show a term as a string, shortening nominal references via the given import-alias map (#803)"}}}]}}}}},
{
"term": {
"name": "hydra.core.print.model.termAtPrec",
"signature": {
"typeParameters": [],
"parameters": [
{
"name": "arg0",
"type": {"map": {"keys": {"variable": "hydra.core.packaging.ModuleName"}, "values": {"literal": "string"}}},
"isLazy": false},
{"name": "arg1", "type": {"literal": {"integer": "int32"}}, "isLazy": false},
{"name": "arg2", "type": {"variable": "hydra.core.model.Term"}, "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": "ctx",
"domain": {"literal": {"integer": "int32"}},
"body": {
"lambda": {
"parameter": "t",
"domain": {"variable": "hydra.core.model.Term"},
"body": {
"application": {
"function": {"variable": "hydra.core.serialization.printExpr"},
"argument": {
"application": {
"function": {
"application": {
"function": {
"application": {"function": {"variable": "hydra.core.print.model.termExprAtPrec"}, "argument": {"variable": "aliases"}}},
"argument": {"variable": "ctx"}}},
"argument": {"variable": "t"}}}}}}}}}}},
"annotation": {
"map": [
{
"key": {"variable": "description"},
"value": {"literal": {"string": "Show a term as a string at a given minimum context precedence, adding minimal parentheses"}}}]}}}}},
{
"term": {
"name": "hydra.core.print.model.termExprAliased",
"signature": {
"typeParameters": [],
"parameters": [
{
"name": "arg0",
"type": {"map": {"keys": {"variable": "hydra.core.packaging.ModuleName"}, "values": {"literal": "string"}}},
"isLazy": false},
{"name": "arg1", "type": {"variable": "hydra.core.model.Term"}, "isLazy": false}],
"result": {"type": {"variable": "hydra.core.ast.Expr"}}},
"body": {
"annotated": {
"body": {
"lambda": {
"parameter": "aliases",
"domain": {"map": {"keys": {"variable": "hydra.core.packaging.ModuleName"}, "values": {"literal": "string"}}},
"body": {
"lambda": {
"parameter": "t",
"domain": {"variable": "hydra.core.model.Term"},
"body": {
"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": "t"}}}}}}},
"annotation": {
"map": [
{
"key": {"variable": "description"},
"value": {
"literal": {
"string": "Show a term as a line-layout expression at the top-level context, shortening nominal references via the given import-alias map (#803)"}}}]}}}}},
{
"term": {
"name": "hydra.core.print.model.termExprAtPrec",
"signature": {
"typeParameters": [],
"parameters": [
{
"name": "arg0",
"type": {"map": {"keys": {"variable": "hydra.core.packaging.ModuleName"}, "values": {"literal": "string"}}},
"isLazy": false},
{"name": "arg1", "type": {"literal": {"integer": "int32"}}, "isLazy": false},
{"name": "arg2", "type": {"variable": "hydra.core.model.Term"}, "isLazy": false}],
"result": {"type": {"variable": "hydra.core.ast.Expr"}}},
"body": {
"annotated": {
"body": {
"lambda": {
"parameter": "aliases",
"domain": {"map": {"keys": {"variable": "hydra.core.packaging.ModuleName"}, "values": {"literal": "string"}}},
"body": {
"lambda": {
"parameter": "ctx",
"domain": {"literal": {"integer": "int32"}},
"body": {
"lambda": {
"parameter": "t",
"domain": {"variable": "hydra.core.model.Term"},
"body": {
"application": {
"function": {
"application": {
"function": {
"application": {
"function": {
"application": {
"function": {"variable": "hydra.core.print.model.termExprAtPrecBudget"},
"argument": {"variable": "hydra.core.serialization.maxLineWidth"}}},
"argument": {"variable": "aliases"}}},
"argument": {"variable": "ctx"}}},
"argument": {"variable": "t"}}}}}}}}},
"annotation": {
"map": [
{
"key": {"variable": "description"},
"value": {
"literal": {
"string": "Show a term as a line-layout expression at a given minimum context precedence, with a full line-width budget"}}}]}}}}},
{
"term": {
"name": "hydra.core.print.model.termExprAtPrecBudget",
"signature": {
"typeParameters": [],
"parameters": [
{"name": "arg0", "type": {"literal": {"integer": "int32"}}, "isLazy": false},
{
"name": "arg1",
"type": {"map": {"keys": {"variable": "hydra.core.packaging.ModuleName"}, "values": {"literal": "string"}}},
"isLazy": false},
{"name": "arg2", "type": {"literal": {"integer": "int32"}}, "isLazy": false},
{"name": "arg3", "type": {"variable": "hydra.core.model.Term"}, "isLazy": false}],
"result": {"type": {"variable": "hydra.core.ast.Expr"}}},
"body": {
"annotated": {
"body": {
"lambda": {
"parameter": "budget",
"domain": {"literal": {"integer": "int32"}},
"body": {
"lambda": {
"parameter": "aliases",
"domain": {"map": {"keys": {"variable": "hydra.core.packaging.ModuleName"}, "values": {"literal": "string"}}},
"body": {
"lambda": {
"parameter": "ctx",
"domain": {"literal": {"integer": "int32"}},
"body": {
"lambda": {
"parameter": "t",
"domain": {"variable": "hydra.core.model.Term"},
"body": {
"let": {
"bindings": [
{
"name": "gatherTerms",
"term": {
"lambda": {
"parameter": "prev",
"domain": {"list": {"variable": "hydra.core.model.Term"}},
"body": {
"lambda": {
"parameter": "app",
"domain": {"variable": "hydra.core.model.Application"},
"body": {
"let": {
"bindings": [
{
"name": "lhs",
"term": {
"application": {
"function": {"project": {"typeName": "hydra.core.model.Application", "fieldName": "function"}},
"argument": {"variable": "app"}}},
"typeScheme": {"variables": [], "body": {"variable": "hydra.core.model.Term"}, "constraints": []}}],
"body": {
"let": {
"bindings": [
{
"name": "rhs",
"term": {
"application": {
"function": {"project": {"typeName": "hydra.core.model.Application", "fieldName": "argument"}},
"argument": {"variable": "app"}}},
"typeScheme": {"variables": [], "body": {"variable": "hydra.core.model.Term"}, "constraints": []}}],
"body": {
"application": {
"function": {
"cases": {
"typeName": "hydra.core.model.Term",
"default": {
"application": {
"function": {
"application": {
"function": {"typeApplication": {"body": {"variable": "hydra.core.lib.lists.cons"}, "type": {"variable": "hydra.core.model.Term"}}},
"argument": {"variable": "lhs"}}},
"argument": {
"application": {
"function": {
"application": {
"function": {"typeApplication": {"body": {"variable": "hydra.core.lib.lists.cons"}, "type": {"variable": "hydra.core.model.Term"}}},
"argument": {"variable": "rhs"}}},
"argument": {"variable": "prev"}}}}},
"cases": [
{
"name": "application",
"handler": {
"lambda": {
"parameter": "app2",
"domain": {"variable": "hydra.core.model.Application"},
"body": {
"application": {
"function": {
"application": {
"function": {"variable": "gatherTerms"},
"argument": {
"application": {
"function": {
"application": {
"function": {"typeApplication": {"body": {"variable": "hydra.core.lib.lists.cons"}, "type": {"variable": "hydra.core.model.Term"}}},
"argument": {"variable": "rhs"}}},
"argument": {"variable": "prev"}}}}},
"argument": {"variable": "app2"}}}}}}]}},
"argument": {"variable": "lhs"}}}}}}}}}}},
"typeScheme": {
"variables": [],
"body": {
"function": {
"domain": {"list": {"variable": "hydra.core.model.Term"}},
"codomain": {
"function": {"domain": {"variable": "hydra.core.model.Application"}, "codomain": {"list": {"variable": "hydra.core.model.Term"}}}}}},
"constraints": []}}],
"body": {
"application": {
"function": {
"cases": {
"typeName": "hydra.core.model.Term",
"cases": [
{
"name": "annotated",
"handler": {
"lambda": {
"parameter": "at",
"domain": {"variable": "hydra.core.model.AnnotatedTerm"},
"body": {
"let": {
"bindings": [
{
"name": "bodyExpr",
"term": {
"application": {
"function": {
"application": {
"function": {
"application": {
"function": {
"application": {"function": {"variable": "hydra.core.print.model.termExprAtPrecBudget"}, "argument": {"variable": "budget"}}},
"argument": {"variable": "aliases"}}},
"argument": {"literal": {"integer": {"int32": 3}}}}},
"argument": {
"application": {
"function": {"project": {"typeName": "hydra.core.model.AnnotatedTerm", "fieldName": "body"}},
"argument": {"variable": "at"}}}}},
"typeScheme": {"variables": [], "body": {"variable": "hydra.core.ast.Expr"}, "constraints": []}}],
"body": {
"let": {
"bindings": [
{
"name": "annExpr",
"term": {
"application": {
"function": {
"application": {
"function": {
"application": {
"function": {
"application": {"function": {"variable": "hydra.core.print.model.termExprAtPrecBudget"}, "argument": {"variable": "budget"}}},
"argument": {"variable": "aliases"}}},
"argument": {"literal": {"integer": {"int32": 3}}}}},
"argument": {
"application": {
"function": {"project": {"typeName": "hydra.core.model.AnnotatedTerm", "fieldName": "annotation"}},
"argument": {"variable": "at"}}}}},
"typeScheme": {"variables": [], "body": {"variable": "hydra.core.ast.Expr"}, "constraints": []}}],
"body": {
"application": {
"function": {
"application": {
"function": {
"application": {
"function": {"typeApplication": {"body": {"variable": "hydra.core.lib.logic.ifElse"}, "type": {"variable": "hydra.core.ast.Expr"}}},
"argument": {
"application": {
"function": {
"application": {
"function": {"typeApplication": {"body": {"variable": "hydra.core.lib.ordering.lt"}, "type": {"literal": {"integer": "int32"}}}},
"argument": {"literal": {"integer": {"int32": 3}}}}},
"argument": {"variable": "ctx"}}}}},
"argument": {
"application": {
"function": {"variable": "hydra.core.serialization.parens"},
"argument": {
"application": {
"function": {
"application": {
"function": {
"application": {
"function": {"variable": "hydra.core.serialization.ifx"},
"argument": {
"record": {
"typeName": "hydra.core.ast.Op",
"fields": [
{
"name": "symbol",
"term": {"application": {"function": {"variable": "hydra.core.serialization.sym"}, "argument": {"literal": {"string": "@"}}}}},
{
"name": "padding",
"term": {
"record": {
"typeName": "hydra.core.ast.Padding",
"fields": [
{"name": "left", "term": {"inject": {"typeName": "hydra.core.ast.Ws", "field": {"name": "none", "term": "unit"}}}},
{"name": "right", "term": {"inject": {"typeName": "hydra.core.ast.Ws", "field": {"name": "none", "term": "unit"}}}}]}}},
{
"name": "precedence",
"term": {"wrap": {"typeName": "hydra.core.ast.Precedence", "body": {"literal": {"integer": {"int32": 0}}}}}},
{
"name": "associativity",
"term": {"inject": {"typeName": "hydra.core.ast.Associativity", "field": {"name": "none", "term": "unit"}}}}]}}}},
"argument": {"variable": "bodyExpr"}}},
"argument": {"variable": "annExpr"}}}}}}},
"argument": {
"application": {
"function": {
"application": {
"function": {
"application": {
"function": {"variable": "hydra.core.serialization.ifx"},
"argument": {
"record": {
"typeName": "hydra.core.ast.Op",
"fields": [
{
"name": "symbol",
"term": {"application": {"function": {"variable": "hydra.core.serialization.sym"}, "argument": {"literal": {"string": "@"}}}}},
{
"name": "padding",
"term": {
"record": {
"typeName": "hydra.core.ast.Padding",
"fields": [
{"name": "left", "term": {"inject": {"typeName": "hydra.core.ast.Ws", "field": {"name": "none", "term": "unit"}}}},
{"name": "right", "term": {"inject": {"typeName": "hydra.core.ast.Ws", "field": {"name": "none", "term": "unit"}}}}]}}},
{
"name": "precedence",
"term": {"wrap": {"typeName": "hydra.core.ast.Precedence", "body": {"literal": {"integer": {"int32": 0}}}}}},
{
"name": "associativity",
"term": {"inject": {"typeName": "hydra.core.ast.Associativity", "field": {"name": "none", "term": "unit"}}}}]}}}},
"argument": {"variable": "bodyExpr"}}},
"argument": {"variable": "annExpr"}}}}}}}}}}}},
{
"name": "application",
"handler": {
"lambda": {
"parameter": "app",
"domain": {"variable": "hydra.core.model.Application"},
"body": {
"let": {
"bindings": [
{
"name": "terms",
"term": {
"application": {
"function": {
"application": {
"function": {"variable": "gatherTerms"},
"argument": {"typeApplication": {"body": {"list": []}, "type": {"variable": "hydra.core.model.Term"}}}}},
"argument": {"variable": "app"}}},
"typeScheme": {"variables": [], "body": {"list": {"variable": "hydra.core.model.Term"}}, "constraints": []}}],
"body": {
"let": {
"bindings": [
{
"name": "termExprs",
"term": {
"application": {
"function": {
"application": {
"function": {
"typeApplication": {
"body": {"typeApplication": {"body": {"variable": "hydra.core.lib.lists.map"}, "type": {"variable": "hydra.core.model.Term"}}},
"type": {"variable": "hydra.core.ast.Expr"}}},
"argument": {
"lambda": {
"parameter": "e",
"domain": {"variable": "hydra.core.model.Term"},
"body": {
"application": {
"function": {
"application": {
"function": {
"application": {
"function": {
"application": {"function": {"variable": "hydra.core.print.model.termExprAtPrecBudget"}, "argument": {"variable": "budget"}}},
"argument": {"variable": "aliases"}}},
"argument": {"literal": {"integer": {"int32": 3}}}}},
"argument": {"variable": "e"}}}}}}},
"argument": {"variable": "terms"}}},
"typeScheme": {"variables": [], "body": {"list": {"variable": "hydra.core.ast.Expr"}}, "constraints": []}}],
"body": {
"application": {
"function": {
"application": {
"function": {
"application": {
"function": {"typeApplication": {"body": {"variable": "hydra.core.lib.logic.ifElse"}, "type": {"variable": "hydra.core.ast.Expr"}}},
"argument": {
"application": {
"function": {
"application": {
"function": {"typeApplication": {"body": {"variable": "hydra.core.lib.ordering.lt"}, "type": {"literal": {"integer": "int32"}}}},
"argument": {"literal": {"integer": {"int32": 2}}}}},
"argument": {"variable": "ctx"}}}}},
"argument": {
"application": {
"function": {"variable": "hydra.core.serialization.parens"},
"argument": {
"let": {
"bindings": [
{
"name": "headExpr",
"term": {
"application": {
"function": {
"application": {
"function": {
"typeApplication": {"body": {"variable": "hydra.core.lib.optionals.withDefault"}, "type": {"variable": "hydra.core.ast.Expr"}}},
"argument": {"application": {"function": {"variable": "hydra.core.serialization.cst"}, "argument": {"literal": {"string": ""}}}}}},
"argument": {
"application": {
"function": {"typeApplication": {"body": {"variable": "hydra.core.lib.lists.head"}, "type": {"variable": "hydra.core.ast.Expr"}}},
"argument": {"variable": "termExprs"}}}}},
"typeScheme": {"variables": [], "body": {"variable": "hydra.core.ast.Expr"}, "constraints": []}}],
"body": {
"let": {
"bindings": [
{
"name": "argExprs",
"term": {
"application": {
"function": {
"application": {
"function": {"typeApplication": {"body": {"variable": "hydra.core.lib.lists.drop"}, "type": {"variable": "hydra.core.ast.Expr"}}},
"argument": {"literal": {"integer": {"int32": 1}}}}},
"argument": {"variable": "termExprs"}}},
"typeScheme": {"variables": [], "body": {"list": {"variable": "hydra.core.ast.Expr"}}, "constraints": []}}],
"body": {
"let": {
"bindings": [
{
"name": "effectiveBudget",
"term": {
"application": {
"function": {
"application": {
"function": {"typeApplication": {"body": {"variable": "hydra.core.lib.ordering.max"}, "type": {"literal": {"integer": "int32"}}}},
"argument": {"variable": "budget"}}},
"argument": {"literal": {"integer": {"int32": 40}}}}},
"typeScheme": {"variables": [], "body": {"literal": {"integer": "int32"}}, "constraints": []}}],
"body": {
"application": {
"function": {
"application": {
"function": {
"application": {
"function": {"typeApplication": {"body": {"variable": "hydra.core.lib.logic.ifElse"}, "type": {"variable": "hydra.core.ast.Expr"}}},
"argument": {
"application": {
"function": {"typeApplication": {"body": {"variable": "hydra.core.lib.lists.isEmpty"}, "type": {"variable": "hydra.core.ast.Expr"}}},
"argument": {"variable": "argExprs"}}}}},
"argument": {"variable": "headExpr"}}},
"argument": {
"application": {
"function": {
"application": {
"function": {
"application": {"function": {"variable": "hydra.core.serialization.chooseLayout"}, "argument": {"variable": "effectiveBudget"}}},
"argument": {"application": {"function": {"variable": "hydra.core.serialization.spaceSep"}, "argument": {"variable": "termExprs"}}}}},
"argument": {
"application": {
"function": {
"application": {
"function": {
"application": {
"function": {"variable": "hydra.core.serialization.ifx"},
"argument": {
"record": {
"typeName": "hydra.core.ast.Op",
"fields": [
{
"name": "symbol",
"term": {"application": {"function": {"variable": "hydra.core.serialization.sym"}, "argument": {"literal": {"string": ""}}}}},
{
"name": "padding",
"term": {
"record": {
"typeName": "hydra.core.ast.Padding",
"fields": [
{"name": "left", "term": {"inject": {"typeName": "hydra.core.ast.Ws", "field": {"name": "none", "term": "unit"}}}},
{
"name": "right",
"term": {
"inject": {
"typeName": "hydra.core.ast.Ws",
"field": {"name": "breakAndIndent", "term": {"variable": "hydra.core.serialization.doubleSpace"}}}}}]}}},
{
"name": "precedence",
"term": {"wrap": {"typeName": "hydra.core.ast.Precedence", "body": {"literal": {"integer": {"int32": 0}}}}}},
{
"name": "associativity",
"term": {"inject": {"typeName": "hydra.core.ast.Associativity", "field": {"name": "none", "term": "unit"}}}}]}}}},
"argument": {"variable": "headExpr"}}},
"argument": {"application": {"function": {"variable": "hydra.core.serialization.newlineSep"}, "argument": {"variable": "argExprs"}}}}}}}}}}}}}}}}}}},
"argument": {
"let": {
"bindings": [
{
"name": "headExpr",
"term": {
"application": {
"function": {
"application": {
"function": {
"typeApplication": {"body": {"variable": "hydra.core.lib.optionals.withDefault"}, "type": {"variable": "hydra.core.ast.Expr"}}},
"argument": {"application": {"function": {"variable": "hydra.core.serialization.cst"}, "argument": {"literal": {"string": ""}}}}}},
"argument": {
"application": {
"function": {"typeApplication": {"body": {"variable": "hydra.core.lib.lists.head"}, "type": {"variable": "hydra.core.ast.Expr"}}},
"argument": {"variable": "termExprs"}}}}},
"typeScheme": {"variables": [], "body": {"variable": "hydra.core.ast.Expr"}, "constraints": []}}],
"body": {
"let": {
"bindings": [
{
"name": "argExprs",
"term": {
"application": {
"function": {
"application": {
"function": {"typeApplication": {"body": {"variable": "hydra.core.lib.lists.drop"}, "type": {"variable": "hydra.core.ast.Expr"}}},
"argument": {"literal": {"integer": {"int32": 1}}}}},
"argument": {"variable": "termExprs"}}},
"typeScheme": {"variables": [], "body": {"list": {"variable": "hydra.core.ast.Expr"}}, "constraints": []}}],
"body": {
"let": {
"bindings": [
{
"name": "effectiveBudget",
"term": {
"application": {
"function": {
"application": {
"function": {"typeApplication": {"body": {"variable": "hydra.core.lib.ordering.max"}, "type": {"literal": {"integer": "int32"}}}},
"argument": {"variable": "budget"}}},
"argument": {"literal": {"integer": {"int32": 40}}}}},
"typeScheme": {"variables": [], "body": {"literal": {"integer": "int32"}}, "constraints": []}}],
"body": {
"application": {
"function": {
"application": {
"function": {
"application": {
"function": {"typeApplication": {"body": {"variable": "hydra.core.lib.logic.ifElse"}, "type": {"variable": "hydra.core.ast.Expr"}}},
"argument": {
"application": {
"function": {"typeApplication": {"body": {"variable": "hydra.core.lib.lists.isEmpty"}, "type": {"variable": "hydra.core.ast.Expr"}}},
"argument": {"variable": "argExprs"}}}}},
"argument": {"variable": "headExpr"}}},
"argument": {
"application": {
"function": {
"application": {
"function": {
"application": {"function": {"variable": "hydra.core.serialization.chooseLayout"}, "argument": {"variable": "effectiveBudget"}}},
"argument": {"application": {"function": {"variable": "hydra.core.serialization.spaceSep"}, "argument": {"variable": "termExprs"}}}}},
"argument": {
"application": {
"function": {
"application": {
"function": {
"application": {
"function": {"variable": "hydra.core.serialization.ifx"},
"argument": {
"record": {
"typeName": "hydra.core.ast.Op",
"fields": [
{
"name": "symbol",
"term": {"application": {"function": {"variable": "hydra.core.serialization.sym"}, "argument": {"literal": {"string": ""}}}}},
{
"name": "padding",
"term": {
"record": {
"typeName": "hydra.core.ast.Padding",
"fields": [
{"name": "left", "term": {"inject": {"typeName": "hydra.core.ast.Ws", "field": {"name": "none", "term": "unit"}}}},
{
"name": "right",
"term": {
"inject": {
"typeName": "hydra.core.ast.Ws",
"field": {"name": "breakAndIndent", "term": {"variable": "hydra.core.serialization.doubleSpace"}}}}}]}}},
{
"name": "precedence",
"term": {"wrap": {"typeName": "hydra.core.ast.Precedence", "body": {"literal": {"integer": {"int32": 0}}}}}},
{
"name": "associativity",
"term": {"inject": {"typeName": "hydra.core.ast.Associativity", "field": {"name": "none", "term": "unit"}}}}]}}}},
"argument": {"variable": "headExpr"}}},
"argument": {"application": {"function": {"variable": "hydra.core.serialization.newlineSep"}, "argument": {"variable": "argExprs"}}}}}}}}}}}}}}}}}}}}}}}},
{
"name": "cases",
"handler": {
"lambda": {
"parameter": "cs",
"domain": {"variable": "hydra.core.model.CaseStatement"},
"body": {
"application": {
"function": {
"application": {
"function": {
"application": {"function": {"variable": "hydra.core.print.model.caseStatementExprAliased"}, "argument": {"variable": "budget"}}},
"argument": {"variable": "aliases"}}},
"argument": {"variable": "cs"}}}}}},
{
"name": "either",
"handler": {
"lambda": {
"parameter": "e",
"domain": {"either": {"left": {"variable": "hydra.core.model.Term"}, "right": {"variable": "hydra.core.model.Term"}}},
"body": {
"application": {
"function": {
"application": {
"function": {
"application": {
"function": {
"typeApplication": {
"body": {
"typeApplication": {
"body": {
"typeApplication": {"body": {"variable": "hydra.core.lib.eithers.either"}, "type": {"variable": "hydra.core.model.Term"}}},
"type": {"variable": "hydra.core.model.Term"}}},
"type": {"variable": "hydra.core.ast.Expr"}}},
"argument": {
"lambda": {
"parameter": "l",
"domain": {"variable": "hydra.core.model.Term"},
"body": {
"application": {
"function": {"application": {"function": {"variable": "hydra.core.serialization.suffix"}, "argument": {"literal": {"string": ")"}}}},
"argument": {
"application": {
"function": {
"application": {"function": {"variable": "hydra.core.serialization.prefix"}, "argument": {"literal": {"string": "left("}}}},
"argument": {
"application": {
"function": {
"application": {
"function": {
"application": {
"function": {
"application": {
"function": {"variable": "hydra.core.print.model.termExprAtPrecBudget"},
"argument": {
"application": {
"function": {
"application": {
"function": {"typeApplication": {"body": {"variable": "hydra.core.lib.math.sub"}, "type": {"literal": {"integer": "int32"}}}},
"argument": {"variable": "budget"}}},
"argument": {"literal": {"integer": {"int32": 5}}}}}}},
"argument": {"variable": "aliases"}}},
"argument": {"literal": {"integer": {"int32": 0}}}}},
"argument": {"variable": "l"}}}}}}}}}}},
"argument": {
"lambda": {
"parameter": "r",
"domain": {"variable": "hydra.core.model.Term"},
"body": {
"application": {
"function": {"application": {"function": {"variable": "hydra.core.serialization.suffix"}, "argument": {"literal": {"string": ")"}}}},
"argument": {
"application": {
"function": {
"application": {"function": {"variable": "hydra.core.serialization.prefix"}, "argument": {"literal": {"string": "right("}}}},
"argument": {
"application": {
"function": {
"application": {
"function": {
"application": {
"function": {
"application": {
"function": {"variable": "hydra.core.print.model.termExprAtPrecBudget"},
"argument": {
"application": {
"function": {
"application": {
"function": {"typeApplication": {"body": {"variable": "hydra.core.lib.math.sub"}, "type": {"literal": {"integer": "int32"}}}},
"argument": {"variable": "budget"}}},
"argument": {"literal": {"integer": {"int32": 6}}}}}}},
"argument": {"variable": "aliases"}}},
"argument": {"literal": {"integer": {"int32": 0}}}}},
"argument": {"variable": "r"}}}}}}}}}}},
"argument": {"variable": "e"}}}}}},
{
"name": "lambda",
"handler": {
"lambda": {
"parameter": "l",
"domain": {"variable": "hydra.core.model.Lambda"},
"body": {
"application": {
"function": {
"application": {
"function": {
"application": {
"function": {"typeApplication": {"body": {"variable": "hydra.core.lib.logic.ifElse"}, "type": {"variable": "hydra.core.ast.Expr"}}},
"argument": {
"application": {
"function": {
"application": {
"function": {"typeApplication": {"body": {"variable": "hydra.core.lib.ordering.lt"}, "type": {"literal": {"integer": "int32"}}}},
"argument": {"literal": {"integer": {"int32": 0}}}}},
"argument": {"variable": "ctx"}}}}},
"argument": {
"application": {
"function": {"variable": "hydra.core.serialization.parens"},
"argument": {
"application": {
"function": {
"application": {
"function": {
"application": {"function": {"variable": "hydra.core.print.model.lambdaExprAliased"}, "argument": {"variable": "budget"}}},
"argument": {"variable": "aliases"}}},
"argument": {"variable": "l"}}}}}}},
"argument": {
"application": {
"function": {
"application": {
"function": {
"application": {"function": {"variable": "hydra.core.print.model.lambdaExprAliased"}, "argument": {"variable": "budget"}}},
"argument": {"variable": "aliases"}}},
"argument": {"variable": "l"}}}}}}}},
{
"name": "let",
"handler": {
"lambda": {
"parameter": "l",
"domain": {"variable": "hydra.core.model.Let"},
"body": {
"application": {
"function": {
"application": {
"function": {
"application": {
"function": {"typeApplication": {"body": {"variable": "hydra.core.lib.logic.ifElse"}, "type": {"variable": "hydra.core.ast.Expr"}}},
"argument": {
"application": {
"function": {
"application": {
"function": {"typeApplication": {"body": {"variable": "hydra.core.lib.ordering.lt"}, "type": {"literal": {"integer": "int32"}}}},
"argument": {"literal": {"integer": {"int32": 0}}}}},
"argument": {"variable": "ctx"}}}}},
"argument": {
"application": {
"function": {"variable": "hydra.core.serialization.parens"},
"argument": {
"application": {
"function": {
"application": {
"function": {"application": {"function": {"variable": "hydra.core.print.model.letExprAliased"}, "argument": {"variable": "budget"}}},
"argument": {"variable": "aliases"}}},
"argument": {"variable": "l"}}}}}}},
"argument": {
"application": {
"function": {
"application": {
"function": {"application": {"function": {"variable": "hydra.core.print.model.letExprAliased"}, "argument": {"variable": "budget"}}},
"argument": {"variable": "aliases"}}},
"argument": {"variable": "l"}}}}}}}},
{
"name": "list",
"handler": {
"lambda": {
"parameter": "els",
"domain": {"list": {"variable": "hydra.core.model.Term"}},
"body": {
"application": {
"function": {"variable": "hydra.core.serialization.bracketListAdaptive"},
"argument": {
"application": {
"function": {
"application": {
"function": {
"typeApplication": {
"body": {"typeApplication": {"body": {"variable": "hydra.core.lib.lists.map"}, "type": {"variable": "hydra.core.model.Term"}}},
"type": {"variable": "hydra.core.ast.Expr"}}},
"argument": {
"application": {"function": {"variable": "hydra.core.print.model.termExprAliased"}, "argument": {"variable": "aliases"}}}}},
"argument": {"variable": "els"}}}}}}}},
{
"name": "literal",
"handler": {
"lambda": {
"parameter": "lit",
"domain": {"variable": "hydra.core.model.Literal"},
"body": {
"application": {
"function": {"variable": "hydra.core.serialization.cst"},
"argument": {"application": {"function": {"variable": "hydra.core.print.model.literal"}, "argument": {"variable": "lit"}}}}}}}},
{
"name": "map",
"handler": {
"lambda": {
"parameter": "m",
"domain": {"map": {"keys": {"variable": "hydra.core.model.Term"}, "values": {"variable": "hydra.core.model.Term"}}},
"body": {
"application": {
"function": {
"application": {
"function": {
"application": {
"function": {"typeApplication": {"body": {"variable": "hydra.core.lib.logic.ifElse"}, "type": {"variable": "hydra.core.ast.Expr"}}},
"argument": {
"application": {
"function": {
"typeApplication": {
"body": {
"typeApplication": {"body": {"variable": "hydra.core.lib.maps.isEmpty"}, "type": {"variable": "hydra.core.model.Term"}}},
"type": {"variable": "hydra.core.model.Term"}}},
"argument": {"variable": "m"}}}}},
"argument": {"application": {"function": {"variable": "hydra.core.serialization.cst"}, "argument": {"literal": {"string": "{=}"}}}}}},
"argument": {
"let": {
"bindings": [
{
"name": "entryExpr",
"term": {
"lambda": {
"parameter": "p",
"domain": {"pair": {"first": {"variable": "hydra.core.model.Term"}, "second": {"variable": "hydra.core.model.Term"}}},
"body": {
"application": {
"function": {
"application": {
"function": {
"application": {
"function": {"variable": "hydra.core.serialization.ifx"},
"argument": {
"record": {
"typeName": "hydra.core.ast.Op",
"fields": [
{
"name": "symbol",
"term": {"application": {"function": {"variable": "hydra.core.serialization.sym"}, "argument": {"literal": {"string": "="}}}}},
{
"name": "padding",
"term": {
"record": {
"typeName": "hydra.core.ast.Padding",
"fields": [
{"name": "left", "term": {"inject": {"typeName": "hydra.core.ast.Ws", "field": {"name": "space", "term": "unit"}}}},
{"name": "right", "term": {"inject": {"typeName": "hydra.core.ast.Ws", "field": {"name": "space", "term": "unit"}}}}]}}},
{
"name": "precedence",
"term": {"wrap": {"typeName": "hydra.core.ast.Precedence", "body": {"literal": {"integer": {"int32": 0}}}}}},
{
"name": "associativity",
"term": {"inject": {"typeName": "hydra.core.ast.Associativity", "field": {"name": "none", "term": "unit"}}}}]}}}},
"argument": {
"application": {
"function": {
"application": {"function": {"variable": "hydra.core.print.model.termExprAliased"}, "argument": {"variable": "aliases"}}},
"argument": {
"application": {
"function": {
"typeApplication": {
"body": {"typeApplication": {"body": {"variable": "hydra.core.lib.pairs.first"}, "type": {"variable": "hydra.core.model.Term"}}},
"type": {"variable": "hydra.core.model.Term"}}},
"argument": {"variable": "p"}}}}}}},
"argument": {
"application": {
"function": {
"application": {"function": {"variable": "hydra.core.print.model.termExprAliased"}, "argument": {"variable": "aliases"}}},
"argument": {
"application": {
"function": {
"typeApplication": {
"body": {
"typeApplication": {"body": {"variable": "hydra.core.lib.pairs.second"}, "type": {"variable": "hydra.core.model.Term"}}},
"type": {"variable": "hydra.core.model.Term"}}},
"argument": {"variable": "p"}}}}}}}}},
"typeScheme": {
"variables": [],
"body": {
"function": {
"domain": {"pair": {"first": {"variable": "hydra.core.model.Term"}, "second": {"variable": "hydra.core.model.Term"}}},
"codomain": {"variable": "hydra.core.ast.Expr"}}},
"constraints": []}}],
"body": {
"let": {
"bindings": [
{
"name": "entryExprs",
"term": {
"application": {
"function": {
"application": {
"function": {
"typeApplication": {
"body": {
"typeApplication": {
"body": {"variable": "hydra.core.lib.lists.map"},
"type": {"pair": {"first": {"variable": "hydra.core.model.Term"}, "second": {"variable": "hydra.core.model.Term"}}}}},
"type": {"variable": "hydra.core.ast.Expr"}}},
"argument": {"variable": "entryExpr"}}},
"argument": {
"application": {
"function": {
"application": {
"function": {
"typeApplication": {
"body": {
"typeApplication": {
"body": {"variable": "hydra.core.lib.lists.sortBy"},
"type": {"pair": {"first": {"variable": "hydra.core.model.Term"}, "second": {"variable": "hydra.core.model.Term"}}}}},
"type": {"variable": "hydra.core.model.Term"}}},
"argument": {
"typeApplication": {
"body": {"typeApplication": {"body": {"variable": "hydra.core.lib.pairs.first"}, "type": {"variable": "hydra.core.model.Term"}}},
"type": {"variable": "hydra.core.model.Term"}}}}},
"argument": {
"application": {
"function": {
"typeApplication": {
"body": {"typeApplication": {"body": {"variable": "hydra.core.lib.maps.toList"}, "type": {"variable": "hydra.core.model.Term"}}},
"type": {"variable": "hydra.core.model.Term"}}},
"argument": {"variable": "m"}}}}}}},
"typeScheme": {"variables": [], "body": {"list": {"variable": "hydra.core.ast.Expr"}}, "constraints": []}}],
"body": {
"application": {
"function": {
"application": {
"function": {"application": {"function": {"variable": "hydra.core.serialization.chooseLayout"}, "argument": {"variable": "budget"}}},
"argument": {
"application": {
"function": {
"application": {
"function": {
"application": {
"function": {"variable": "hydra.core.serialization.curlyBracesList"},
"argument": {"typeApplication": {"body": {"optional": null}, "type": {"literal": "string"}}}}},
"argument": {"variable": "hydra.core.serialization.inlineStyle"}}},
"argument": {"variable": "entryExprs"}}}}},
"argument": {
"application": {
"function": {
"application": {
"function": {
"application": {
"function": {"variable": "hydra.core.serialization.curlyBracesList"},
"argument": {"typeApplication": {"body": {"optional": null}, "type": {"literal": "string"}}}}},
"argument": {"variable": "hydra.core.serialization.halfBlockStyle"}}},
"argument": {"variable": "entryExprs"}}}}}}}}}}}}}},
{
"name": "optional",
"handler": {
"lambda": {
"parameter": "mt",
"domain": {"optional": {"variable": "hydra.core.model.Term"}},
"body": {
"application": {
"function": {
"application": {
"function": {
"application": {
"function": {
"typeApplication": {
"body": {
"typeApplication": {"body": {"variable": "hydra.core.lib.optionals.match"}, "type": {"variable": "hydra.core.model.Term"}}},
"type": {"variable": "hydra.core.ast.Expr"}}},
"argument": {"variable": "mt"}}},
"argument": {"application": {"function": {"variable": "hydra.core.serialization.cst"}, "argument": {"literal": {"string": "none"}}}}}},
"argument": {
"lambda": {
"parameter": "t",
"domain": {"variable": "hydra.core.model.Term"},
"body": {
"application": {
"function": {"application": {"function": {"variable": "hydra.core.serialization.suffix"}, "argument": {"literal": {"string": ")"}}}},
"argument": {
"application": {
"function": {
"application": {"function": {"variable": "hydra.core.serialization.prefix"}, "argument": {"literal": {"string": "given("}}}},
"argument": {
"application": {
"function": {
"application": {
"function": {
"application": {
"function": {
"application": {
"function": {"variable": "hydra.core.print.model.termExprAtPrecBudget"},
"argument": {
"application": {
"function": {
"application": {
"function": {"typeApplication": {"body": {"variable": "hydra.core.lib.math.sub"}, "type": {"literal": {"integer": "int32"}}}},
"argument": {"variable": "budget"}}},
"argument": {"literal": {"integer": {"int32": 6}}}}}}},
"argument": {"variable": "aliases"}}},
"argument": {"literal": {"integer": {"int32": 0}}}}},
"argument": {"variable": "t"}}}}}}}}}}}}}},
{
"name": "pair",
"handler": {
"lambda": {
"parameter": "p",
"domain": {"pair": {"first": {"variable": "hydra.core.model.Term"}, "second": {"variable": "hydra.core.model.Term"}}},
"body": {
"application": {
"function": {"variable": "hydra.core.serialization.parenListAdaptive"},
"argument": {
"list": [
{
"application": {
"function": {
"application": {"function": {"variable": "hydra.core.print.model.termExprAliased"}, "argument": {"variable": "aliases"}}},
"argument": {
"application": {
"function": {
"typeApplication": {
"body": {"typeApplication": {"body": {"variable": "hydra.core.lib.pairs.first"}, "type": {"variable": "hydra.core.model.Term"}}},
"type": {"variable": "hydra.core.model.Term"}}},
"argument": {"variable": "p"}}}}},
{
"application": {
"function": {
"application": {"function": {"variable": "hydra.core.print.model.termExprAliased"}, "argument": {"variable": "aliases"}}},
"argument": {
"application": {
"function": {
"typeApplication": {
"body": {
"typeApplication": {"body": {"variable": "hydra.core.lib.pairs.second"}, "type": {"variable": "hydra.core.model.Term"}}},
"type": {"variable": "hydra.core.model.Term"}}},
"argument": {"variable": "p"}}}}}]}}}}}},
{
"name": "project",
"handler": {
"lambda": {
"parameter": "proj",
"domain": {"variable": "hydra.core.model.Projection"},
"body": {
"application": {
"function": {"variable": "hydra.core.serialization.cst"},
"argument": {
"application": {
"function": {"application": {"function": {"variable": "hydra.core.print.model.projection"}, "argument": {"variable": "aliases"}}},
"argument": {"variable": "proj"}}}}}}}},
{
"name": "record",
"handler": {
"lambda": {
"parameter": "rec",
"domain": {"variable": "hydra.core.model.Record"},
"body": {
"let": {
"bindings": [
{
"name": "tname",
"term": {
"application": {
"function": {
"application": {"function": {"variable": "hydra.core.print.model.printNameAliased"}, "argument": {"variable": "aliases"}}},
"argument": {
"application": {
"function": {"project": {"typeName": "hydra.core.model.Record", "fieldName": "typeName"}},
"argument": {"variable": "rec"}}}}},
"typeScheme": {"variables": [], "body": {"literal": "string"}, "constraints": []}}],
"body": {
"let": {
"bindings": [
{
"name": "flds",
"term": {
"application": {
"function": {"project": {"typeName": "hydra.core.model.Record", "fieldName": "fields"}},
"argument": {"variable": "rec"}}},
"typeScheme": {"variables": [], "body": {"list": {"variable": "hydra.core.model.Field"}}, "constraints": []}}],
"body": {
"application": {
"function": {
"application": {
"function": {
"application": {
"function": {"variable": "hydra.core.serialization.ifx"},
"argument": {
"record": {
"typeName": "hydra.core.ast.Op",
"fields": [
{
"name": "symbol",
"term": {"application": {"function": {"variable": "hydra.core.serialization.sym"}, "argument": {"literal": {"string": ""}}}}},
{
"name": "padding",
"term": {
"record": {
"typeName": "hydra.core.ast.Padding",
"fields": [
{"name": "left", "term": {"inject": {"typeName": "hydra.core.ast.Ws", "field": {"name": "none", "term": "unit"}}}},
{"name": "right", "term": {"inject": {"typeName": "hydra.core.ast.Ws", "field": {"name": "none", "term": "unit"}}}}]}}},
{
"name": "precedence",
"term": {"wrap": {"typeName": "hydra.core.ast.Precedence", "body": {"literal": {"integer": {"int32": 0}}}}}},
{
"name": "associativity",
"term": {"inject": {"typeName": "hydra.core.ast.Associativity", "field": {"name": "none", "term": "unit"}}}}]}}}},
"argument": {"application": {"function": {"variable": "hydra.core.serialization.cst"}, "argument": {"variable": "tname"}}}}},
"argument": {
"application": {
"function": {
"application": {
"function": {
"application": {
"function": {"variable": "hydra.core.print.model.sugarFieldsExprAliased"},
"argument": {
"application": {
"function": {
"application": {
"function": {"typeApplication": {"body": {"variable": "hydra.core.lib.math.sub"}, "type": {"literal": {"integer": "int32"}}}},
"argument": {"variable": "budget"}}},
"argument": {"application": {"function": {"variable": "hydra.core.lib.strings.length"}, "argument": {"variable": "tname"}}}}}}},
"argument": {"variable": "aliases"}}},
"argument": {"variable": "flds"}}}}}}}}}}}},
{
"name": "set",
"handler": {
"lambda": {
"parameter": "s",
"domain": {"set": {"variable": "hydra.core.model.Term"}},
"body": {
"let": {
"bindings": [
{
"name": "elExprs",
"term": {
"application": {
"function": {
"application": {
"function": {
"typeApplication": {
"body": {"typeApplication": {"body": {"variable": "hydra.core.lib.lists.map"}, "type": {"variable": "hydra.core.model.Term"}}},
"type": {"variable": "hydra.core.ast.Expr"}}},
"argument": {
"application": {"function": {"variable": "hydra.core.print.model.termExprAliased"}, "argument": {"variable": "aliases"}}}}},
"argument": {
"application": {
"function": {"typeApplication": {"body": {"variable": "hydra.core.lib.lists.sort"}, "type": {"variable": "hydra.core.model.Term"}}},
"argument": {
"application": {
"function": {"typeApplication": {"body": {"variable": "hydra.core.lib.sets.toList"}, "type": {"variable": "hydra.core.model.Term"}}},
"argument": {"variable": "s"}}}}}}},
"typeScheme": {"variables": [], "body": {"list": {"variable": "hydra.core.ast.Expr"}}, "constraints": []}}],
"body": {
"application": {
"function": {
"application": {
"function": {"application": {"function": {"variable": "hydra.core.serialization.chooseLayout"}, "argument": {"variable": "budget"}}},
"argument": {
"application": {
"function": {
"application": {
"function": {
"application": {
"function": {"variable": "hydra.core.serialization.curlyBracesList"},
"argument": {"typeApplication": {"body": {"optional": null}, "type": {"literal": "string"}}}}},
"argument": {"variable": "hydra.core.serialization.inlineStyle"}}},
"argument": {"variable": "elExprs"}}}}},
"argument": {
"application": {
"function": {
"application": {
"function": {
"application": {
"function": {"variable": "hydra.core.serialization.curlyBracesList"},
"argument": {"typeApplication": {"body": {"optional": null}, "type": {"literal": "string"}}}}},
"argument": {"variable": "hydra.core.serialization.halfBlockStyle"}}},
"argument": {"variable": "elExprs"}}}}}}}}}},
{
"name": "typeLambda",
"handler": {
"lambda": {
"parameter": "ta",
"domain": {"variable": "hydra.core.model.TypeLambda"},
"body": {
"let": {
"bindings": [
{
"name": "gathered",
"term": {
"application": {
"function": {
"application": {
"function": {"variable": "hydra.core.print.model.gatherTypeLambdaBinders"},
"argument": {"typeApplication": {"body": {"list": []}, "type": {"variable": "hydra.core.model.Name"}}}}},
"argument": {"inject": {"typeName": "hydra.core.model.Term", "field": {"name": "typeLambda", "term": {"variable": "ta"}}}}}},
"typeScheme": {
"variables": [],
"body": {"pair": {"first": {"list": {"variable": "hydra.core.model.Name"}}, "second": {"variable": "hydra.core.model.Term"}}},
"constraints": []}}],
"body": {
"let": {
"bindings": [
{
"name": "vs",
"term": {
"application": {
"function": {
"typeApplication": {
"body": {
"typeApplication": {"body": {"variable": "hydra.core.lib.pairs.first"}, "type": {"list": {"variable": "hydra.core.model.Name"}}}},
"type": {"variable": "hydra.core.model.Term"}}},
"argument": {"variable": "gathered"}}},
"typeScheme": {"variables": [], "body": {"list": {"variable": "hydra.core.model.Name"}}, "constraints": []}}],
"body": {
"let": {
"bindings": [
{
"name": "body",
"term": {
"application": {
"function": {
"typeApplication": {
"body": {
"typeApplication": {"body": {"variable": "hydra.core.lib.pairs.second"}, "type": {"list": {"variable": "hydra.core.model.Name"}}}},
"type": {"variable": "hydra.core.model.Term"}}},
"argument": {"variable": "gathered"}}},
"typeScheme": {"variables": [], "body": {"variable": "hydra.core.model.Term"}, "constraints": []}}],
"body": {
"let": {
"bindings": [
{
"name": "vNames",
"term": {
"application": {
"function": {
"application": {
"function": {
"typeApplication": {
"body": {"typeApplication": {"body": {"variable": "hydra.core.lib.lists.map"}, "type": {"variable": "hydra.core.model.Name"}}},
"type": {"literal": "string"}}},
"argument": {"variable": "hydra.core.print.model.printBinderName"}}},
"argument": {"variable": "vs"}}},
"typeScheme": {"variables": [], "body": {"list": {"literal": "string"}}, "constraints": []}}],
"body": {
"let": {
"bindings": [
{
"name": "headStr",
"term": {
"application": {
"function": {"variable": "hydra.core.lib.strings.concat"},
"argument": {
"list": [
{"literal": {"string": "Λ"}},
{
"application": {
"function": {"application": {"function": {"variable": "hydra.core.lib.strings.join"}, "argument": {"literal": {"string": ", "}}}},
"argument": {"variable": "vNames"}}},
{"literal": {"string": "."}}]}}},
"typeScheme": {"variables": [], "body": {"literal": "string"}, "constraints": []}}],
"body": {
"let": {
"bindings": [
{
"name": "bodyExpr",
"term": {
"application": {
"function": {
"application": {
"function": {
"application": {
"function": {
"application": {
"function": {"variable": "hydra.core.print.model.termExprAtPrecBudget"},
"argument": {
"application": {
"function": {
"application": {
"function": {"typeApplication": {"body": {"variable": "hydra.core.lib.math.sub"}, "type": {"literal": {"integer": "int32"}}}},
"argument": {"variable": "budget"}}},
"argument": {"application": {"function": {"variable": "hydra.core.lib.strings.length"}, "argument": {"variable": "headStr"}}}}}}},
"argument": {"variable": "aliases"}}},
"argument": {"literal": {"integer": {"int32": 0}}}}},
"argument": {"variable": "body"}}},
"typeScheme": {"variables": [], "body": {"variable": "hydra.core.ast.Expr"}, "constraints": []}}],
"body": {
"application": {
"function": {
"application": {
"function": {
"application": {
"function": {"typeApplication": {"body": {"variable": "hydra.core.lib.logic.ifElse"}, "type": {"variable": "hydra.core.ast.Expr"}}},
"argument": {
"application": {
"function": {
"application": {
"function": {"typeApplication": {"body": {"variable": "hydra.core.lib.ordering.lt"}, "type": {"literal": {"integer": "int32"}}}},
"argument": {"literal": {"integer": {"int32": 0}}}}},
"argument": {"variable": "ctx"}}}}},
"argument": {
"application": {
"function": {"variable": "hydra.core.serialization.parens"},
"argument": {
"application": {
"function": {
"application": {
"function": {"variable": "hydra.core.serialization.indentSubsequentLines"},
"argument": {"variable": "hydra.core.serialization.doubleSpace"}}},
"argument": {
"application": {
"function": {
"application": {
"function": {
"application": {
"function": {"variable": "hydra.core.serialization.ifx"},
"argument": {
"record": {
"typeName": "hydra.core.ast.Op",
"fields": [
{
"name": "symbol",
"term": {"application": {"function": {"variable": "hydra.core.serialization.sym"}, "argument": {"literal": {"string": ""}}}}},
{
"name": "padding",
"term": {
"record": {
"typeName": "hydra.core.ast.Padding",
"fields": [
{"name": "left", "term": {"inject": {"typeName": "hydra.core.ast.Ws", "field": {"name": "none", "term": "unit"}}}},
{"name": "right", "term": {"inject": {"typeName": "hydra.core.ast.Ws", "field": {"name": "none", "term": "unit"}}}}]}}},
{
"name": "precedence",
"term": {"wrap": {"typeName": "hydra.core.ast.Precedence", "body": {"literal": {"integer": {"int32": 0}}}}}},
{
"name": "associativity",
"term": {"inject": {"typeName": "hydra.core.ast.Associativity", "field": {"name": "none", "term": "unit"}}}}]}}}},
"argument": {"application": {"function": {"variable": "hydra.core.serialization.cst"}, "argument": {"variable": "headStr"}}}}},
"argument": {"variable": "bodyExpr"}}}}}}}}},
"argument": {
"application": {
"function": {
"application": {
"function": {"variable": "hydra.core.serialization.indentSubsequentLines"},
"argument": {"variable": "hydra.core.serialization.doubleSpace"}}},
"argument": {
"application": {
"function": {
"application": {
"function": {
"application": {
"function": {"variable": "hydra.core.serialization.ifx"},
"argument": {
"record": {
"typeName": "hydra.core.ast.Op",
"fields": [
{
"name": "symbol",
"term": {"application": {"function": {"variable": "hydra.core.serialization.sym"}, "argument": {"literal": {"string": ""}}}}},
{
"name": "padding",
"term": {
"record": {
"typeName": "hydra.core.ast.Padding",
"fields": [
{"name": "left", "term": {"inject": {"typeName": "hydra.core.ast.Ws", "field": {"name": "none", "term": "unit"}}}},
{"name": "right", "term": {"inject": {"typeName": "hydra.core.ast.Ws", "field": {"name": "none", "term": "unit"}}}}]}}},
{
"name": "precedence",
"term": {"wrap": {"typeName": "hydra.core.ast.Precedence", "body": {"literal": {"integer": {"int32": 0}}}}}},
{
"name": "associativity",
"term": {"inject": {"typeName": "hydra.core.ast.Associativity", "field": {"name": "none", "term": "unit"}}}}]}}}},
"argument": {"application": {"function": {"variable": "hydra.core.serialization.cst"}, "argument": {"variable": "headStr"}}}}},
"argument": {"variable": "bodyExpr"}}}}}}}}}}}}}}}}}}}}}},
{
"name": "typeApplication",
"handler": {
"lambda": {
"parameter": "tt",
"domain": {"variable": "hydra.core.model.TypeApplicationTerm"},
"body": {
"let": {
"bindings": [
{
"name": "t2",
"term": {
"application": {
"function": {"project": {"typeName": "hydra.core.model.TypeApplicationTerm", "fieldName": "body"}},
"argument": {"variable": "tt"}}},
"typeScheme": {"variables": [], "body": {"variable": "hydra.core.model.Term"}, "constraints": []}}],
"body": {
"let": {
"bindings": [
{
"name": "typ",
"term": {
"application": {
"function": {"project": {"typeName": "hydra.core.model.TypeApplicationTerm", "fieldName": "type"}},
"argument": {"variable": "tt"}}},
"typeScheme": {"variables": [], "body": {"variable": "hydra.core.model.Type"}, "constraints": []}}],
"body": {
"let": {
"bindings": [
{
"name": "bodyExpr",
"term": {
"application": {
"function": {
"application": {
"function": {
"application": {
"function": {
"application": {"function": {"variable": "hydra.core.print.model.termExprAtPrecBudget"}, "argument": {"variable": "budget"}}},
"argument": {"variable": "aliases"}}},
"argument": {"literal": {"integer": {"int32": 3}}}}},
"argument": {"variable": "t2"}}},
"typeScheme": {"variables": [], "body": {"variable": "hydra.core.ast.Expr"}, "constraints": []}}],
"body": {
"application": {
"function": {
"application": {
"function": {
"application": {
"function": {"typeApplication": {"body": {"variable": "hydra.core.lib.logic.ifElse"}, "type": {"variable": "hydra.core.ast.Expr"}}},
"argument": {
"application": {
"function": {
"application": {
"function": {"typeApplication": {"body": {"variable": "hydra.core.lib.ordering.lt"}, "type": {"literal": {"integer": "int32"}}}},
"argument": {"literal": {"integer": {"int32": 3}}}}},
"argument": {"variable": "ctx"}}}}},
"argument": {
"application": {
"function": {"variable": "hydra.core.serialization.parens"},
"argument": {
"application": {
"function": {"application": {"function": {"variable": "hydra.core.serialization.suffix"}, "argument": {"literal": {"string": "⟩"}}}},
"argument": {
"application": {
"function": {
"application": {
"function": {
"application": {
"function": {"variable": "hydra.core.serialization.ifx"},
"argument": {
"record": {
"typeName": "hydra.core.ast.Op",
"fields": [
{
"name": "symbol",
"term": {"application": {"function": {"variable": "hydra.core.serialization.sym"}, "argument": {"literal": {"string": "⟨"}}}}},
{
"name": "padding",
"term": {
"record": {
"typeName": "hydra.core.ast.Padding",
"fields": [
{"name": "left", "term": {"inject": {"typeName": "hydra.core.ast.Ws", "field": {"name": "none", "term": "unit"}}}},
{"name": "right", "term": {"inject": {"typeName": "hydra.core.ast.Ws", "field": {"name": "none", "term": "unit"}}}}]}}},
{
"name": "precedence",
"term": {"wrap": {"typeName": "hydra.core.ast.Precedence", "body": {"literal": {"integer": {"int32": 0}}}}}},
{
"name": "associativity",
"term": {"inject": {"typeName": "hydra.core.ast.Associativity", "field": {"name": "none", "term": "unit"}}}}]}}}},
"argument": {"variable": "bodyExpr"}}},
"argument": {
"application": {
"function": {"variable": "hydra.core.serialization.cst"},
"argument": {
"application": {
"function": {"application": {"function": {"variable": "hydra.core.print.model.typeAliased"}, "argument": {"variable": "aliases"}}},
"argument": {"variable": "typ"}}}}}}}}}}}}},
"argument": {
"application": {
"function": {"application": {"function": {"variable": "hydra.core.serialization.suffix"}, "argument": {"literal": {"string": "⟩"}}}},
"argument": {
"application": {
"function": {
"application": {
"function": {
"application": {
"function": {"variable": "hydra.core.serialization.ifx"},
"argument": {
"record": {
"typeName": "hydra.core.ast.Op",
"fields": [
{
"name": "symbol",
"term": {"application": {"function": {"variable": "hydra.core.serialization.sym"}, "argument": {"literal": {"string": "⟨"}}}}},
{
"name": "padding",
"term": {
"record": {
"typeName": "hydra.core.ast.Padding",
"fields": [
{"name": "left", "term": {"inject": {"typeName": "hydra.core.ast.Ws", "field": {"name": "none", "term": "unit"}}}},
{"name": "right", "term": {"inject": {"typeName": "hydra.core.ast.Ws", "field": {"name": "none", "term": "unit"}}}}]}}},
{
"name": "precedence",
"term": {"wrap": {"typeName": "hydra.core.ast.Precedence", "body": {"literal": {"integer": {"int32": 0}}}}}},
{
"name": "associativity",
"term": {"inject": {"typeName": "hydra.core.ast.Associativity", "field": {"name": "none", "term": "unit"}}}}]}}}},
"argument": {"variable": "bodyExpr"}}},
"argument": {
"application": {
"function": {"variable": "hydra.core.serialization.cst"},
"argument": {
"application": {
"function": {"application": {"function": {"variable": "hydra.core.print.model.typeAliased"}, "argument": {"variable": "aliases"}}},
"argument": {"variable": "typ"}}}}}}}}}}}}}}}}}}}},
{
"name": "inject",
"handler": {
"lambda": {
"parameter": "inj",
"domain": {"variable": "hydra.core.model.Injection"},
"body": {
"application": {
"function": {
"application": {
"function": {
"application": {"function": {"variable": "hydra.core.print.model.injectionExprAliased"}, "argument": {"variable": "budget"}}},
"argument": {"variable": "aliases"}}},
"argument": {"variable": "inj"}}}}}},
{
"name": "unit",
"handler": {
"lambda": {
"parameter": "_",
"domain": "unit",
"body": {"application": {"function": {"variable": "hydra.core.serialization.cst"}, "argument": {"literal": {"string": "unit"}}}}}}},
{
"name": "unwrap",
"handler": {
"lambda": {
"parameter": "tname",
"domain": {"variable": "hydra.core.model.Name"},
"body": {
"application": {
"function": {"variable": "hydra.core.serialization.cst"},
"argument": {
"application": {
"function": {"variable": "hydra.core.lib.strings.concat"},
"argument": {
"list": [
{
"application": {
"function": {
"application": {"function": {"variable": "hydra.core.print.model.printNameAliased"}, "argument": {"variable": "aliases"}}},
"argument": {"variable": "tname"}}},
{"literal": {"string": "[]"}}]}}}}}}}},
{
"name": "variable",
"handler": {
"lambda": {
"parameter": "name",
"domain": {"variable": "hydra.core.model.Name"},
"body": {
"application": {
"function": {"variable": "hydra.core.serialization.cst"},
"argument": {
"application": {
"function": {
"application": {"function": {"variable": "hydra.core.print.model.printNameAliased"}, "argument": {"variable": "aliases"}}},
"argument": {"variable": "name"}}}}}}}},
{
"name": "wrap",
"handler": {
"lambda": {
"parameter": "wt",
"domain": {"variable": "hydra.core.model.WrappedTerm"},
"body": {
"let": {
"bindings": [
{
"name": "tname",
"term": {
"application": {
"function": {
"application": {"function": {"variable": "hydra.core.print.model.printNameAliased"}, "argument": {"variable": "aliases"}}},
"argument": {
"application": {
"function": {"project": {"typeName": "hydra.core.model.WrappedTerm", "fieldName": "typeName"}},
"argument": {"variable": "wt"}}}}},
"typeScheme": {"variables": [], "body": {"literal": "string"}, "constraints": []}}],
"body": {
"let": {
"bindings": [
{
"name": "term1",
"term": {
"application": {
"function": {"project": {"typeName": "hydra.core.model.WrappedTerm", "fieldName": "body"}},
"argument": {"variable": "wt"}}},
"typeScheme": {"variables": [], "body": {"variable": "hydra.core.model.Term"}, "constraints": []}}],
"body": {
"application": {
"function": {
"application": {
"function": {
"application": {
"function": {"typeApplication": {"body": {"variable": "hydra.core.lib.logic.ifElse"}, "type": {"variable": "hydra.core.ast.Expr"}}},
"argument": {"application": {"function": {"variable": "hydra.core.print.model.isVariableTerm"}, "argument": {"variable": "term1"}}}}},
"argument": {
"application": {
"function": {"application": {"function": {"variable": "hydra.core.serialization.suffix"}, "argument": {"literal": {"string": "}"}}}},
"argument": {
"application": {
"function": {
"application": {
"function": {
"application": {
"function": {"variable": "hydra.core.serialization.ifx"},
"argument": {
"record": {
"typeName": "hydra.core.ast.Op",
"fields": [
{
"name": "symbol",
"term": {"application": {"function": {"variable": "hydra.core.serialization.sym"}, "argument": {"literal": {"string": "){"}}}}},
{
"name": "padding",
"term": {
"record": {
"typeName": "hydra.core.ast.Padding",
"fields": [
{"name": "left", "term": {"inject": {"typeName": "hydra.core.ast.Ws", "field": {"name": "none", "term": "unit"}}}},
{"name": "right", "term": {"inject": {"typeName": "hydra.core.ast.Ws", "field": {"name": "none", "term": "unit"}}}}]}}},
{
"name": "precedence",
"term": {"wrap": {"typeName": "hydra.core.ast.Precedence", "body": {"literal": {"integer": {"int32": 0}}}}}},
{
"name": "associativity",
"term": {"inject": {"typeName": "hydra.core.ast.Associativity", "field": {"name": "none", "term": "unit"}}}}]}}}},
"argument": {
"application": {
"function": {"variable": "hydra.core.serialization.cst"},
"argument": {
"application": {
"function": {"variable": "hydra.core.lib.strings.concat"},
"argument": {"list": [{"literal": {"string": "wrap("}}, {"variable": "tname"}]}}}}}}},
"argument": {
"application": {
"function": {
"application": {"function": {"variable": "hydra.core.print.model.termExprAliased"}, "argument": {"variable": "aliases"}}},
"argument": {"variable": "term1"}}}}}}}}},
"argument": {
"application": {
"function": {"application": {"function": {"variable": "hydra.core.serialization.suffix"}, "argument": {"literal": {"string": "}"}}}},
"argument": {
"application": {
"function": {
"application": {
"function": {
"application": {
"function": {"variable": "hydra.core.serialization.ifx"},
"argument": {
"record": {
"typeName": "hydra.core.ast.Op",
"fields": [
{
"name": "symbol",
"term": {"application": {"function": {"variable": "hydra.core.serialization.sym"}, "argument": {"literal": {"string": "{"}}}}},
{
"name": "padding",
"term": {
"record": {
"typeName": "hydra.core.ast.Padding",
"fields": [
{"name": "left", "term": {"inject": {"typeName": "hydra.core.ast.Ws", "field": {"name": "none", "term": "unit"}}}},
{"name": "right", "term": {"inject": {"typeName": "hydra.core.ast.Ws", "field": {"name": "none", "term": "unit"}}}}]}}},
{
"name": "precedence",
"term": {"wrap": {"typeName": "hydra.core.ast.Precedence", "body": {"literal": {"integer": {"int32": 0}}}}}},
{
"name": "associativity",
"term": {"inject": {"typeName": "hydra.core.ast.Associativity", "field": {"name": "none", "term": "unit"}}}}]}}}},
"argument": {"application": {"function": {"variable": "hydra.core.serialization.cst"}, "argument": {"variable": "tname"}}}}},
"argument": {
"application": {
"function": {
"application": {
"function": {
"application": {
"function": {
"application": {
"function": {"variable": "hydra.core.print.model.termExprAtPrecBudget"},
"argument": {
"application": {
"function": {
"application": {
"function": {"typeApplication": {"body": {"variable": "hydra.core.lib.math.sub"}, "type": {"literal": {"integer": "int32"}}}},
"argument": {"variable": "budget"}}},
"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": "tname"}}}}},
"argument": {"literal": {"integer": {"int32": 1}}}}}}}}},
"argument": {"variable": "aliases"}}},
"argument": {"literal": {"integer": {"int32": 0}}}}},
"argument": {"variable": "term1"}}}}}}}}}}}}}}}}]}},
"argument": {"variable": "t"}}}}}}}}}}}}},
"annotation": {
"map": [
{
"key": {"variable": "description"},
"value": {
"literal": {
"string": "Show a term as a line-layout expression at a given minimum context precedence and available-width budget, adding minimal parentheses"}}}]}}}}},
{
"term": {
"name": "hydra.core.print.model.termSignature",
"signature": {
"typeParameters": [],
"parameters": [{"name": "arg0", "type": {"variable": "hydra.core.typing.TermSignature"}, "isLazy": false}],
"result": {"type": {"literal": "string"}}},
"body": {
"annotated": {
"body": {
"application": {
"function": {"variable": "hydra.core.print.model.termSignatureAliased"},
"argument": {
"typeApplication": {
"body": {
"typeApplication": {"body": {"variable": "hydra.core.lib.maps.empty"}, "type": {"variable": "hydra.core.packaging.ModuleName"}}},
"type": {"literal": "string"}}}}},
"annotation": {
"map": [
{
"key": {"variable": "description"},
"value": {"literal": {"string": "Show a term signature as a string, preserving each parameter's lazy marking"}}}]}}}}},
{
"term": {
"name": "hydra.core.print.model.termSignatureAliased",
"signature": {
"typeParameters": [],
"parameters": [
{
"name": "arg0",
"type": {"map": {"keys": {"variable": "hydra.core.packaging.ModuleName"}, "values": {"literal": "string"}}},
"isLazy": false},
{"name": "arg1", "type": {"variable": "hydra.core.typing.TermSignature"}, "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": "sig",
"domain": {"variable": "hydra.core.typing.TermSignature"},
"body": {
"let": {
"bindings": [
{
"name": "typeParams",
"term": {
"application": {
"function": {"project": {"typeName": "hydra.core.typing.TermSignature", "fieldName": "typeParameters"}},
"argument": {"variable": "sig"}}},
"typeScheme": {"variables": [], "body": {"list": {"variable": "hydra.core.typing.TypeParameter"}}, "constraints": []}}],
"body": {
"let": {
"bindings": [
{
"name": "params",
"term": {
"application": {
"function": {"project": {"typeName": "hydra.core.typing.TermSignature", "fieldName": "parameters"}},
"argument": {"variable": "sig"}}},
"typeScheme": {"variables": [], "body": {"list": {"variable": "hydra.core.typing.Parameter"}}, "constraints": []}}],
"body": {
"let": {
"bindings": [
{
"name": "result",
"term": {
"application": {
"function": {"project": {"typeName": "hydra.core.typing.TermSignature", "fieldName": "result"}},
"argument": {"variable": "sig"}}},
"typeScheme": {"variables": [], "body": {"variable": "hydra.core.typing.Result"}, "constraints": []}}],
"body": {
"let": {
"bindings": [
{
"name": "varNames",
"term": {
"application": {
"function": {
"application": {
"function": {
"typeApplication": {
"body": {
"typeApplication": {"body": {"variable": "hydra.core.lib.lists.map"}, "type": {"variable": "hydra.core.typing.TypeParameter"}}},
"type": {"literal": "string"}}},
"argument": {
"lambda": {
"parameter": "tp",
"domain": {"variable": "hydra.core.typing.TypeParameter"},
"body": {
"application": {
"function": {"variable": "hydra.core.print.model.printBinderName"},
"argument": {
"application": {
"function": {"project": {"typeName": "hydra.core.typing.TypeParameter", "fieldName": "name"}},
"argument": {"variable": "tp"}}}}}}}}},
"argument": {"variable": "typeParams"}}},
"typeScheme": {"variables": [], "body": {"list": {"literal": "string"}}, "constraints": []}}],
"body": {
"let": {
"bindings": [
{
"name": "constraintClassName",
"term": {
"lambda": {
"parameter": "c",
"domain": {"variable": "hydra.core.model.TypeClassConstraint"},
"body": {
"application": {
"function": {
"cases": {
"typeName": "hydra.core.model.TypeClassConstraint",
"cases": [
{
"name": "simple",
"handler": {
"lambda": {
"parameter": "n",
"domain": {"variable": "hydra.core.model.Name"},
"body": {"application": {"function": {"unwrap": "hydra.core.model.Name"}, "argument": {"variable": "n"}}}}}}]}},
"argument": {"variable": "c"}}}}},
"typeScheme": {
"variables": [],
"body": {"function": {"domain": {"variable": "hydra.core.model.TypeClassConstraint"}, "codomain": {"literal": "string"}}},
"constraints": []}}],
"body": {
"let": {
"bindings": [
{
"name": "toConstraintPairsForParam",
"term": {
"lambda": {
"parameter": "tp",
"domain": {"variable": "hydra.core.typing.TypeParameter"},
"body": {
"let": {
"bindings": [
{
"name": "v",
"term": {
"application": {
"function": {"project": {"typeName": "hydra.core.typing.TypeParameter", "fieldName": "name"}},
"argument": {"variable": "tp"}}},
"typeScheme": {"variables": [], "body": {"variable": "hydra.core.model.Name"}, "constraints": []}}],
"body": {
"application": {
"function": {
"application": {
"function": {
"typeApplication": {
"body": {
"typeApplication": {"body": {"variable": "hydra.core.lib.lists.map"}, "type": {"variable": "hydra.core.model.TypeClassConstraint"}}},
"type": {"literal": "string"}}},
"argument": {
"lambda": {
"parameter": "c",
"domain": {"variable": "hydra.core.model.TypeClassConstraint"},
"body": {
"application": {
"function": {"variable": "hydra.core.lib.strings.concat"},
"argument": {
"list": [
{"application": {"function": {"variable": "constraintClassName"}, "argument": {"variable": "c"}}},
{"literal": {"string": " "}},
{"application": {"function": {"unwrap": "hydra.core.model.Name"}, "argument": {"variable": "v"}}}]}}}}}}},
"argument": {
"application": {
"function": {
"application": {
"function": {
"typeApplication": {
"body": {
"typeApplication": {"body": {"variable": "hydra.core.lib.lists.sortBy"}, "type": {"variable": "hydra.core.model.TypeClassConstraint"}}},
"type": {"literal": "string"}}},
"argument": {"variable": "constraintClassName"}}},
"argument": {
"application": {
"function": {"project": {"typeName": "hydra.core.typing.TypeParameter", "fieldName": "constraints"}},
"argument": {"variable": "tp"}}}}}}}}}}},
"typeScheme": {
"variables": [],
"body": {"function": {"domain": {"variable": "hydra.core.typing.TypeParameter"}, "codomain": {"list": {"literal": "string"}}}},
"constraints": []}}],
"body": {
"let": {
"bindings": [
{
"name": "tc",
"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": {"variable": "hydra.core.typing.TypeParameter"}}},
"type": {"list": {"literal": "string"}}}},
"argument": {"variable": "toConstraintPairsForParam"}}},
"argument": {"variable": "typeParams"}}}}},
"typeScheme": {"variables": [], "body": {"list": {"literal": "string"}}, "constraints": []}}],
"body": {
"let": {
"bindings": [
{
"name": "paramStr",
"term": {
"lambda": {
"parameter": "p",
"domain": {"variable": "hydra.core.typing.Parameter"},
"body": {
"let": {
"bindings": [
{
"name": "tyStr",
"term": {
"application": {
"function": {
"application": {
"function": {"application": {"function": {"variable": "hydra.core.print.model.typeAtPrec"}, "argument": {"variable": "aliases"}}},
"argument": {"literal": {"integer": {"int32": 2}}}}},
"argument": {
"application": {
"function": {"project": {"typeName": "hydra.core.typing.Parameter", "fieldName": "type"}},
"argument": {"variable": "p"}}}}},
"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": {"project": {"typeName": "hydra.core.typing.Parameter", "fieldName": "isLazy"}},
"argument": {"variable": "p"}}}}},
"argument": {
"application": {
"function": {
"application": {"function": {"variable": "hydra.core.lib.strings.concat2"}, "argument": {"literal": {"string": "lazy "}}}},
"argument": {"variable": "tyStr"}}}}},
"argument": {"variable": "tyStr"}}}}}}},
"typeScheme": {
"variables": [],
"body": {"function": {"domain": {"variable": "hydra.core.typing.Parameter"}, "codomain": {"literal": "string"}}},
"constraints": []}}],
"body": {
"let": {
"bindings": [
{
"name": "paramStrs",
"term": {
"application": {
"function": {
"application": {
"function": {
"typeApplication": {
"body": {
"typeApplication": {"body": {"variable": "hydra.core.lib.lists.map"}, "type": {"variable": "hydra.core.typing.Parameter"}}},
"type": {"literal": "string"}}},
"argument": {"variable": "paramStr"}}},
"argument": {"variable": "params"}}},
"typeScheme": {"variables": [], "body": {"list": {"literal": "string"}}, "constraints": []}}],
"body": {
"let": {
"bindings": [
{
"name": "resultStr",
"term": {
"application": {
"function": {
"application": {
"function": {"application": {"function": {"variable": "hydra.core.print.model.typeAtPrec"}, "argument": {"variable": "aliases"}}},
"argument": {"literal": {"integer": {"int32": 2}}}}},
"argument": {
"application": {
"function": {"project": {"typeName": "hydra.core.typing.Result", "fieldName": "type"}},
"argument": {"variable": "result"}}}}},
"typeScheme": {"variables": [], "body": {"literal": "string"}, "constraints": []}}],
"body": {
"let": {
"bindings": [
{
"name": "bodyStr",
"term": {
"application": {
"function": {"application": {"function": {"variable": "hydra.core.lib.strings.join"}, "argument": {"literal": {"string": " → "}}}},
"argument": {
"application": {
"function": {
"application": {
"function": {"typeApplication": {"body": {"variable": "hydra.core.lib.lists.concat2"}, "type": {"literal": "string"}}},
"argument": {"variable": "paramStrs"}}},
"argument": {"list": [{"variable": "resultStr"}]}}}}},
"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": {"typeApplication": {"body": {"variable": "hydra.core.lib.lists.isEmpty"}, "type": {"literal": "string"}}},
"argument": {"variable": "varNames"}}}}},
"argument": {"variable": "bodyStr"}}},
"argument": {
"application": {
"function": {"variable": "hydra.core.lib.strings.concat"},
"argument": {
"list": [
{"literal": {"string": "∀"}},
{
"application": {
"function": {"application": {"function": {"variable": "hydra.core.lib.strings.join"}, "argument": {"literal": {"string": ", "}}}},
"argument": {"variable": "varNames"}}},
{"literal": {"string": "."}},
{
"application": {
"function": {
"application": {
"function": {
"application": {
"function": {"typeApplication": {"body": {"variable": "hydra.core.lib.logic.ifElse"}, "type": {"literal": "string"}}},
"argument": {
"application": {
"function": {"typeApplication": {"body": {"variable": "hydra.core.lib.lists.isEmpty"}, "type": {"literal": "string"}}},
"argument": {"variable": "tc"}}}}},
"argument": {"literal": {"string": ""}}}},
"argument": {
"application": {
"function": {"variable": "hydra.core.lib.strings.concat"},
"argument": {
"list": [
{"literal": {"string": "("}},
{
"application": {
"function": {"application": {"function": {"variable": "hydra.core.lib.strings.join"}, "argument": {"literal": {"string": ", "}}}},
"argument": {"variable": "tc"}}},
{"literal": {"string": ") ⇒ "}}]}}}}},
{"variable": "bodyStr"}]}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}},
"annotation": {
"map": [
{
"key": {"variable": "description"},
"value": {
"literal": {
"string": "Show a term signature as a string (preserving lazy markings), shortening nominal references via the given alias map (#803)"}}}]}}}}},
{
"term": {
"name": "hydra.core.print.model.toHex2",
"signature": {
"typeParameters": [],
"parameters": [{"name": "arg0", "type": {"literal": {"integer": "int32"}}, "isLazy": false}],
"result": {"type": {"literal": "string"}}},
"body": {
"annotated": {
"body": {
"lambda": {
"parameter": "c",
"domain": {"literal": {"integer": "int32"}},
"body": {
"let": {
"bindings": [
{
"name": "hi",
"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": {"variable": "hydra.core.lib.math.div"}, "type": {"literal": {"integer": "int32"}}}},
"argument": {"variable": "c"}}},
"argument": {"literal": {"integer": {"int32": 16}}}}}}},
"typeScheme": {"variables": [], "body": {"literal": {"integer": "int32"}}, "constraints": []}}],
"body": {
"let": {
"bindings": [
{
"name": "lo",
"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": {"variable": "hydra.core.lib.math.mod"}, "type": {"literal": {"integer": "int32"}}}},
"argument": {"variable": "c"}}},
"argument": {"literal": {"integer": {"int32": 16}}}}}}},
"typeScheme": {"variables": [], "body": {"literal": {"integer": "int32"}}, "constraints": []}}],
"body": {
"application": {
"function": {"variable": "hydra.core.lib.strings.concat"},
"argument": {
"list": [
{"application": {"function": {"variable": "hydra.core.print.model.hexDigit"}, "argument": {"variable": "hi"}}},
{"application": {"function": {"variable": "hydra.core.print.model.hexDigit"}, "argument": {"variable": "lo"}}}]}}}}}}}}},
"annotation": {
"map": [
{
"key": {"variable": "description"},
"value": {"literal": {"string": "Render a small code point as a two-digit lowercase hex string."}}}]}}}}},
{
"term": {
"name": "hydra.core.print.model.type",
"signature": {
"typeParameters": [],
"parameters": [{"name": "arg0", "type": {"variable": "hydra.core.model.Type"}, "isLazy": false}],
"result": {"type": {"literal": "string"}}},
"body": {
"annotated": {
"body": {
"application": {
"function": {"variable": "hydra.core.print.model.typeAliased"},
"argument": {
"typeApplication": {
"body": {
"typeApplication": {"body": {"variable": "hydra.core.lib.maps.empty"}, "type": {"variable": "hydra.core.packaging.ModuleName"}}},
"type": {"literal": "string"}}}}},
"annotation": {"map": [{"key": {"variable": "description"}, "value": {"literal": {"string": "Show a type as a string"}}}]}}}}},
{
"term": {
"name": "hydra.core.print.model.typeAliased",
"signature": {
"typeParameters": [],
"parameters": [
{
"name": "arg0",
"type": {"map": {"keys": {"variable": "hydra.core.packaging.ModuleName"}, "values": {"literal": "string"}}},
"isLazy": false},
{"name": "arg1", "type": {"variable": "hydra.core.model.Type"}, "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": "typ",
"domain": {"variable": "hydra.core.model.Type"},
"body": {
"application": {
"function": {
"application": {
"function": {"application": {"function": {"variable": "hydra.core.print.model.typeAtPrec"}, "argument": {"variable": "aliases"}}},
"argument": {"literal": {"integer": {"int32": 0}}}}},
"argument": {"variable": "typ"}}}}}}},
"annotation": {
"map": [
{
"key": {"variable": "description"},
"value": {"literal": {"string": "Show a type as a string, shortening nominal references via the given import-alias map (#803)"}}}]}}}}},
{
"term": {
"name": "hydra.core.print.model.typeAtPrec",
"signature": {
"typeParameters": [],
"parameters": [
{
"name": "arg0",
"type": {"map": {"keys": {"variable": "hydra.core.packaging.ModuleName"}, "values": {"literal": "string"}}},
"isLazy": false},
{"name": "arg1", "type": {"literal": {"integer": "int32"}}, "isLazy": false},
{"name": "arg2", "type": {"variable": "hydra.core.model.Type"}, "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": "ctx",
"domain": {"literal": {"integer": "int32"}},
"body": {
"lambda": {
"parameter": "typ",
"domain": {"variable": "hydra.core.model.Type"},
"body": {
"let": {
"bindings": [
{
"name": "fieldHasDescription",
"term": {
"lambda": {
"parameter": "ft",
"domain": {"variable": "hydra.core.model.FieldType"},
"body": {
"application": {
"function": {
"application": {
"function": {
"application": {
"function": {
"typeApplication": {
"body": {"typeApplication": {"body": {"variable": "hydra.core.lib.optionals.match"}, "type": {"literal": "string"}}},
"type": {"literal": "boolean"}}},
"argument": {
"application": {
"function": {
"typeApplication": {
"body": {"typeApplication": {"body": {"variable": "hydra.core.lib.pairs.first"}, "type": {"optional": {"literal": "string"}}}},
"type": {"variable": "hydra.core.model.Type"}}},
"argument": {
"application": {
"function": {"variable": "hydra.core.print.model.peelDescriptionAnnotation"},
"argument": {
"application": {
"function": {"project": {"typeName": "hydra.core.model.FieldType", "fieldName": "type"}},
"argument": {"variable": "ft"}}}}}}}}},
"argument": {"literal": {"boolean": false}}}},
"argument": {"lambda": {"parameter": "_", "domain": {"literal": "string"}, "body": {"literal": {"boolean": true}}}}}}}},
"typeScheme": {
"variables": [],
"body": {"function": {"domain": {"variable": "hydra.core.model.FieldType"}, "codomain": {"literal": "boolean"}}},
"constraints": []}}],
"body": {
"let": {
"bindings": [
{
"name": "showRowType",
"term": {
"lambda": {
"parameter": "flds",
"domain": {"list": {"variable": "hydra.core.model.FieldType"}},
"body": {
"let": {
"bindings": [
{
"name": "fieldExprs",
"term": {
"application": {
"function": {
"application": {
"function": {
"typeApplication": {
"body": {
"typeApplication": {"body": {"variable": "hydra.core.lib.lists.map"}, "type": {"variable": "hydra.core.model.FieldType"}}},
"type": {"variable": "hydra.core.ast.Expr"}}},
"argument": {"application": {"function": {"variable": "hydra.core.print.model.fieldTypeExpr"}, "argument": {"variable": "aliases"}}}}},
"argument": {"variable": "flds"}}},
"typeScheme": {"variables": [], "body": {"list": {"variable": "hydra.core.ast.Expr"}}, "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.logic.not"},
"argument": {
"application": {
"function": {
"typeApplication": {"body": {"variable": "hydra.core.lib.lists.isEmpty"}, "type": {"variable": "hydra.core.model.FieldType"}}},
"argument": {
"application": {
"function": {
"application": {
"function": {
"typeApplication": {"body": {"variable": "hydra.core.lib.lists.filter"}, "type": {"variable": "hydra.core.model.FieldType"}}},
"argument": {"variable": "fieldHasDescription"}}},
"argument": {"variable": "flds"}}}}}}}}},
"argument": {
"application": {
"function": {"variable": "hydra.core.serialization.printExpr"},
"argument": {
"application": {
"function": {
"application": {
"function": {"variable": "hydra.core.serialization.curlyBracesListWithBlankLines"},
"argument": {"variable": "hydra.core.serialization.halfBlockStyle"}}},
"argument": {"variable": "fieldExprs"}}}}}}},
"argument": {
"application": {
"function": {"variable": "hydra.core.serialization.printExpr"},
"argument": {
"application": {
"function": {
"application": {
"function": {
"application": {
"function": {"variable": "hydra.core.serialization.curlyBracesList"},
"argument": {"typeApplication": {"body": {"optional": null}, "type": {"literal": "string"}}}}},
"argument": {"variable": "hydra.core.serialization.halfBlockStyle"}}},
"argument": {"variable": "fieldExprs"}}}}}}}}}}},
"typeScheme": {
"variables": [],
"body": {"function": {"domain": {"list": {"variable": "hydra.core.model.FieldType"}}, "codomain": {"literal": "string"}}},
"constraints": []}}],
"body": {
"let": {
"bindings": [
{
"name": "gatherTypes",
"term": {
"lambda": {
"parameter": "prev",
"domain": {"list": {"variable": "hydra.core.model.Type"}},
"body": {
"lambda": {
"parameter": "app",
"domain": {"variable": "hydra.core.model.ApplicationType"},
"body": {
"let": {
"bindings": [
{
"name": "lhs",
"term": {
"application": {
"function": {"project": {"typeName": "hydra.core.model.ApplicationType", "fieldName": "function"}},
"argument": {"variable": "app"}}},
"typeScheme": {"variables": [], "body": {"variable": "hydra.core.model.Type"}, "constraints": []}}],
"body": {
"let": {
"bindings": [
{
"name": "rhs",
"term": {
"application": {
"function": {"project": {"typeName": "hydra.core.model.ApplicationType", "fieldName": "argument"}},
"argument": {"variable": "app"}}},
"typeScheme": {"variables": [], "body": {"variable": "hydra.core.model.Type"}, "constraints": []}}],
"body": {
"application": {
"function": {
"cases": {
"typeName": "hydra.core.model.Type",
"default": {
"application": {
"function": {
"application": {
"function": {"typeApplication": {"body": {"variable": "hydra.core.lib.lists.cons"}, "type": {"variable": "hydra.core.model.Type"}}},
"argument": {"variable": "lhs"}}},
"argument": {
"application": {
"function": {
"application": {
"function": {"typeApplication": {"body": {"variable": "hydra.core.lib.lists.cons"}, "type": {"variable": "hydra.core.model.Type"}}},
"argument": {"variable": "rhs"}}},
"argument": {"variable": "prev"}}}}},
"cases": [
{
"name": "application",
"handler": {
"lambda": {
"parameter": "app2",
"domain": {"variable": "hydra.core.model.ApplicationType"},
"body": {
"application": {
"function": {
"application": {
"function": {"variable": "gatherTypes"},
"argument": {
"application": {
"function": {
"application": {
"function": {"typeApplication": {"body": {"variable": "hydra.core.lib.lists.cons"}, "type": {"variable": "hydra.core.model.Type"}}},
"argument": {"variable": "rhs"}}},
"argument": {"variable": "prev"}}}}},
"argument": {"variable": "app2"}}}}}}]}},
"argument": {"variable": "lhs"}}}}}}}}}}},
"typeScheme": {
"variables": [],
"body": {
"function": {
"domain": {"list": {"variable": "hydra.core.model.Type"}},
"codomain": {
"function": {
"domain": {"variable": "hydra.core.model.ApplicationType"},
"codomain": {"list": {"variable": "hydra.core.model.Type"}}}}}},
"constraints": []}}],
"body": {
"let": {
"bindings": [
{
"name": "gatherFunctionTypes",
"term": {
"lambda": {
"parameter": "prev",
"domain": {"list": {"variable": "hydra.core.model.Type"}},
"body": {
"lambda": {
"parameter": "t",
"domain": {"variable": "hydra.core.model.Type"},
"body": {
"application": {
"function": {
"cases": {
"typeName": "hydra.core.model.Type",
"default": {
"application": {
"function": {
"typeApplication": {"body": {"variable": "hydra.core.lib.lists.reverse"}, "type": {"variable": "hydra.core.model.Type"}}},
"argument": {
"application": {
"function": {
"application": {
"function": {"typeApplication": {"body": {"variable": "hydra.core.lib.lists.cons"}, "type": {"variable": "hydra.core.model.Type"}}},
"argument": {"variable": "t"}}},
"argument": {"variable": "prev"}}}}},
"cases": [
{
"name": "function",
"handler": {
"lambda": {
"parameter": "ft",
"domain": {"variable": "hydra.core.model.FunctionType"},
"body": {
"let": {
"bindings": [
{
"name": "dom",
"term": {
"application": {
"function": {"project": {"typeName": "hydra.core.model.FunctionType", "fieldName": "domain"}},
"argument": {"variable": "ft"}}},
"typeScheme": {"variables": [], "body": {"variable": "hydra.core.model.Type"}, "constraints": []}}],
"body": {
"let": {
"bindings": [
{
"name": "cod",
"term": {
"application": {
"function": {"project": {"typeName": "hydra.core.model.FunctionType", "fieldName": "codomain"}},
"argument": {"variable": "ft"}}},
"typeScheme": {"variables": [], "body": {"variable": "hydra.core.model.Type"}, "constraints": []}}],
"body": {
"application": {
"function": {
"application": {
"function": {"variable": "gatherFunctionTypes"},
"argument": {
"application": {
"function": {
"application": {
"function": {"typeApplication": {"body": {"variable": "hydra.core.lib.lists.cons"}, "type": {"variable": "hydra.core.model.Type"}}},
"argument": {"variable": "dom"}}},
"argument": {"variable": "prev"}}}}},
"argument": {"variable": "cod"}}}}}}}}}}]}},
"argument": {"variable": "t"}}}}}}},
"typeScheme": {
"variables": [],
"body": {
"function": {
"domain": {"list": {"variable": "hydra.core.model.Type"}},
"codomain": {
"function": {"domain": {"variable": "hydra.core.model.Type"}, "codomain": {"list": {"variable": "hydra.core.model.Type"}}}}}},
"constraints": []}}],
"body": {
"let": {
"bindings": [
{
"name": "gatherForallBinders",
"term": {
"lambda": {
"parameter": "prev",
"domain": {"list": {"variable": "hydra.core.model.Name"}},
"body": {
"lambda": {
"parameter": "t",
"domain": {"variable": "hydra.core.model.Type"},
"body": {
"application": {
"function": {
"cases": {
"typeName": "hydra.core.model.Type",
"default": {
"typeApplication": {
"body": {
"typeApplication": {
"body": {
"pair": {
"first": {
"application": {
"function": {
"typeApplication": {"body": {"variable": "hydra.core.lib.lists.reverse"}, "type": {"variable": "hydra.core.model.Name"}}},
"argument": {"variable": "prev"}}},
"second": {"variable": "t"}}},
"type": {"list": {"variable": "hydra.core.model.Name"}}}},
"type": {"variable": "hydra.core.model.Type"}}},
"cases": [
{
"name": "forall",
"handler": {
"lambda": {
"parameter": "ft",
"domain": {"variable": "hydra.core.model.ForallType"},
"body": {
"let": {
"bindings": [
{
"name": "v",
"term": {
"application": {
"function": {"project": {"typeName": "hydra.core.model.ForallType", "fieldName": "parameter"}},
"argument": {"variable": "ft"}}},
"typeScheme": {"variables": [], "body": {"variable": "hydra.core.model.Name"}, "constraints": []}}],
"body": {
"let": {
"bindings": [
{
"name": "body",
"term": {
"application": {
"function": {"project": {"typeName": "hydra.core.model.ForallType", "fieldName": "body"}},
"argument": {"variable": "ft"}}},
"typeScheme": {"variables": [], "body": {"variable": "hydra.core.model.Type"}, "constraints": []}}],
"body": {
"application": {
"function": {
"application": {
"function": {"variable": "gatherForallBinders"},
"argument": {
"application": {
"function": {
"application": {
"function": {"typeApplication": {"body": {"variable": "hydra.core.lib.lists.cons"}, "type": {"variable": "hydra.core.model.Name"}}},
"argument": {"variable": "v"}}},
"argument": {"variable": "prev"}}}}},
"argument": {"variable": "body"}}}}}}}}}}]}},
"argument": {"variable": "t"}}}}}}},
"typeScheme": {
"variables": [],
"body": {
"function": {
"domain": {"list": {"variable": "hydra.core.model.Name"}},
"codomain": {
"function": {
"domain": {"variable": "hydra.core.model.Type"},
"codomain": {"pair": {"first": {"list": {"variable": "hydra.core.model.Name"}}, "second": {"variable": "hydra.core.model.Type"}}}}}}},
"constraints": []}}],
"body": {
"application": {
"function": {
"cases": {
"typeName": "hydra.core.model.Type",
"cases": [
{
"name": "annotated",
"handler": {
"lambda": {
"parameter": "at",
"domain": {"variable": "hydra.core.model.AnnotatedType"},
"body": {
"let": {
"bindings": [
{
"name": "bodyStr",
"term": {
"application": {
"function": {
"application": {
"function": {"application": {"function": {"variable": "hydra.core.print.model.typeAtPrec"}, "argument": {"variable": "aliases"}}},
"argument": {"literal": {"integer": {"int32": 3}}}}},
"argument": {
"application": {
"function": {"project": {"typeName": "hydra.core.model.AnnotatedType", "fieldName": "body"}},
"argument": {"variable": "at"}}}}},
"typeScheme": {"variables": [], "body": {"literal": "string"}, "constraints": []}}],
"body": {
"let": {
"bindings": [
{
"name": "annStr",
"term": {
"application": {
"function": {
"application": {
"function": {"application": {"function": {"variable": "hydra.core.print.model.termAtPrec"}, "argument": {"variable": "aliases"}}},
"argument": {"literal": {"integer": {"int32": 3}}}}},
"argument": {
"application": {
"function": {"project": {"typeName": "hydra.core.model.AnnotatedType", "fieldName": "annotation"}},
"argument": {"variable": "at"}}}}},
"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": {
"application": {
"function": {"typeApplication": {"body": {"variable": "hydra.core.lib.ordering.lt"}, "type": {"literal": {"integer": "int32"}}}},
"argument": {"literal": {"integer": {"int32": 3}}}}},
"argument": {"variable": "ctx"}}}}},
"argument": {
"application": {
"function": {"variable": "hydra.core.lib.strings.concat"},
"argument": {
"list": [
{"literal": {"string": "("}},
{
"application": {
"function": {"variable": "hydra.core.lib.strings.concat"},
"argument": {"list": [{"variable": "bodyStr"}, {"literal": {"string": "@"}}, {"variable": "annStr"}]}}},
{"literal": {"string": ")"}}]}}}}},
"argument": {
"application": {
"function": {"variable": "hydra.core.lib.strings.concat"},
"argument": {"list": [{"variable": "bodyStr"}, {"literal": {"string": "@"}}, {"variable": "annStr"}]}}}}}}}}}}}},
{
"name": "application",
"handler": {
"lambda": {
"parameter": "app",
"domain": {"variable": "hydra.core.model.ApplicationType"},
"body": {
"let": {
"bindings": [
{
"name": "types",
"term": {
"application": {
"function": {
"application": {
"function": {"variable": "gatherTypes"},
"argument": {"typeApplication": {"body": {"list": []}, "type": {"variable": "hydra.core.model.Type"}}}}},
"argument": {"variable": "app"}}},
"typeScheme": {"variables": [], "body": {"list": {"variable": "hydra.core.model.Type"}}, "constraints": []}}],
"body": {
"let": {
"bindings": [
{
"name": "typeStrs",
"term": {
"application": {
"function": {
"application": {
"function": {
"typeApplication": {
"body": {"typeApplication": {"body": {"variable": "hydra.core.lib.lists.map"}, "type": {"variable": "hydra.core.model.Type"}}},
"type": {"literal": "string"}}},
"argument": {
"lambda": {
"parameter": "e",
"domain": {"variable": "hydra.core.model.Type"},
"body": {
"application": {
"function": {
"application": {
"function": {"application": {"function": {"variable": "hydra.core.print.model.typeAtPrec"}, "argument": {"variable": "aliases"}}},
"argument": {"literal": {"integer": {"int32": 3}}}}},
"argument": {"variable": "e"}}}}}}},
"argument": {"variable": "types"}}},
"typeScheme": {"variables": [], "body": {"list": {"literal": "string"}}, "constraints": []}}],
"body": {
"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.lt"}, "type": {"literal": {"integer": "int32"}}}},
"argument": {"literal": {"integer": {"int32": 2}}}}},
"argument": {"variable": "ctx"}}}}},
"argument": {
"application": {
"function": {"variable": "hydra.core.lib.strings.concat"},
"argument": {
"list": [
{"literal": {"string": "("}},
{
"application": {
"function": {"application": {"function": {"variable": "hydra.core.lib.strings.join"}, "argument": {"literal": {"string": " "}}}},
"argument": {"variable": "typeStrs"}}},
{"literal": {"string": ")"}}]}}}}},
"argument": {
"application": {
"function": {"application": {"function": {"variable": "hydra.core.lib.strings.join"}, "argument": {"literal": {"string": " "}}}},
"argument": {"variable": "typeStrs"}}}}}}}}}}}},
{
"name": "effect",
"handler": {
"lambda": {
"parameter": "etyp",
"domain": {"variable": "hydra.core.model.Type"},
"body": {
"application": {
"function": {"variable": "hydra.core.lib.strings.concat"},
"argument": {
"list": [
{"literal": {"string": "effect<"}},
{
"application": {
"function": {"application": {"function": {"variable": "hydra.core.print.model.typeAliased"}, "argument": {"variable": "aliases"}}},
"argument": {"variable": "etyp"}}},
{"literal": {"string": ">"}}]}}}}}},
{
"name": "either",
"handler": {
"lambda": {
"parameter": "et",
"domain": {"variable": "hydra.core.model.EitherType"},
"body": {
"let": {
"bindings": [
{
"name": "leftTyp",
"term": {
"application": {
"function": {"project": {"typeName": "hydra.core.model.EitherType", "fieldName": "left"}},
"argument": {"variable": "et"}}},
"typeScheme": {"variables": [], "body": {"variable": "hydra.core.model.Type"}, "constraints": []}}],
"body": {
"let": {
"bindings": [
{
"name": "rightTyp",
"term": {
"application": {
"function": {"project": {"typeName": "hydra.core.model.EitherType", "fieldName": "right"}},
"argument": {"variable": "et"}}},
"typeScheme": {"variables": [], "body": {"variable": "hydra.core.model.Type"}, "constraints": []}}],
"body": {
"application": {
"function": {"variable": "hydra.core.lib.strings.concat"},
"argument": {
"list": [
{"literal": {"string": "either<"}},
{
"application": {
"function": {"application": {"function": {"variable": "hydra.core.print.model.typeAliased"}, "argument": {"variable": "aliases"}}},
"argument": {"variable": "leftTyp"}}},
{"literal": {"string": ", "}},
{
"application": {
"function": {"application": {"function": {"variable": "hydra.core.print.model.typeAliased"}, "argument": {"variable": "aliases"}}},
"argument": {"variable": "rightTyp"}}},
{"literal": {"string": ">"}}]}}}}}}}}}},
{
"name": "forall",
"handler": {
"lambda": {
"parameter": "ft",
"domain": {"variable": "hydra.core.model.ForallType"},
"body": {
"let": {
"bindings": [
{
"name": "binderVars",
"term": {
"application": {
"function": {
"application": {
"function": {"variable": "gatherForallBinders"},
"argument": {"typeApplication": {"body": {"list": []}, "type": {"variable": "hydra.core.model.Name"}}}}},
"argument": {"variable": "typ"}}},
"typeScheme": {
"variables": [],
"body": {"pair": {"first": {"list": {"variable": "hydra.core.model.Name"}}, "second": {"variable": "hydra.core.model.Type"}}},
"constraints": []}}],
"body": {
"let": {
"bindings": [
{
"name": "vs",
"term": {
"application": {
"function": {
"typeApplication": {
"body": {
"typeApplication": {"body": {"variable": "hydra.core.lib.pairs.first"}, "type": {"list": {"variable": "hydra.core.model.Name"}}}},
"type": {"variable": "hydra.core.model.Type"}}},
"argument": {"variable": "binderVars"}}},
"typeScheme": {"variables": [], "body": {"list": {"variable": "hydra.core.model.Name"}}, "constraints": []}}],
"body": {
"let": {
"bindings": [
{
"name": "body",
"term": {
"application": {
"function": {
"typeApplication": {
"body": {
"typeApplication": {"body": {"variable": "hydra.core.lib.pairs.second"}, "type": {"list": {"variable": "hydra.core.model.Name"}}}},
"type": {"variable": "hydra.core.model.Type"}}},
"argument": {"variable": "binderVars"}}},
"typeScheme": {"variables": [], "body": {"variable": "hydra.core.model.Type"}, "constraints": []}}],
"body": {
"let": {
"bindings": [
{
"name": "vNames",
"term": {
"application": {
"function": {
"application": {
"function": {
"typeApplication": {
"body": {"typeApplication": {"body": {"variable": "hydra.core.lib.lists.map"}, "type": {"variable": "hydra.core.model.Name"}}},
"type": {"literal": "string"}}},
"argument": {"variable": "hydra.core.print.model.printBinderName"}}},
"argument": {"variable": "vs"}}},
"typeScheme": {"variables": [], "body": {"list": {"literal": "string"}}, "constraints": []}}],
"body": {
"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.lt"}, "type": {"literal": {"integer": "int32"}}}},
"argument": {"literal": {"integer": {"int32": 0}}}}},
"argument": {"variable": "ctx"}}}}},
"argument": {
"application": {
"function": {"variable": "hydra.core.lib.strings.concat"},
"argument": {
"list": [
{"literal": {"string": "("}},
{
"application": {
"function": {"variable": "hydra.core.lib.strings.concat"},
"argument": {
"list": [
{"literal": {"string": "forall "}},
{
"application": {
"function": {"application": {"function": {"variable": "hydra.core.lib.strings.join"}, "argument": {"literal": {"string": ", "}}}},
"argument": {"variable": "vNames"}}},
{"literal": {"string": ". "}},
{
"application": {
"function": {"application": {"function": {"variable": "hydra.core.print.model.typeAliased"}, "argument": {"variable": "aliases"}}},
"argument": {"variable": "body"}}}]}}},
{"literal": {"string": ")"}}]}}}}},
"argument": {
"application": {
"function": {"variable": "hydra.core.lib.strings.concat"},
"argument": {
"list": [
{"literal": {"string": "forall "}},
{
"application": {
"function": {"application": {"function": {"variable": "hydra.core.lib.strings.join"}, "argument": {"literal": {"string": ", "}}}},
"argument": {"variable": "vNames"}}},
{"literal": {"string": ". "}},
{
"application": {
"function": {"application": {"function": {"variable": "hydra.core.print.model.typeAliased"}, "argument": {"variable": "aliases"}}},
"argument": {"variable": "body"}}}]}}}}}}}}}}}}}}}},
{
"name": "function",
"handler": {
"lambda": {
"parameter": "ft",
"domain": {"variable": "hydra.core.model.FunctionType"},
"body": {
"let": {
"bindings": [
{
"name": "types",
"term": {
"application": {
"function": {
"application": {
"function": {"variable": "gatherFunctionTypes"},
"argument": {"typeApplication": {"body": {"list": []}, "type": {"variable": "hydra.core.model.Type"}}}}},
"argument": {"variable": "typ"}}},
"typeScheme": {"variables": [], "body": {"list": {"variable": "hydra.core.model.Type"}}, "constraints": []}}],
"body": {
"let": {
"bindings": [
{
"name": "typeStrs",
"term": {
"application": {
"function": {
"application": {
"function": {
"typeApplication": {
"body": {"typeApplication": {"body": {"variable": "hydra.core.lib.lists.map"}, "type": {"variable": "hydra.core.model.Type"}}},
"type": {"literal": "string"}}},
"argument": {
"lambda": {
"parameter": "e",
"domain": {"variable": "hydra.core.model.Type"},
"body": {
"application": {
"function": {
"application": {
"function": {"application": {"function": {"variable": "hydra.core.print.model.typeAtPrec"}, "argument": {"variable": "aliases"}}},
"argument": {"literal": {"integer": {"int32": 2}}}}},
"argument": {"variable": "e"}}}}}}},
"argument": {"variable": "types"}}},
"typeScheme": {"variables": [], "body": {"list": {"literal": "string"}}, "constraints": []}}],
"body": {
"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.lt"}, "type": {"literal": {"integer": "int32"}}}},
"argument": {"literal": {"integer": {"int32": 1}}}}},
"argument": {"variable": "ctx"}}}}},
"argument": {
"application": {
"function": {"variable": "hydra.core.lib.strings.concat"},
"argument": {
"list": [
{"literal": {"string": "("}},
{
"application": {
"function": {"application": {"function": {"variable": "hydra.core.lib.strings.join"}, "argument": {"literal": {"string": " → "}}}},
"argument": {"variable": "typeStrs"}}},
{"literal": {"string": ")"}}]}}}}},
"argument": {
"application": {
"function": {"application": {"function": {"variable": "hydra.core.lib.strings.join"}, "argument": {"literal": {"string": " → "}}}},
"argument": {"variable": "typeStrs"}}}}}}}}}}}},
{
"name": "list",
"handler": {
"lambda": {
"parameter": "etyp",
"domain": {"variable": "hydra.core.model.Type"},
"body": {
"application": {
"function": {"variable": "hydra.core.lib.strings.concat"},
"argument": {
"list": [
{"literal": {"string": "list<"}},
{
"application": {
"function": {"application": {"function": {"variable": "hydra.core.print.model.typeAliased"}, "argument": {"variable": "aliases"}}},
"argument": {"variable": "etyp"}}},
{"literal": {"string": ">"}}]}}}}}},
{
"name": "literal",
"handler": {
"lambda": {
"parameter": "lt",
"domain": {"variable": "hydra.core.model.LiteralType"},
"body": {"application": {"function": {"variable": "hydra.core.print.model.literalType"}, "argument": {"variable": "lt"}}}}}},
{
"name": "map",
"handler": {
"lambda": {
"parameter": "mt",
"domain": {"variable": "hydra.core.model.MapType"},
"body": {
"let": {
"bindings": [
{
"name": "keyTyp",
"term": {
"application": {"function": {"project": {"typeName": "hydra.core.model.MapType", "fieldName": "keys"}}, "argument": {"variable": "mt"}}},
"typeScheme": {"variables": [], "body": {"variable": "hydra.core.model.Type"}, "constraints": []}}],
"body": {
"let": {
"bindings": [
{
"name": "valTyp",
"term": {
"application": {
"function": {"project": {"typeName": "hydra.core.model.MapType", "fieldName": "values"}},
"argument": {"variable": "mt"}}},
"typeScheme": {"variables": [], "body": {"variable": "hydra.core.model.Type"}, "constraints": []}}],
"body": {
"application": {
"function": {"variable": "hydra.core.lib.strings.concat"},
"argument": {
"list": [
{"literal": {"string": "map<"}},
{
"application": {
"function": {"application": {"function": {"variable": "hydra.core.print.model.typeAliased"}, "argument": {"variable": "aliases"}}},
"argument": {"variable": "keyTyp"}}},
{"literal": {"string": ", "}},
{
"application": {
"function": {"application": {"function": {"variable": "hydra.core.print.model.typeAliased"}, "argument": {"variable": "aliases"}}},
"argument": {"variable": "valTyp"}}},
{"literal": {"string": ">"}}]}}}}}}}}}},
{
"name": "optional",
"handler": {
"lambda": {
"parameter": "etyp",
"domain": {"variable": "hydra.core.model.Type"},
"body": {
"application": {
"function": {"variable": "hydra.core.lib.strings.concat"},
"argument": {
"list": [
{"literal": {"string": "optional<"}},
{
"application": {
"function": {"application": {"function": {"variable": "hydra.core.print.model.typeAliased"}, "argument": {"variable": "aliases"}}},
"argument": {"variable": "etyp"}}},
{"literal": {"string": ">"}}]}}}}}},
{
"name": "pair",
"handler": {
"lambda": {
"parameter": "pt",
"domain": {"variable": "hydra.core.model.PairType"},
"body": {
"let": {
"bindings": [
{
"name": "firstTyp",
"term": {
"application": {
"function": {"project": {"typeName": "hydra.core.model.PairType", "fieldName": "first"}},
"argument": {"variable": "pt"}}},
"typeScheme": {"variables": [], "body": {"variable": "hydra.core.model.Type"}, "constraints": []}}],
"body": {
"let": {
"bindings": [
{
"name": "secondTyp",
"term": {
"application": {
"function": {"project": {"typeName": "hydra.core.model.PairType", "fieldName": "second"}},
"argument": {"variable": "pt"}}},
"typeScheme": {"variables": [], "body": {"variable": "hydra.core.model.Type"}, "constraints": []}}],
"body": {
"application": {
"function": {"variable": "hydra.core.lib.strings.concat"},
"argument": {
"list": [
{"literal": {"string": "("}},
{
"application": {
"function": {"application": {"function": {"variable": "hydra.core.print.model.typeAliased"}, "argument": {"variable": "aliases"}}},
"argument": {"variable": "firstTyp"}}},
{"literal": {"string": ", "}},
{
"application": {
"function": {"application": {"function": {"variable": "hydra.core.print.model.typeAliased"}, "argument": {"variable": "aliases"}}},
"argument": {"variable": "secondTyp"}}},
{"literal": {"string": ")"}}]}}}}}}}}}},
{
"name": "record",
"handler": {
"lambda": {
"parameter": "rt",
"domain": {"list": {"variable": "hydra.core.model.FieldType"}},
"body": {
"application": {
"function": {
"application": {"function": {"variable": "hydra.core.lib.strings.concat2"}, "argument": {"literal": {"string": "record"}}}},
"argument": {"application": {"function": {"variable": "showRowType"}, "argument": {"variable": "rt"}}}}}}}},
{
"name": "set",
"handler": {
"lambda": {
"parameter": "etyp",
"domain": {"variable": "hydra.core.model.Type"},
"body": {
"application": {
"function": {"variable": "hydra.core.lib.strings.concat"},
"argument": {
"list": [
{"literal": {"string": "set<"}},
{
"application": {
"function": {"application": {"function": {"variable": "hydra.core.print.model.typeAliased"}, "argument": {"variable": "aliases"}}},
"argument": {"variable": "etyp"}}},
{"literal": {"string": ">"}}]}}}}}},
{
"name": "union",
"handler": {
"lambda": {
"parameter": "rt",
"domain": {"list": {"variable": "hydra.core.model.FieldType"}},
"body": {
"application": {
"function": {
"application": {"function": {"variable": "hydra.core.lib.strings.concat2"}, "argument": {"literal": {"string": "union"}}}},
"argument": {"application": {"function": {"variable": "showRowType"}, "argument": {"variable": "rt"}}}}}}}},
{"name": "unit", "handler": {"lambda": {"parameter": "_", "domain": "unit", "body": {"literal": {"string": "unit"}}}}},
{
"name": "variable",
"handler": {
"lambda": {
"parameter": "name",
"domain": {"variable": "hydra.core.model.Name"},
"body": {
"application": {
"function": {
"application": {"function": {"variable": "hydra.core.print.model.printNameAliased"}, "argument": {"variable": "aliases"}}},
"argument": {"variable": "name"}}}}}},
{"name": "void", "handler": {"lambda": {"parameter": "_", "domain": "unit", "body": {"literal": {"string": "void"}}}}},
{
"name": "wrap",
"handler": {
"lambda": {
"parameter": "wt",
"domain": {"variable": "hydra.core.model.Type"},
"body": {
"application": {
"function": {"variable": "hydra.core.lib.strings.concat"},
"argument": {
"list": [
{"literal": {"string": "wrap("}},
{
"application": {
"function": {"application": {"function": {"variable": "hydra.core.print.model.typeAliased"}, "argument": {"variable": "aliases"}}},
"argument": {"variable": "wt"}}},
{"literal": {"string": ")"}}]}}}}}}]}},
"argument": {"variable": "typ"}}}}}}}}}}}}}}}}}}},
"annotation": {
"map": [
{
"key": {"variable": "description"},
"value": {"literal": {"string": "Show a type as a string at a given minimum context precedence, adding minimal parentheses"}}}]}}}}},
{
"term": {
"name": "hydra.core.print.model.typeScheme",
"signature": {
"typeParameters": [],
"parameters": [{"name": "arg0", "type": {"variable": "hydra.core.model.TypeScheme"}, "isLazy": false}],
"result": {"type": {"literal": "string"}}},
"body": {
"annotated": {
"body": {
"application": {
"function": {"variable": "hydra.core.print.model.typeSchemeAliased"},
"argument": {
"typeApplication": {
"body": {
"typeApplication": {"body": {"variable": "hydra.core.lib.maps.empty"}, "type": {"variable": "hydra.core.packaging.ModuleName"}}},
"type": {"literal": "string"}}}}},
"annotation": {"map": [{"key": {"variable": "description"}, "value": {"literal": {"string": "Show a type scheme as a string"}}}]}}}}},
{
"term": {
"name": "hydra.core.print.model.typeSchemeAliased",
"signature": {
"typeParameters": [],
"parameters": [
{
"name": "arg0",
"type": {"map": {"keys": {"variable": "hydra.core.packaging.ModuleName"}, "values": {"literal": "string"}}},
"isLazy": false},
{"name": "arg1", "type": {"variable": "hydra.core.model.TypeScheme"}, "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": "ts",
"domain": {"variable": "hydra.core.model.TypeScheme"},
"body": {
"let": {
"bindings": [
{
"name": "vars",
"term": {
"application": {
"function": {"project": {"typeName": "hydra.core.model.TypeScheme", "fieldName": "variables"}},
"argument": {"variable": "ts"}}},
"typeScheme": {"variables": [], "body": {"list": {"variable": "hydra.core.model.Name"}}, "constraints": []}}],
"body": {
"let": {
"bindings": [
{
"name": "body",
"term": {
"application": {
"function": {"project": {"typeName": "hydra.core.model.TypeScheme", "fieldName": "body"}},
"argument": {"variable": "ts"}}},
"typeScheme": {"variables": [], "body": {"variable": "hydra.core.model.Type"}, "constraints": []}}],
"body": {
"let": {
"bindings": [
{
"name": "varNames",
"term": {
"application": {
"function": {
"application": {
"function": {
"typeApplication": {
"body": {"typeApplication": {"body": {"variable": "hydra.core.lib.lists.map"}, "type": {"variable": "hydra.core.model.Name"}}},
"type": {"literal": "string"}}},
"argument": {"variable": "hydra.core.print.model.printBinderName"}}},
"argument": {"variable": "vars"}}},
"typeScheme": {"variables": [], "body": {"list": {"literal": "string"}}, "constraints": []}}],
"body": {
"let": {
"bindings": [
{
"name": "constraintClassName",
"term": {
"lambda": {
"parameter": "c",
"domain": {"variable": "hydra.core.model.TypeClassConstraint"},
"body": {
"application": {
"function": {
"cases": {
"typeName": "hydra.core.model.TypeClassConstraint",
"cases": [
{
"name": "simple",
"handler": {
"lambda": {
"parameter": "n",
"domain": {"variable": "hydra.core.model.Name"},
"body": {"application": {"function": {"unwrap": "hydra.core.model.Name"}, "argument": {"variable": "n"}}}}}}]}},
"argument": {"variable": "c"}}}}},
"typeScheme": {
"variables": [],
"body": {"function": {"domain": {"variable": "hydra.core.model.TypeClassConstraint"}, "codomain": {"literal": "string"}}},
"constraints": []}}],
"body": {
"let": {
"bindings": [
{
"name": "toConstraintPair",
"term": {
"lambda": {
"parameter": "v",
"domain": {"variable": "hydra.core.model.Name"},
"body": {
"lambda": {
"parameter": "c",
"domain": {"variable": "hydra.core.model.TypeClassConstraint"},
"body": {
"application": {
"function": {"variable": "hydra.core.lib.strings.concat"},
"argument": {
"list": [
{"application": {"function": {"variable": "constraintClassName"}, "argument": {"variable": "c"}}},
{"literal": {"string": " "}},
{"application": {"function": {"unwrap": "hydra.core.model.Name"}, "argument": {"variable": "v"}}}]}}}}}}},
"typeScheme": {
"variables": [],
"body": {
"function": {
"domain": {"variable": "hydra.core.model.Name"},
"codomain": {"function": {"domain": {"variable": "hydra.core.model.TypeClassConstraint"}, "codomain": {"literal": "string"}}}}},
"constraints": []}}],
"body": {
"let": {
"bindings": [
{
"name": "toConstraintPairs",
"term": {
"lambda": {
"parameter": "p",
"domain": {
"pair": {"first": {"variable": "hydra.core.model.Name"}, "second": {"variable": "hydra.core.model.TypeVariableConstraints"}}},
"body": {
"application": {
"function": {
"application": {
"function": {
"typeApplication": {
"body": {
"typeApplication": {"body": {"variable": "hydra.core.lib.lists.map"}, "type": {"variable": "hydra.core.model.TypeClassConstraint"}}},
"type": {"literal": "string"}}},
"argument": {
"application": {
"function": {"variable": "toConstraintPair"},
"argument": {
"application": {
"function": {
"typeApplication": {
"body": {"typeApplication": {"body": {"variable": "hydra.core.lib.pairs.first"}, "type": {"variable": "hydra.core.model.Name"}}},
"type": {"variable": "hydra.core.model.TypeVariableConstraints"}}},
"argument": {"variable": "p"}}}}}}},
"argument": {
"application": {
"function": {
"application": {
"function": {
"typeApplication": {
"body": {
"typeApplication": {"body": {"variable": "hydra.core.lib.lists.sortBy"}, "type": {"variable": "hydra.core.model.TypeClassConstraint"}}},
"type": {"literal": "string"}}},
"argument": {"variable": "constraintClassName"}}},
"argument": {
"application": {
"function": {
"typeApplication": {"body": {"variable": "hydra.core.lib.sets.toList"}, "type": {"variable": "hydra.core.model.TypeClassConstraint"}}},
"argument": {
"application": {
"function": {"project": {"typeName": "hydra.core.model.TypeVariableConstraints", "fieldName": "classes"}},
"argument": {
"application": {
"function": {
"typeApplication": {
"body": {
"typeApplication": {"body": {"variable": "hydra.core.lib.pairs.second"}, "type": {"variable": "hydra.core.model.Name"}}},
"type": {"variable": "hydra.core.model.TypeVariableConstraints"}}},
"argument": {"variable": "p"}}}}}}}}}}}}},
"typeScheme": {
"variables": [],
"body": {
"function": {
"domain": {
"pair": {"first": {"variable": "hydra.core.model.Name"}, "second": {"variable": "hydra.core.model.TypeVariableConstraints"}}},
"codomain": {"list": {"literal": "string"}}}},
"constraints": []}}],
"body": {
"let": {
"bindings": [
{
"name": "tc",
"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": {
"pair": {"first": {"variable": "hydra.core.model.Name"}, "second": {"variable": "hydra.core.model.TypeVariableConstraints"}}}}},
"type": {"list": {"literal": "string"}}}},
"argument": {"variable": "toConstraintPairs"}}},
"argument": {
"application": {
"function": {
"application": {
"function": {
"typeApplication": {
"body": {
"typeApplication": {
"body": {"variable": "hydra.core.lib.lists.sortBy"},
"type": {
"pair": {"first": {"variable": "hydra.core.model.Name"}, "second": {"variable": "hydra.core.model.TypeVariableConstraints"}}}}},
"type": {"variable": "hydra.core.model.Name"}}},
"argument": {
"typeApplication": {
"body": {"typeApplication": {"body": {"variable": "hydra.core.lib.pairs.first"}, "type": {"variable": "hydra.core.model.Name"}}},
"type": {"variable": "hydra.core.model.TypeVariableConstraints"}}}}},
"argument": {
"application": {
"function": {
"typeApplication": {
"body": {"typeApplication": {"body": {"variable": "hydra.core.lib.maps.toList"}, "type": {"variable": "hydra.core.model.Name"}}},
"type": {"variable": "hydra.core.model.TypeVariableConstraints"}}},
"argument": {
"application": {
"function": {"project": {"typeName": "hydra.core.model.TypeScheme", "fieldName": "constraints"}},
"argument": {"variable": "ts"}}}}}}}}}}},
"typeScheme": {"variables": [], "body": {"list": {"literal": "string"}}, "constraints": []}}],
"body": {
"let": {
"bindings": [
{
"name": "bodyStr",
"term": {
"application": {
"function": {"application": {"function": {"variable": "hydra.core.print.model.typeAliased"}, "argument": {"variable": "aliases"}}},
"argument": {"variable": "body"}}},
"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": {"typeApplication": {"body": {"variable": "hydra.core.lib.lists.isEmpty"}, "type": {"literal": "string"}}},
"argument": {"variable": "varNames"}}}}},
"argument": {"variable": "bodyStr"}}},
"argument": {
"application": {
"function": {"variable": "hydra.core.lib.strings.concat"},
"argument": {
"list": [
{"literal": {"string": "∀"}},
{
"application": {
"function": {"application": {"function": {"variable": "hydra.core.lib.strings.join"}, "argument": {"literal": {"string": ", "}}}},
"argument": {"variable": "varNames"}}},
{"literal": {"string": "."}},
{
"application": {
"function": {
"application": {
"function": {
"application": {
"function": {"typeApplication": {"body": {"variable": "hydra.core.lib.logic.ifElse"}, "type": {"literal": "string"}}},
"argument": {
"application": {
"function": {"typeApplication": {"body": {"variable": "hydra.core.lib.lists.isEmpty"}, "type": {"literal": "string"}}},
"argument": {"variable": "tc"}}}}},
"argument": {"literal": {"string": ""}}}},
"argument": {
"application": {
"function": {"variable": "hydra.core.lib.strings.concat"},
"argument": {
"list": [
{"literal": {"string": "("}},
{
"application": {
"function": {"application": {"function": {"variable": "hydra.core.lib.strings.join"}, "argument": {"literal": {"string": ", "}}}},
"argument": {"variable": "tc"}}},
{"literal": {"string": ") ⇒ "}}]}}}}},
{"variable": "bodyStr"}]}}}}}}}}}}}}}}}}}}}}}}}}},
"annotation": {
"map": [
{
"key": {"variable": "description"},
"value": {
"literal": {"string": "Show a type scheme as a string, shortening nominal references in its body via the given alias map (#803)"}}}]}}}}}]}