hydra-kernel-0.18.1: hydra-kernel-json/hydra/core/serialization.json
{
"name": "hydra.core.serialization",
"metadata": {
"description": "Utilities for constructing generic program code ASTs, used for the serialization phase of source code generation.",
"comments": [],
"seeAlso": [],
"provisions": []},
"dependencies": [
{"module": "hydra.core.ast"},
{"module": "hydra.core.formatting"},
{"module": "hydra.core.lib.equality"},
{"module": "hydra.core.lib.lists"},
{"module": "hydra.core.lib.literals"},
{"module": "hydra.core.lib.logic"},
{"module": "hydra.core.lib.math"},
{"module": "hydra.core.lib.optionals"},
{"module": "hydra.core.lib.ordering"},
{"module": "hydra.core.lib.pairs"},
{"module": "hydra.core.lib.strings"},
{"module": "hydra.core.util"}],
"definitions": [
{
"term": {
"name": "hydra.core.serialization.angleBraces",
"signature": {"typeParameters": [], "parameters": [], "result": {"type": {"variable": "hydra.core.ast.Brackets"}}},
"body": {
"annotated": {
"body": {
"record": {
"typeName": "hydra.core.ast.Brackets",
"fields": [
{"name": "open", "term": {"wrap": {"typeName": "hydra.core.ast.Symbol", "body": {"literal": {"string": "<"}}}}},
{"name": "close", "term": {"wrap": {"typeName": "hydra.core.ast.Symbol", "body": {"literal": {"string": ">"}}}}}]}},
"annotation": {
"map": [
{
"key": {"variable": "description"},
"value": {"literal": {"string": "Angle bracket pair `<` `>` for use with `brackets`"}}}]}}}}},
{
"term": {
"name": "hydra.core.serialization.angleBracesList",
"signature": {
"typeParameters": [],
"parameters": [
{"name": "arg0", "type": {"variable": "hydra.core.ast.BlockStyle"}, "isLazy": false},
{"name": "arg1", "type": {"list": {"variable": "hydra.core.ast.Expr"}}, "isLazy": false}],
"result": {"type": {"variable": "hydra.core.ast.Expr"}}},
"body": {
"annotated": {
"body": {
"lambda": {
"parameter": "style",
"domain": {"variable": "hydra.core.ast.BlockStyle"},
"body": {
"lambda": {
"parameter": "els",
"domain": {"list": {"variable": "hydra.core.ast.Expr"}},
"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": "els"}}}}},
"argument": {"application": {"function": {"variable": "hydra.core.serialization.cst"}, "argument": {"literal": {"string": "<>"}}}}}},
"argument": {
"application": {
"function": {
"application": {
"function": {
"application": {
"function": {"variable": "hydra.core.serialization.brackets"},
"argument": {"variable": "hydra.core.serialization.angleBraces"}}},
"argument": {"variable": "style"}}},
"argument": {
"application": {
"function": {"application": {"function": {"variable": "hydra.core.serialization.commaSep"}, "argument": {"variable": "style"}}},
"argument": {"variable": "els"}}}}}}}}}}},
"annotation": {
"map": [
{
"key": {"variable": "description"},
"value": {
"literal": {"string": "Comma-separate the elements inside angle brackets in the given block style; renders as `<>` when empty"}}}]}}}}},
{
"term": {
"name": "hydra.core.serialization.bracesListAdaptive",
"signature": {
"typeParameters": [],
"parameters": [{"name": "arg0", "type": {"list": {"variable": "hydra.core.ast.Expr"}}, "isLazy": false}],
"result": {"type": {"variable": "hydra.core.ast.Expr"}}},
"body": {
"annotated": {
"body": {
"lambda": {
"parameter": "els",
"domain": {"list": {"variable": "hydra.core.ast.Expr"}},
"body": {
"application": {
"function": {
"application": {
"function": {
"application": {
"function": {"variable": "hydra.core.serialization.chooseLayout"},
"argument": {"variable": "hydra.core.serialization.maxLineWidth"}}},
"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": "els"}}}}},
"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": "els"}}}}}}},
"annotation": {
"map": [
{
"key": {"variable": "description"},
"value": {
"literal": {
"string": "Produce a bracketed list which separates elements by spaces or newlines depending on the estimated width of the expression."}}}]}}}}},
{
"term": {
"name": "hydra.core.serialization.bracketList",
"signature": {
"typeParameters": [],
"parameters": [
{"name": "arg0", "type": {"variable": "hydra.core.ast.BlockStyle"}, "isLazy": false},
{"name": "arg1", "type": {"list": {"variable": "hydra.core.ast.Expr"}}, "isLazy": false}],
"result": {"type": {"variable": "hydra.core.ast.Expr"}}},
"body": {
"annotated": {
"body": {
"lambda": {
"parameter": "style",
"domain": {"variable": "hydra.core.ast.BlockStyle"},
"body": {
"lambda": {
"parameter": "els",
"domain": {"list": {"variable": "hydra.core.ast.Expr"}},
"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": "els"}}}}},
"argument": {"application": {"function": {"variable": "hydra.core.serialization.cst"}, "argument": {"literal": {"string": "[]"}}}}}},
"argument": {
"application": {
"function": {
"application": {
"function": {
"application": {
"function": {"variable": "hydra.core.serialization.brackets"},
"argument": {"variable": "hydra.core.serialization.squareBrackets"}}},
"argument": {"variable": "style"}}},
"argument": {
"application": {
"function": {"application": {"function": {"variable": "hydra.core.serialization.commaSep"}, "argument": {"variable": "style"}}},
"argument": {"variable": "els"}}}}}}}}}}},
"annotation": {
"map": [
{
"key": {"variable": "description"},
"value": {
"literal": {"string": "Comma-separate the elements inside square brackets in the given block style; renders as `[]` when empty"}}}]}}}}},
{
"term": {
"name": "hydra.core.serialization.bracketListAdaptive",
"signature": {
"typeParameters": [],
"parameters": [{"name": "arg0", "type": {"list": {"variable": "hydra.core.ast.Expr"}}, "isLazy": false}],
"result": {"type": {"variable": "hydra.core.ast.Expr"}}},
"body": {
"annotated": {
"body": {
"lambda": {
"parameter": "els",
"domain": {"list": {"variable": "hydra.core.ast.Expr"}},
"body": {
"application": {
"function": {
"application": {
"function": {
"application": {
"function": {"variable": "hydra.core.serialization.chooseLayout"},
"argument": {"variable": "hydra.core.serialization.maxLineWidth"}}},
"argument": {
"application": {
"function": {
"application": {
"function": {"variable": "hydra.core.serialization.bracketList"},
"argument": {"variable": "hydra.core.serialization.inlineStyle"}}},
"argument": {"variable": "els"}}}}},
"argument": {
"application": {
"function": {
"application": {
"function": {"variable": "hydra.core.serialization.bracketList"},
"argument": {"variable": "hydra.core.serialization.halfBlockStyle"}}},
"argument": {"variable": "els"}}}}}}},
"annotation": {
"map": [
{
"key": {"variable": "description"},
"value": {
"literal": {
"string": "Produce a bracketed list which separates elements by spaces or newlines depending on the estimated width of the expression."}}}]}}}}},
{
"term": {
"name": "hydra.core.serialization.brackets",
"signature": {
"typeParameters": [],
"parameters": [
{"name": "arg0", "type": {"variable": "hydra.core.ast.Brackets"}, "isLazy": false},
{"name": "arg1", "type": {"variable": "hydra.core.ast.BlockStyle"}, "isLazy": false},
{"name": "arg2", "type": {"variable": "hydra.core.ast.Expr"}, "isLazy": false}],
"result": {"type": {"variable": "hydra.core.ast.Expr"}}},
"body": {
"annotated": {
"body": {
"lambda": {
"parameter": "br",
"domain": {"variable": "hydra.core.ast.Brackets"},
"body": {
"lambda": {
"parameter": "style",
"domain": {"variable": "hydra.core.ast.BlockStyle"},
"body": {
"lambda": {
"parameter": "e",
"domain": {"variable": "hydra.core.ast.Expr"},
"body": {
"inject": {
"typeName": "hydra.core.ast.Expr",
"field": {
"name": "brackets",
"term": {
"record": {
"typeName": "hydra.core.ast.BracketExpr",
"fields": [
{"name": "brackets", "term": {"variable": "br"}},
{"name": "enclosed", "term": {"variable": "e"}},
{"name": "style", "term": {"variable": "style"}}]}}}}}}}}}}},
"annotation": {
"map": [
{
"key": {"variable": "description"},
"value": {"literal": {"string": "Wrap an expression in the given bracket pair using the given block style"}}}]}}}}},
{
"term": {
"name": "hydra.core.serialization.chooseLayout",
"signature": {
"typeParameters": [],
"parameters": [
{"name": "arg0", "type": {"literal": {"integer": "int32"}}, "isLazy": false},
{"name": "arg1", "type": {"variable": "hydra.core.ast.Expr"}, "isLazy": false},
{"name": "arg2", "type": {"variable": "hydra.core.ast.Expr"}, "isLazy": false}],
"result": {"type": {"variable": "hydra.core.ast.Expr"}}},
"body": {
"annotated": {
"body": {
"lambda": {
"parameter": "threshold",
"domain": {"literal": {"integer": "int32"}},
"body": {
"lambda": {
"parameter": "inlineExpr",
"domain": {"variable": "hydra.core.ast.Expr"},
"body": {
"lambda": {
"parameter": "blockExpr",
"domain": {"variable": "hydra.core.ast.Expr"},
"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.gt"}, "type": {"literal": {"integer": "int32"}}}},
"argument": {
"application": {"function": {"variable": "hydra.core.serialization.expressionLength"}, "argument": {"variable": "inlineExpr"}}}}},
"argument": {"variable": "threshold"}}}}},
"argument": {"variable": "blockExpr"}}},
"argument": {"variable": "inlineExpr"}}}}}}}}},
"annotation": {
"map": [
{
"key": {"variable": "description"},
"value": {
"literal": {
"string": "Pick between an inline and a multi-line layout for the same logical expression. Returns the inline form if its estimated width does not exceed the threshold, otherwise the block form. Note: the threshold is measured against the inline expression in isolation; surrounding indentation may push content beyond the threshold at print time. Callers that know they are nested can pass a smaller threshold to compensate."}}}]}}}}},
{
"term": {
"name": "hydra.core.serialization.commaSep",
"signature": {
"typeParameters": [],
"parameters": [
{"name": "arg0", "type": {"variable": "hydra.core.ast.BlockStyle"}, "isLazy": false},
{"name": "arg1", "type": {"list": {"variable": "hydra.core.ast.Expr"}}, "isLazy": false}],
"result": {"type": {"variable": "hydra.core.ast.Expr"}}},
"body": {
"annotated": {
"body": {
"application": {"function": {"variable": "hydra.core.serialization.symbolSep"}, "argument": {"literal": {"string": ","}}}},
"annotation": {
"map": [
{
"key": {"variable": "description"},
"value": {"literal": {"string": "Separate elements with a comma, using the given block style"}}}]}}}}},
{
"term": {
"name": "hydra.core.serialization.commaSepAdaptive",
"signature": {
"typeParameters": [],
"parameters": [{"name": "arg0", "type": {"list": {"variable": "hydra.core.ast.Expr"}}, "isLazy": false}],
"result": {"type": {"variable": "hydra.core.ast.Expr"}}},
"body": {
"annotated": {
"body": {
"lambda": {
"parameter": "els",
"domain": {"list": {"variable": "hydra.core.ast.Expr"}},
"body": {
"application": {
"function": {
"application": {
"function": {
"application": {
"function": {"variable": "hydra.core.serialization.chooseLayout"},
"argument": {"variable": "hydra.core.serialization.maxLineWidth"}}},
"argument": {
"application": {
"function": {
"application": {
"function": {"variable": "hydra.core.serialization.commaSep"},
"argument": {"variable": "hydra.core.serialization.inlineStyle"}}},
"argument": {"variable": "els"}}}}},
"argument": {
"application": {
"function": {
"application": {
"function": {"variable": "hydra.core.serialization.commaSep"},
"argument": {"variable": "hydra.core.serialization.halfBlockStyle"}}},
"argument": {"variable": "els"}}}}}}},
"annotation": {
"map": [
{
"key": {"variable": "description"},
"value": {"literal": {"string": "Comma-separate elements inline if the joined width fits, otherwise break onto separate lines."}}}]}}}}},
{
"term": {
"name": "hydra.core.serialization.cst",
"signature": {
"typeParameters": [],
"parameters": [{"name": "arg0", "type": {"literal": "string"}, "isLazy": false}],
"result": {"type": {"variable": "hydra.core.ast.Expr"}}},
"body": {
"annotated": {
"body": {
"lambda": {
"parameter": "s",
"domain": {"literal": "string"},
"body": {
"inject": {
"typeName": "hydra.core.ast.Expr",
"field": {
"name": "const",
"term": {"application": {"function": {"variable": "hydra.core.serialization.sym"}, "argument": {"variable": "s"}}}}}}}},
"annotation": {
"map": [
{
"key": {"variable": "description"},
"value": {"literal": {"string": "Construct a constant expression from a literal string"}}}]}}}}},
{
"term": {
"name": "hydra.core.serialization.curlyBlock",
"signature": {
"typeParameters": [],
"parameters": [
{"name": "arg0", "type": {"variable": "hydra.core.ast.BlockStyle"}, "isLazy": false},
{"name": "arg1", "type": {"variable": "hydra.core.ast.Expr"}, "isLazy": false}],
"result": {"type": {"variable": "hydra.core.ast.Expr"}}},
"body": {
"annotated": {
"body": {
"lambda": {
"parameter": "style",
"domain": {"variable": "hydra.core.ast.BlockStyle"},
"body": {
"lambda": {
"parameter": "e",
"domain": {"variable": "hydra.core.ast.Expr"},
"body": {
"application": {
"function": {
"application": {
"function": {
"application": {
"function": {"variable": "hydra.core.serialization.curlyBracesList"},
"argument": {"typeApplication": {"body": {"optional": null}, "type": {"literal": "string"}}}}},
"argument": {"variable": "style"}}},
"argument": {"list": [{"variable": "e"}]}}}}}}},
"annotation": {
"map": [
{
"key": {"variable": "description"},
"value": {"literal": {"string": "Wrap a single expression in curly braces using the given block style"}}}]}}}}},
{
"term": {
"name": "hydra.core.serialization.curlyBraces",
"signature": {"typeParameters": [], "parameters": [], "result": {"type": {"variable": "hydra.core.ast.Brackets"}}},
"body": {
"annotated": {
"body": {
"record": {
"typeName": "hydra.core.ast.Brackets",
"fields": [
{"name": "open", "term": {"wrap": {"typeName": "hydra.core.ast.Symbol", "body": {"literal": {"string": "{"}}}}},
{"name": "close", "term": {"wrap": {"typeName": "hydra.core.ast.Symbol", "body": {"literal": {"string": "}"}}}}}]}},
"annotation": {
"map": [
{
"key": {"variable": "description"},
"value": {"literal": {"string": "Curly brace pair `{` `}` for use with `brackets`"}}}]}}}}},
{
"term": {
"name": "hydra.core.serialization.curlyBracesList",
"signature": {
"typeParameters": [],
"parameters": [
{"name": "arg0", "type": {"optional": {"literal": "string"}}, "isLazy": false},
{"name": "arg1", "type": {"variable": "hydra.core.ast.BlockStyle"}, "isLazy": false},
{"name": "arg2", "type": {"list": {"variable": "hydra.core.ast.Expr"}}, "isLazy": false}],
"result": {"type": {"variable": "hydra.core.ast.Expr"}}},
"body": {
"annotated": {
"body": {
"lambda": {
"parameter": "msymb",
"domain": {"optional": {"literal": "string"}},
"body": {
"lambda": {
"parameter": "style",
"domain": {"variable": "hydra.core.ast.BlockStyle"},
"body": {
"lambda": {
"parameter": "els",
"domain": {"list": {"variable": "hydra.core.ast.Expr"}},
"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": "els"}}}}},
"argument": {"application": {"function": {"variable": "hydra.core.serialization.cst"}, "argument": {"literal": {"string": "{}"}}}}}},
"argument": {
"application": {
"function": {
"application": {
"function": {
"application": {
"function": {"variable": "hydra.core.serialization.brackets"},
"argument": {"variable": "hydra.core.serialization.curlyBraces"}}},
"argument": {"variable": "style"}}},
"argument": {
"application": {
"function": {
"application": {
"function": {
"application": {
"function": {"variable": "hydra.core.serialization.symbolSep"},
"argument": {
"application": {
"function": {
"application": {
"function": {"typeApplication": {"body": {"variable": "hydra.core.lib.optionals.withDefault"}, "type": {"literal": "string"}}},
"argument": {"literal": {"string": ","}}}},
"argument": {"variable": "msymb"}}}}},
"argument": {"variable": "style"}}},
"argument": {"variable": "els"}}}}}}}}}}}}},
"annotation": {
"map": [
{
"key": {"variable": "description"},
"value": {
"literal": {
"string": "Separate the elements inside curly braces using the given symbol (default `,`) in the given block style; renders as `{}` when empty"}}}]}}}}},
{
"term": {
"name": "hydra.core.serialization.curlyBracesListWithBlankLines",
"signature": {
"typeParameters": [],
"parameters": [
{"name": "arg0", "type": {"variable": "hydra.core.ast.BlockStyle"}, "isLazy": false},
{"name": "arg1", "type": {"list": {"variable": "hydra.core.ast.Expr"}}, "isLazy": false}],
"result": {"type": {"variable": "hydra.core.ast.Expr"}}},
"body": {
"annotated": {
"body": {
"lambda": {
"parameter": "style",
"domain": {"variable": "hydra.core.ast.BlockStyle"},
"body": {
"lambda": {
"parameter": "els",
"domain": {"list": {"variable": "hydra.core.ast.Expr"}},
"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": "els"}}}}},
"argument": {"application": {"function": {"variable": "hydra.core.serialization.cst"}, "argument": {"literal": {"string": "{}"}}}}}},
"argument": {
"let": {
"bindings": [
{
"name": "commaBlankOp",
"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": "doubleBreak", "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": "entriesExpr",
"term": {
"application": {
"function": {
"application": {
"function": {
"application": {
"function": {
"typeApplication": {
"body": {
"typeApplication": {"body": {"variable": "hydra.core.lib.optionals.match"}, "type": {"variable": "hydra.core.ast.Expr"}}},
"type": {"variable": "hydra.core.ast.Expr"}}},
"argument": {
"application": {
"function": {"typeApplication": {"body": {"variable": "hydra.core.lib.lists.head"}, "type": {"variable": "hydra.core.ast.Expr"}}},
"argument": {"variable": "els"}}}}},
"argument": {"application": {"function": {"variable": "hydra.core.serialization.cst"}, "argument": {"literal": {"string": ""}}}}}},
"argument": {
"lambda": {
"parameter": "h",
"domain": {"variable": "hydra.core.ast.Expr"},
"body": {
"application": {
"function": {
"application": {
"function": {
"application": {
"function": {
"typeApplication": {
"body": {"typeApplication": {"body": {"variable": "hydra.core.lib.lists.foldl"}, "type": {"variable": "hydra.core.ast.Expr"}}},
"type": {"variable": "hydra.core.ast.Expr"}}},
"argument": {
"lambda": {
"parameter": "acc",
"domain": {"variable": "hydra.core.ast.Expr"},
"body": {
"lambda": {
"parameter": "el",
"domain": {"variable": "hydra.core.ast.Expr"},
"body": {
"application": {
"function": {
"application": {
"function": {"application": {"function": {"variable": "hydra.core.serialization.ifx"}, "argument": {"variable": "commaBlankOp"}}},
"argument": {"variable": "acc"}}},
"argument": {"variable": "el"}}}}}}}}},
"argument": {"variable": "h"}}},
"argument": {
"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": "els"}}}}}}}}},
"typeScheme": {"variables": [], "body": {"variable": "hydra.core.ast.Expr"}, "constraints": []}}],
"body": {
"let": {
"bindings": [
{
"name": "entriesStr",
"term": {
"application": {"function": {"variable": "hydra.core.serialization.printExpr"}, "argument": {"variable": "entriesExpr"}}},
"typeScheme": {"variables": [], "body": {"literal": "string"}, "constraints": []}}],
"body": {
"let": {
"bindings": [
{
"name": "doIndent",
"term": {
"application": {
"function": {"project": {"typeName": "hydra.core.ast.BlockStyle", "fieldName": "indent"}},
"argument": {"variable": "style"}}},
"typeScheme": {"variables": [], "body": {"optional": {"literal": "string"}}, "constraints": []}}],
"body": {
"let": {
"bindings": [
{
"name": "indentedStr",
"term": {
"application": {
"function": {
"application": {
"function": {
"application": {
"function": {
"typeApplication": {
"body": {"typeApplication": {"body": {"variable": "hydra.core.lib.optionals.match"}, "type": {"literal": "string"}}},
"type": {"literal": "string"}}},
"argument": {"variable": "doIndent"}}},
"argument": {"variable": "entriesStr"}}},
"argument": {
"lambda": {
"parameter": "pre",
"domain": {"literal": "string"},
"body": {
"application": {
"function": {"application": {"function": {"variable": "hydra.core.serialization.customIndent"}, "argument": {"variable": "pre"}}},
"argument": {"variable": "entriesStr"}}}}}}},
"typeScheme": {"variables": [], "body": {"literal": "string"}, "constraints": []}}],
"body": {
"application": {
"function": {"variable": "hydra.core.serialization.cst"},
"argument": {
"application": {
"function": {"variable": "hydra.core.lib.strings.concat"},
"argument": {"list": [{"literal": {"string": "{\n\n"}}, {"variable": "indentedStr"}, {"literal": {"string": "}"}}]}}}}}}}}}}}}}}}}}}}}},
"annotation": {
"map": [
{
"key": {"variable": "description"},
"value": {
"literal": {
"string": "Separate the elements inside curly braces with a comma and a blank line between them (including before the first entry), for commented record/union fields (#711)"}}}]}}}}},
{
"term": {
"name": "hydra.core.serialization.customIndent",
"signature": {
"typeParameters": [],
"parameters": [
{"name": "arg0", "type": {"literal": "string"}, "isLazy": false},
{"name": "arg1", "type": {"literal": "string"}, "isLazy": false}],
"result": {"type": {"literal": "string"}}},
"body": {
"annotated": {
"body": {
"lambda": {
"parameter": "idt",
"domain": {"literal": "string"},
"body": {
"lambda": {
"parameter": "s",
"domain": {"literal": "string"},
"body": {
"application": {
"function": {"variable": "hydra.core.lib.strings.concat"},
"argument": {
"application": {
"function": {
"application": {
"function": {"typeApplication": {"body": {"variable": "hydra.core.lib.lists.intersperse"}, "type": {"literal": "string"}}},
"argument": {"literal": {"string": "\n"}}}},
"argument": {
"application": {
"function": {
"application": {
"function": {
"typeApplication": {
"body": {"typeApplication": {"body": {"variable": "hydra.core.lib.lists.map"}, "type": {"literal": "string"}}},
"type": {"literal": "string"}}},
"argument": {
"lambda": {
"parameter": "line",
"domain": {"literal": "string"},
"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.equality.equal"}, "type": {"literal": "string"}}},
"argument": {"variable": "line"}}},
"argument": {"literal": {"string": ""}}}}}},
"argument": {"variable": "line"}}},
"argument": {
"application": {
"function": {"application": {"function": {"variable": "hydra.core.lib.strings.concat2"}, "argument": {"variable": "idt"}}},
"argument": {"variable": "line"}}}}}}}}},
"argument": {"application": {"function": {"variable": "hydra.core.formatting.lines"}, "argument": {"variable": "s"}}}}}}}}}}}}},
"annotation": {
"map": [
{
"key": {"variable": "description"},
"value": {
"literal": {
"string": "Indent every non-empty line of `s` by `idt`. Empty lines stay empty (no trailing whitespace) so downstream byte-identity checks don't care about indent depth."}}}]}}}}},
{
"term": {
"name": "hydra.core.serialization.customIndentBlock",
"signature": {
"typeParameters": [],
"parameters": [
{"name": "arg0", "type": {"literal": "string"}, "isLazy": false},
{"name": "arg1", "type": {"list": {"variable": "hydra.core.ast.Expr"}}, "isLazy": false}],
"result": {"type": {"variable": "hydra.core.ast.Expr"}}},
"body": {
"annotated": {
"body": {
"lambda": {
"parameter": "idt",
"domain": {"literal": "string"},
"body": {
"lambda": {
"parameter": "els",
"domain": {"list": {"variable": "hydra.core.ast.Expr"}},
"body": {
"let": {
"bindings": [
{
"name": "idtOp",
"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": "breakAndIndent", "term": {"variable": "idt"}}}}}]}}},
{
"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": {
"typeApplication": {"body": {"variable": "hydra.core.lib.optionals.match"}, "type": {"variable": "hydra.core.ast.Expr"}}},
"type": {"variable": "hydra.core.ast.Expr"}}},
"argument": {
"application": {
"function": {"typeApplication": {"body": {"variable": "hydra.core.lib.lists.head"}, "type": {"variable": "hydra.core.ast.Expr"}}},
"argument": {"variable": "els"}}}}},
"argument": {"application": {"function": {"variable": "hydra.core.serialization.cst"}, "argument": {"literal": {"string": ""}}}}}},
"argument": {
"lambda": {
"parameter": "head",
"domain": {"variable": "hydra.core.ast.Expr"},
"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.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": "els"}}}}},
"argument": {"literal": {"integer": {"int32": 1}}}}}}},
"argument": {"variable": "head"}}},
"argument": {
"application": {
"function": {
"application": {
"function": {"application": {"function": {"variable": "hydra.core.serialization.ifx"}, "argument": {"variable": "idtOp"}}},
"argument": {"variable": "head"}}},
"argument": {
"application": {
"function": {"variable": "hydra.core.serialization.newlineSep"},
"argument": {
"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": "els"}}}}}}}}}}}}}}}}}}},
"annotation": {
"map": [
{
"key": {"variable": "description"},
"value": {
"literal": {
"string": "Render a list of expressions as a block whose first element starts where the surrounding context placed it and subsequent elements break onto fresh lines indented by the given prefix"}}}]}}}}},
{
"term": {
"name": "hydra.core.serialization.dotSep",
"signature": {
"typeParameters": [],
"parameters": [{"name": "arg0", "type": {"list": {"variable": "hydra.core.ast.Expr"}}, "isLazy": false}],
"result": {"type": {"variable": "hydra.core.ast.Expr"}}},
"body": {
"annotated": {
"body": {
"application": {
"function": {"variable": "hydra.core.serialization.sep"},
"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"}}}}]}}}},
"annotation": {
"map": [
{
"key": {"variable": "description"},
"value": {"literal": {"string": "Separate elements with a dot and no surrounding whitespace"}}}]}}}}},
{
"term": {
"name": "hydra.core.serialization.doubleNewlineSep",
"signature": {
"typeParameters": [],
"parameters": [{"name": "arg0", "type": {"list": {"variable": "hydra.core.ast.Expr"}}, "isLazy": false}],
"result": {"type": {"variable": "hydra.core.ast.Expr"}}},
"body": {
"annotated": {
"body": {
"application": {
"function": {"variable": "hydra.core.serialization.sep"},
"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": "break", "term": "unit"}}}},
{"name": "right", "term": {"inject": {"typeName": "hydra.core.ast.Ws", "field": {"name": "break", "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"}}}}]}}}},
"annotation": {
"map": [
{
"key": {"variable": "description"},
"value": {"literal": {"string": "Separate elements with a blank line between them"}}}]}}}}},
{
"term": {
"name": "hydra.core.serialization.doubleSpace",
"signature": {"typeParameters": [], "parameters": [], "result": {"type": {"literal": "string"}}},
"body": {
"annotated": {
"body": {"literal": {"string": " "}},
"annotation": {
"map": [
{
"key": {"variable": "description"},
"value": {"literal": {"string": "The two-space string used as the canonical indent unit"}}}]}}}}},
{
"term": {
"name": "hydra.core.serialization.expressionLength",
"signature": {
"typeParameters": [],
"parameters": [{"name": "arg0", "type": {"variable": "hydra.core.ast.Expr"}, "isLazy": false}],
"result": {"type": {"literal": {"integer": "int32"}}}},
"body": {
"annotated": {
"body": {
"lambda": {
"parameter": "e",
"domain": {"variable": "hydra.core.ast.Expr"},
"body": {
"let": {
"bindings": [
{
"name": "symbolLength",
"term": {
"lambda": {
"parameter": "s",
"domain": {"variable": "hydra.core.ast.Symbol"},
"body": {
"application": {
"function": {"variable": "hydra.core.lib.strings.length"},
"argument": {"application": {"function": {"unwrap": "hydra.core.ast.Symbol"}, "argument": {"variable": "s"}}}}}}},
"typeScheme": {
"variables": [],
"body": {"function": {"domain": {"variable": "hydra.core.ast.Symbol"}, "codomain": {"literal": {"integer": "int32"}}}},
"constraints": []}}],
"body": {
"let": {
"bindings": [
{
"name": "wsLength",
"term": {
"lambda": {
"parameter": "ws",
"domain": {"variable": "hydra.core.ast.Ws"},
"body": {
"application": {
"function": {
"cases": {
"typeName": "hydra.core.ast.Ws",
"cases": [
{
"name": "none",
"handler": {"lambda": {"parameter": "_", "domain": "unit", "body": {"literal": {"integer": {"int32": 0}}}}}},
{
"name": "space",
"handler": {"lambda": {"parameter": "_", "domain": "unit", "body": {"literal": {"integer": {"int32": 1}}}}}},
{
"name": "break",
"handler": {"lambda": {"parameter": "_", "domain": "unit", "body": {"literal": {"integer": {"int32": 10000}}}}}},
{
"name": "breakAndIndent",
"handler": {"lambda": {"parameter": "s", "domain": {"literal": "string"}, "body": {"literal": {"integer": {"int32": 10000}}}}}},
{
"name": "doubleBreak",
"handler": {"lambda": {"parameter": "_", "domain": "unit", "body": {"literal": {"integer": {"int32": 10000}}}}}}]}},
"argument": {"variable": "ws"}}}}},
"typeScheme": {
"variables": [],
"body": {"function": {"domain": {"variable": "hydra.core.ast.Ws"}, "codomain": {"literal": {"integer": "int32"}}}},
"constraints": []}}],
"body": {
"let": {
"bindings": [
{
"name": "blockStyleLength",
"term": {
"lambda": {
"parameter": "style",
"domain": {"variable": "hydra.core.ast.BlockStyle"},
"body": {
"let": {
"bindings": [
{
"name": "mindentLen",
"term": {
"application": {
"function": {
"application": {
"function": {
"application": {
"function": {
"typeApplication": {
"body": {"typeApplication": {"body": {"variable": "hydra.core.lib.optionals.match"}, "type": {"literal": "string"}}},
"type": {"literal": {"integer": "int32"}}}},
"argument": {
"application": {
"function": {"project": {"typeName": "hydra.core.ast.BlockStyle", "fieldName": "indent"}},
"argument": {"variable": "style"}}}}},
"argument": {"literal": {"integer": {"int32": 0}}}}},
"argument": {"variable": "hydra.core.lib.strings.length"}}},
"typeScheme": {"variables": [], "body": {"literal": {"integer": "int32"}}, "constraints": []}}],
"body": {
"let": {
"bindings": [
{
"name": "nlBeforeLen",
"term": {
"application": {
"function": {
"application": {
"function": {
"application": {
"function": {"typeApplication": {"body": {"variable": "hydra.core.lib.logic.ifElse"}, "type": {"literal": {"integer": "int32"}}}},
"argument": {
"application": {
"function": {"project": {"typeName": "hydra.core.ast.BlockStyle", "fieldName": "newlineBeforeContent"}},
"argument": {"variable": "style"}}}}},
"argument": {"literal": {"integer": {"int32": 1}}}}},
"argument": {"literal": {"integer": {"int32": 0}}}}},
"typeScheme": {"variables": [], "body": {"literal": {"integer": "int32"}}, "constraints": []}}],
"body": {
"let": {
"bindings": [
{
"name": "nlAfterLen",
"term": {
"application": {
"function": {
"application": {
"function": {
"application": {
"function": {"typeApplication": {"body": {"variable": "hydra.core.lib.logic.ifElse"}, "type": {"literal": {"integer": "int32"}}}},
"argument": {
"application": {
"function": {"project": {"typeName": "hydra.core.ast.BlockStyle", "fieldName": "newlineAfterContent"}},
"argument": {"variable": "style"}}}}},
"argument": {"literal": {"integer": {"int32": 1}}}}},
"argument": {"literal": {"integer": {"int32": 0}}}}},
"typeScheme": {"variables": [], "body": {"literal": {"integer": "int32"}}, "constraints": []}}],
"body": {
"application": {
"function": {
"application": {
"function": {"typeApplication": {"body": {"variable": "hydra.core.lib.math.add"}, "type": {"literal": {"integer": "int32"}}}},
"argument": {"variable": "mindentLen"}}},
"argument": {
"application": {
"function": {
"application": {
"function": {"typeApplication": {"body": {"variable": "hydra.core.lib.math.add"}, "type": {"literal": {"integer": "int32"}}}},
"argument": {"variable": "nlBeforeLen"}}},
"argument": {"variable": "nlAfterLen"}}}}}}}}}}}}},
"typeScheme": {
"variables": [],
"body": {"function": {"domain": {"variable": "hydra.core.ast.BlockStyle"}, "codomain": {"literal": {"integer": "int32"}}}},
"constraints": []}}],
"body": {
"let": {
"bindings": [
{
"name": "bracketsLength",
"term": {
"lambda": {
"parameter": "brackets",
"domain": {"variable": "hydra.core.ast.Brackets"},
"body": {
"application": {
"function": {
"application": {
"function": {"typeApplication": {"body": {"variable": "hydra.core.lib.math.add"}, "type": {"literal": {"integer": "int32"}}}},
"argument": {
"application": {
"function": {"variable": "symbolLength"},
"argument": {
"application": {
"function": {"project": {"typeName": "hydra.core.ast.Brackets", "fieldName": "open"}},
"argument": {"variable": "brackets"}}}}}}},
"argument": {
"application": {
"function": {"variable": "symbolLength"},
"argument": {
"application": {
"function": {"project": {"typeName": "hydra.core.ast.Brackets", "fieldName": "close"}},
"argument": {"variable": "brackets"}}}}}}}}},
"typeScheme": {
"variables": [],
"body": {"function": {"domain": {"variable": "hydra.core.ast.Brackets"}, "codomain": {"literal": {"integer": "int32"}}}},
"constraints": []}}],
"body": {
"let": {
"bindings": [
{
"name": "bracketExprLength",
"term": {
"lambda": {
"parameter": "be",
"domain": {"variable": "hydra.core.ast.BracketExpr"},
"body": {
"application": {
"function": {
"application": {
"function": {"typeApplication": {"body": {"variable": "hydra.core.lib.math.add"}, "type": {"literal": {"integer": "int32"}}}},
"argument": {
"application": {
"function": {"variable": "bracketsLength"},
"argument": {
"application": {
"function": {"project": {"typeName": "hydra.core.ast.BracketExpr", "fieldName": "brackets"}},
"argument": {"variable": "be"}}}}}}},
"argument": {
"application": {
"function": {
"application": {
"function": {"typeApplication": {"body": {"variable": "hydra.core.lib.math.add"}, "type": {"literal": {"integer": "int32"}}}},
"argument": {
"application": {
"function": {"variable": "hydra.core.serialization.expressionLength"},
"argument": {
"application": {
"function": {"project": {"typeName": "hydra.core.ast.BracketExpr", "fieldName": "enclosed"}},
"argument": {"variable": "be"}}}}}}},
"argument": {
"application": {
"function": {"variable": "blockStyleLength"},
"argument": {
"application": {
"function": {"project": {"typeName": "hydra.core.ast.BracketExpr", "fieldName": "style"}},
"argument": {"variable": "be"}}}}}}}}}}},
"typeScheme": {
"variables": [],
"body": {"function": {"domain": {"variable": "hydra.core.ast.BracketExpr"}, "codomain": {"literal": {"integer": "int32"}}}},
"constraints": []}}],
"body": {
"let": {
"bindings": [
{
"name": "indentedExpressionLength",
"term": {
"lambda": {
"parameter": "ie",
"domain": {"variable": "hydra.core.ast.IndentedExpression"},
"body": {
"let": {
"bindings": [
{
"name": "baseLen",
"term": {
"application": {
"function": {"variable": "hydra.core.serialization.expressionLength"},
"argument": {
"application": {
"function": {"project": {"typeName": "hydra.core.ast.IndentedExpression", "fieldName": "expr"}},
"argument": {"variable": "ie"}}}}},
"typeScheme": {"variables": [], "body": {"literal": {"integer": "int32"}}, "constraints": []}}],
"body": {
"let": {
"bindings": [
{
"name": "indentLen",
"term": {
"application": {
"function": {
"cases": {
"typeName": "hydra.core.ast.IndentStyle",
"cases": [
{
"name": "allLines",
"handler": {
"lambda": {
"parameter": "s",
"domain": {"literal": "string"},
"body": {"application": {"function": {"variable": "hydra.core.lib.strings.length"}, "argument": {"variable": "s"}}}}}},
{
"name": "subsequentLines",
"handler": {
"lambda": {
"parameter": "s",
"domain": {"literal": "string"},
"body": {"application": {"function": {"variable": "hydra.core.lib.strings.length"}, "argument": {"variable": "s"}}}}}}]}},
"argument": {
"application": {
"function": {"project": {"typeName": "hydra.core.ast.IndentedExpression", "fieldName": "style"}},
"argument": {"variable": "ie"}}}}},
"typeScheme": {"variables": [], "body": {"literal": {"integer": "int32"}}, "constraints": []}}],
"body": {
"application": {
"function": {
"application": {
"function": {"typeApplication": {"body": {"variable": "hydra.core.lib.math.add"}, "type": {"literal": {"integer": "int32"}}}},
"argument": {"variable": "baseLen"}}},
"argument": {"variable": "indentLen"}}}}}}}}},
"typeScheme": {
"variables": [],
"body": {
"function": {"domain": {"variable": "hydra.core.ast.IndentedExpression"}, "codomain": {"literal": {"integer": "int32"}}}},
"constraints": []}}],
"body": {
"let": {
"bindings": [
{
"name": "opLength",
"term": {
"lambda": {
"parameter": "op",
"domain": {"variable": "hydra.core.ast.Op"},
"body": {
"let": {
"bindings": [
{
"name": "symLen",
"term": {
"application": {
"function": {"variable": "symbolLength"},
"argument": {
"application": {"function": {"project": {"typeName": "hydra.core.ast.Op", "fieldName": "symbol"}}, "argument": {"variable": "op"}}}}},
"typeScheme": {"variables": [], "body": {"literal": {"integer": "int32"}}, "constraints": []}}],
"body": {
"let": {
"bindings": [
{
"name": "padding",
"term": {
"application": {"function": {"project": {"typeName": "hydra.core.ast.Op", "fieldName": "padding"}}, "argument": {"variable": "op"}}},
"typeScheme": {"variables": [], "body": {"variable": "hydra.core.ast.Padding"}, "constraints": []}}],
"body": {
"let": {
"bindings": [
{
"name": "leftLen",
"term": {
"application": {
"function": {"variable": "wsLength"},
"argument": {
"application": {
"function": {"project": {"typeName": "hydra.core.ast.Padding", "fieldName": "left"}},
"argument": {"variable": "padding"}}}}},
"typeScheme": {"variables": [], "body": {"literal": {"integer": "int32"}}, "constraints": []}}],
"body": {
"let": {
"bindings": [
{
"name": "rightLen",
"term": {
"application": {
"function": {"variable": "wsLength"},
"argument": {
"application": {
"function": {"project": {"typeName": "hydra.core.ast.Padding", "fieldName": "right"}},
"argument": {"variable": "padding"}}}}},
"typeScheme": {"variables": [], "body": {"literal": {"integer": "int32"}}, "constraints": []}}],
"body": {
"application": {
"function": {
"application": {
"function": {"typeApplication": {"body": {"variable": "hydra.core.lib.math.add"}, "type": {"literal": {"integer": "int32"}}}},
"argument": {"variable": "symLen"}}},
"argument": {
"application": {
"function": {
"application": {
"function": {"typeApplication": {"body": {"variable": "hydra.core.lib.math.add"}, "type": {"literal": {"integer": "int32"}}}},
"argument": {"variable": "leftLen"}}},
"argument": {"variable": "rightLen"}}}}}}}}}}}}}}},
"typeScheme": {
"variables": [],
"body": {"function": {"domain": {"variable": "hydra.core.ast.Op"}, "codomain": {"literal": {"integer": "int32"}}}},
"constraints": []}}],
"body": {
"let": {
"bindings": [
{
"name": "opExprLength",
"term": {
"lambda": {
"parameter": "oe",
"domain": {"variable": "hydra.core.ast.OpExpr"},
"body": {
"let": {
"bindings": [
{
"name": "opLen",
"term": {
"application": {
"function": {"variable": "opLength"},
"argument": {
"application": {"function": {"project": {"typeName": "hydra.core.ast.OpExpr", "fieldName": "op"}}, "argument": {"variable": "oe"}}}}},
"typeScheme": {"variables": [], "body": {"literal": {"integer": "int32"}}, "constraints": []}}],
"body": {
"let": {
"bindings": [
{
"name": "leftLen",
"term": {
"application": {
"function": {"variable": "hydra.core.serialization.expressionLength"},
"argument": {
"application": {"function": {"project": {"typeName": "hydra.core.ast.OpExpr", "fieldName": "lhs"}}, "argument": {"variable": "oe"}}}}},
"typeScheme": {"variables": [], "body": {"literal": {"integer": "int32"}}, "constraints": []}}],
"body": {
"let": {
"bindings": [
{
"name": "rightLen",
"term": {
"application": {
"function": {"variable": "hydra.core.serialization.expressionLength"},
"argument": {
"application": {"function": {"project": {"typeName": "hydra.core.ast.OpExpr", "fieldName": "rhs"}}, "argument": {"variable": "oe"}}}}},
"typeScheme": {"variables": [], "body": {"literal": {"integer": "int32"}}, "constraints": []}}],
"body": {
"application": {
"function": {
"application": {
"function": {"typeApplication": {"body": {"variable": "hydra.core.lib.math.add"}, "type": {"literal": {"integer": "int32"}}}},
"argument": {"variable": "opLen"}}},
"argument": {
"application": {
"function": {
"application": {
"function": {"typeApplication": {"body": {"variable": "hydra.core.lib.math.add"}, "type": {"literal": {"integer": "int32"}}}},
"argument": {"variable": "leftLen"}}},
"argument": {"variable": "rightLen"}}}}}}}}}}}}},
"typeScheme": {
"variables": [],
"body": {"function": {"domain": {"variable": "hydra.core.ast.OpExpr"}, "codomain": {"literal": {"integer": "int32"}}}},
"constraints": []}}],
"body": {
"let": {
"bindings": [
{
"name": "seqExprLength",
"term": {
"lambda": {
"parameter": "se",
"domain": {"variable": "hydra.core.ast.SeqExpr"},
"body": {
"let": {
"bindings": [
{
"name": "sopLen",
"term": {
"application": {
"function": {"variable": "opLength"},
"argument": {
"application": {"function": {"project": {"typeName": "hydra.core.ast.SeqExpr", "fieldName": "op"}}, "argument": {"variable": "se"}}}}},
"typeScheme": {"variables": [], "body": {"literal": {"integer": "int32"}}, "constraints": []}}],
"body": {
"let": {
"bindings": [
{
"name": "elementLens",
"term": {
"application": {
"function": {
"application": {
"function": {
"typeApplication": {
"body": {"typeApplication": {"body": {"variable": "hydra.core.lib.lists.map"}, "type": {"variable": "hydra.core.ast.Expr"}}},
"type": {"literal": {"integer": "int32"}}}},
"argument": {"variable": "hydra.core.serialization.expressionLength"}}},
"argument": {
"application": {
"function": {"project": {"typeName": "hydra.core.ast.SeqExpr", "fieldName": "elements"}},
"argument": {"variable": "se"}}}}},
"typeScheme": {"variables": [], "body": {"list": {"literal": {"integer": "int32"}}}, "constraints": []}}],
"body": {
"let": {
"bindings": [
{
"name": "totalElLen",
"term": {
"application": {
"function": {
"application": {
"function": {
"application": {
"function": {
"typeApplication": {
"body": {"typeApplication": {"body": {"variable": "hydra.core.lib.lists.foldl"}, "type": {"literal": {"integer": "int32"}}}},
"type": {"literal": {"integer": "int32"}}}},
"argument": {"typeApplication": {"body": {"variable": "hydra.core.lib.math.add"}, "type": {"literal": {"integer": "int32"}}}}}},
"argument": {"literal": {"integer": {"int32": 0}}}}},
"argument": {"variable": "elementLens"}}},
"typeScheme": {"variables": [], "body": {"literal": {"integer": "int32"}}, "constraints": []}}],
"body": {
"let": {
"bindings": [
{
"name": "numSeps",
"term": {
"application": {
"function": {
"application": {
"function": {"typeApplication": {"body": {"variable": "hydra.core.lib.math.sub"}, "type": {"literal": {"integer": "int32"}}}},
"argument": {
"application": {
"function": {"typeApplication": {"body": {"variable": "hydra.core.lib.lists.length"}, "type": {"variable": "hydra.core.ast.Expr"}}},
"argument": {
"application": {
"function": {"project": {"typeName": "hydra.core.ast.SeqExpr", "fieldName": "elements"}},
"argument": {"variable": "se"}}}}}}},
"argument": {"literal": {"integer": {"int32": 1}}}}},
"typeScheme": {"variables": [], "body": {"literal": {"integer": "int32"}}, "constraints": []}}],
"body": {
"application": {
"function": {
"application": {
"function": {"typeApplication": {"body": {"variable": "hydra.core.lib.math.add"}, "type": {"literal": {"integer": "int32"}}}},
"argument": {"variable": "totalElLen"}}},
"argument": {
"application": {
"function": {
"application": {
"function": {"typeApplication": {"body": {"variable": "hydra.core.lib.math.mul"}, "type": {"literal": {"integer": "int32"}}}},
"argument": {"variable": "sopLen"}}},
"argument": {
"application": {
"function": {
"application": {
"function": {
"application": {
"function": {"typeApplication": {"body": {"variable": "hydra.core.lib.logic.ifElse"}, "type": {"literal": {"integer": "int32"}}}},
"argument": {
"application": {
"function": {
"application": {
"function": {"typeApplication": {"body": {"variable": "hydra.core.lib.ordering.gt"}, "type": {"literal": {"integer": "int32"}}}},
"argument": {"variable": "numSeps"}}},
"argument": {"literal": {"integer": {"int32": 0}}}}}}},
"argument": {"variable": "numSeps"}}},
"argument": {"literal": {"integer": {"int32": 0}}}}}}}}}}}}}}}}}}},
"typeScheme": {
"variables": [],
"body": {"function": {"domain": {"variable": "hydra.core.ast.SeqExpr"}, "codomain": {"literal": {"integer": "int32"}}}},
"constraints": []}}],
"body": {
"application": {
"function": {
"cases": {
"typeName": "hydra.core.ast.Expr",
"cases": [
{
"name": "const",
"handler": {
"lambda": {
"parameter": "s",
"domain": {"variable": "hydra.core.ast.Symbol"},
"body": {"application": {"function": {"variable": "symbolLength"}, "argument": {"variable": "s"}}}}}},
{
"name": "indent",
"handler": {
"lambda": {
"parameter": "ie",
"domain": {"variable": "hydra.core.ast.IndentedExpression"},
"body": {"application": {"function": {"variable": "indentedExpressionLength"}, "argument": {"variable": "ie"}}}}}},
{
"name": "op",
"handler": {
"lambda": {
"parameter": "oe",
"domain": {"variable": "hydra.core.ast.OpExpr"},
"body": {"application": {"function": {"variable": "opExprLength"}, "argument": {"variable": "oe"}}}}}},
{
"name": "brackets",
"handler": {
"lambda": {
"parameter": "be",
"domain": {"variable": "hydra.core.ast.BracketExpr"},
"body": {"application": {"function": {"variable": "bracketExprLength"}, "argument": {"variable": "be"}}}}}},
{
"name": "seq",
"handler": {
"lambda": {
"parameter": "se",
"domain": {"variable": "hydra.core.ast.SeqExpr"},
"body": {"application": {"function": {"variable": "seqExprLength"}, "argument": {"variable": "se"}}}}}}]}},
"argument": {"variable": "e"}}}}}}}}}}}}}}}}}}}}}}},
"annotation": {
"map": [
{
"key": {"variable": "description"},
"value": {
"literal": {
"string": "Find the approximate length (number of characters, including spaces and newlines) of an expression without actually printing it."}}}]}}}}},
{
"term": {
"name": "hydra.core.serialization.fullBlockStyle",
"signature": {"typeParameters": [], "parameters": [], "result": {"type": {"variable": "hydra.core.ast.BlockStyle"}}},
"body": {
"annotated": {
"body": {
"record": {
"typeName": "hydra.core.ast.BlockStyle",
"fields": [
{"name": "indent", "term": {"optional": {"variable": "hydra.core.serialization.doubleSpace"}}},
{"name": "newlineBeforeContent", "term": {"literal": {"boolean": true}}},
{"name": "newlineAfterContent", "term": {"literal": {"boolean": true}}}]}},
"annotation": {
"map": [
{
"key": {"variable": "description"},
"value": {"literal": {"string": "Block style with double-space indent and newlines both before and after the bracketed content"}}}]}}}}},
{
"term": {
"name": "hydra.core.serialization.halfBlockStyle",
"signature": {"typeParameters": [], "parameters": [], "result": {"type": {"variable": "hydra.core.ast.BlockStyle"}}},
"body": {
"annotated": {
"body": {
"record": {
"typeName": "hydra.core.ast.BlockStyle",
"fields": [
{"name": "indent", "term": {"optional": {"variable": "hydra.core.serialization.doubleSpace"}}},
{"name": "newlineBeforeContent", "term": {"literal": {"boolean": true}}},
{"name": "newlineAfterContent", "term": {"literal": {"boolean": false}}}]}},
"annotation": {
"map": [
{
"key": {"variable": "description"},
"value": {"literal": {"string": "Block style with double-space indent, a newline before the content but not after"}}}]}}}}},
{
"term": {
"name": "hydra.core.serialization.ifx",
"signature": {
"typeParameters": [],
"parameters": [
{"name": "arg0", "type": {"variable": "hydra.core.ast.Op"}, "isLazy": false},
{"name": "arg1", "type": {"variable": "hydra.core.ast.Expr"}, "isLazy": false},
{"name": "arg2", "type": {"variable": "hydra.core.ast.Expr"}, "isLazy": false}],
"result": {"type": {"variable": "hydra.core.ast.Expr"}}},
"body": {
"annotated": {
"body": {
"lambda": {
"parameter": "op",
"domain": {"variable": "hydra.core.ast.Op"},
"body": {
"lambda": {
"parameter": "lhs",
"domain": {"variable": "hydra.core.ast.Expr"},
"body": {
"lambda": {
"parameter": "rhs",
"domain": {"variable": "hydra.core.ast.Expr"},
"body": {
"inject": {
"typeName": "hydra.core.ast.Expr",
"field": {
"name": "op",
"term": {
"record": {
"typeName": "hydra.core.ast.OpExpr",
"fields": [
{"name": "op", "term": {"variable": "op"}},
{"name": "lhs", "term": {"variable": "lhs"}},
{"name": "rhs", "term": {"variable": "rhs"}}]}}}}}}}}}}},
"annotation": {
"map": [
{
"key": {"variable": "description"},
"value": {"literal": {"string": "Build an infix expression with the given operator and two operands"}}}]}}}}},
{
"term": {
"name": "hydra.core.serialization.indent",
"signature": {
"typeParameters": [],
"parameters": [{"name": "arg0", "type": {"literal": "string"}, "isLazy": false}],
"result": {"type": {"literal": "string"}}},
"body": {
"annotated": {
"body": {
"application": {
"function": {"variable": "hydra.core.serialization.customIndent"},
"argument": {"variable": "hydra.core.serialization.doubleSpace"}}},
"annotation": {
"map": [
{
"key": {"variable": "description"},
"value": {"literal": {"string": "Indent every non-empty line of a string by `doubleSpace`"}}}]}}}}},
{
"term": {
"name": "hydra.core.serialization.indentBlock",
"signature": {
"typeParameters": [],
"parameters": [{"name": "arg0", "type": {"list": {"variable": "hydra.core.ast.Expr"}}, "isLazy": false}],
"result": {"type": {"variable": "hydra.core.ast.Expr"}}},
"body": {
"annotated": {
"body": {
"application": {
"function": {"variable": "hydra.core.serialization.customIndentBlock"},
"argument": {"variable": "hydra.core.serialization.doubleSpace"}}},
"annotation": {
"map": [
{
"key": {"variable": "description"},
"value": {"literal": {"string": "Like `customIndentBlock`, but using `doubleSpace` as the indent prefix"}}}]}}}}},
{
"term": {
"name": "hydra.core.serialization.indentSubsequentLines",
"signature": {
"typeParameters": [],
"parameters": [
{"name": "arg0", "type": {"literal": "string"}, "isLazy": false},
{"name": "arg1", "type": {"variable": "hydra.core.ast.Expr"}, "isLazy": false}],
"result": {"type": {"variable": "hydra.core.ast.Expr"}}},
"body": {
"annotated": {
"body": {
"lambda": {
"parameter": "idt",
"domain": {"literal": "string"},
"body": {
"lambda": {
"parameter": "e",
"domain": {"variable": "hydra.core.ast.Expr"},
"body": {
"inject": {
"typeName": "hydra.core.ast.Expr",
"field": {
"name": "indent",
"term": {
"record": {
"typeName": "hydra.core.ast.IndentedExpression",
"fields": [
{
"name": "style",
"term": {
"inject": {"typeName": "hydra.core.ast.IndentStyle", "field": {"name": "subsequentLines", "term": {"variable": "idt"}}}}},
{"name": "expr", "term": {"variable": "e"}}]}}}}}}}}},
"annotation": {
"map": [
{
"key": {"variable": "description"},
"value": {"literal": {"string": "Indent every line of an expression except the first by the given prefix"}}}]}}}}},
{
"term": {
"name": "hydra.core.serialization.infixWs",
"signature": {
"typeParameters": [],
"parameters": [
{"name": "arg0", "type": {"literal": "string"}, "isLazy": false},
{"name": "arg1", "type": {"variable": "hydra.core.ast.Expr"}, "isLazy": false},
{"name": "arg2", "type": {"variable": "hydra.core.ast.Expr"}, "isLazy": false}],
"result": {"type": {"variable": "hydra.core.ast.Expr"}}},
"body": {
"annotated": {
"body": {
"lambda": {
"parameter": "op",
"domain": {"literal": "string"},
"body": {
"lambda": {
"parameter": "l",
"domain": {"variable": "hydra.core.ast.Expr"},
"body": {
"lambda": {
"parameter": "r",
"domain": {"variable": "hydra.core.ast.Expr"},
"body": {
"application": {
"function": {"variable": "hydra.core.serialization.spaceSep"},
"argument": {
"list": [
{"variable": "l"},
{"application": {"function": {"variable": "hydra.core.serialization.cst"}, "argument": {"variable": "op"}}},
{"variable": "r"}]}}}}}}}}},
"annotation": {
"map": [
{
"key": {"variable": "description"},
"value": {"literal": {"string": "Space-separate three elements: left operand, operator string, right operand"}}}]}}}}},
{
"term": {
"name": "hydra.core.serialization.infixWsList",
"signature": {
"typeParameters": [],
"parameters": [
{"name": "arg0", "type": {"literal": "string"}, "isLazy": false},
{"name": "arg1", "type": {"list": {"variable": "hydra.core.ast.Expr"}}, "isLazy": false}],
"result": {"type": {"variable": "hydra.core.ast.Expr"}}},
"body": {
"annotated": {
"body": {
"lambda": {
"parameter": "op",
"domain": {"literal": "string"},
"body": {
"lambda": {
"parameter": "opers",
"domain": {"list": {"variable": "hydra.core.ast.Expr"}},
"body": {
"let": {
"bindings": [
{
"name": "opExpr",
"term": {"application": {"function": {"variable": "hydra.core.serialization.cst"}, "argument": {"variable": "op"}}},
"typeScheme": {"variables": [], "body": {"variable": "hydra.core.ast.Expr"}, "constraints": []}}],
"body": {
"let": {
"bindings": [
{
"name": "foldFun",
"term": {
"lambda": {
"parameter": "e",
"domain": {"list": {"variable": "hydra.core.ast.Expr"}},
"body": {
"lambda": {
"parameter": "r",
"domain": {"variable": "hydra.core.ast.Expr"},
"body": {
"application": {
"function": {
"application": {
"function": {
"application": {
"function": {
"typeApplication": {"body": {"variable": "hydra.core.lib.logic.ifElse"}, "type": {"list": {"variable": "hydra.core.ast.Expr"}}}},
"argument": {
"application": {
"function": {"typeApplication": {"body": {"variable": "hydra.core.lib.lists.isEmpty"}, "type": {"variable": "hydra.core.ast.Expr"}}},
"argument": {"variable": "e"}}}}},
"argument": {"list": [{"variable": "r"}]}}},
"argument": {
"application": {
"function": {
"application": {
"function": {"typeApplication": {"body": {"variable": "hydra.core.lib.lists.cons"}, "type": {"variable": "hydra.core.ast.Expr"}}},
"argument": {"variable": "r"}}},
"argument": {
"application": {
"function": {
"application": {
"function": {"typeApplication": {"body": {"variable": "hydra.core.lib.lists.cons"}, "type": {"variable": "hydra.core.ast.Expr"}}},
"argument": {"variable": "opExpr"}}},
"argument": {"variable": "e"}}}}}}}}}}},
"typeScheme": {
"variables": [],
"body": {
"function": {
"domain": {"list": {"variable": "hydra.core.ast.Expr"}},
"codomain": {"function": {"domain": {"variable": "hydra.core.ast.Expr"}, "codomain": {"list": {"variable": "hydra.core.ast.Expr"}}}}}},
"constraints": []}}],
"body": {
"application": {
"function": {"variable": "hydra.core.serialization.spaceSep"},
"argument": {
"application": {
"function": {
"application": {
"function": {
"application": {
"function": {
"typeApplication": {
"body": {
"typeApplication": {"body": {"variable": "hydra.core.lib.lists.foldl"}, "type": {"list": {"variable": "hydra.core.ast.Expr"}}}},
"type": {"variable": "hydra.core.ast.Expr"}}},
"argument": {"variable": "foldFun"}}},
"argument": {"typeApplication": {"body": {"list": []}, "type": {"variable": "hydra.core.ast.Expr"}}}}},
"argument": {
"application": {
"function": {"typeApplication": {"body": {"variable": "hydra.core.lib.lists.reverse"}, "type": {"variable": "hydra.core.ast.Expr"}}},
"argument": {"variable": "opers"}}}}}}}}}}}}}}},
"annotation": {
"map": [
{
"key": {"variable": "description"},
"value": {"literal": {"string": "Space-separate operands interleaved with the given operator string"}}}]}}}}},
{
"term": {
"name": "hydra.core.serialization.inlineStyle",
"signature": {"typeParameters": [], "parameters": [], "result": {"type": {"variable": "hydra.core.ast.BlockStyle"}}},
"body": {
"annotated": {
"body": {
"record": {
"typeName": "hydra.core.ast.BlockStyle",
"fields": [
{"name": "indent", "term": {"typeApplication": {"body": {"optional": null}, "type": {"literal": "string"}}}},
{"name": "newlineBeforeContent", "term": {"literal": {"boolean": false}}},
{"name": "newlineAfterContent", "term": {"literal": {"boolean": false}}}]}},
"annotation": {
"map": [
{
"key": {"variable": "description"},
"value": {"literal": {"string": "Block style with no indent and no surrounding newlines: contents stay on a single line"}}}]}}}}},
{
"term": {
"name": "hydra.core.serialization.maxLineWidth",
"signature": {"typeParameters": [], "parameters": [], "result": {"type": {"literal": {"integer": "int32"}}}},
"body": {
"annotated": {
"body": {"literal": {"integer": {"int32": 120}}},
"annotation": {
"map": [
{
"key": {"variable": "description"},
"value": {
"literal": {
"string": "The canonical maximum line width used by Hydra writers. Adaptive helpers compare estimated expression widths against this threshold to decide whether to render inline or break across lines. Set to 120 to match the project-wide line-length convention."}}}]}}}}},
{
"term": {
"name": "hydra.core.serialization.newlineSep",
"signature": {
"typeParameters": [],
"parameters": [{"name": "arg0", "type": {"list": {"variable": "hydra.core.ast.Expr"}}, "isLazy": false}],
"result": {"type": {"variable": "hydra.core.ast.Expr"}}},
"body": {
"annotated": {
"body": {
"application": {
"function": {"variable": "hydra.core.serialization.sep"},
"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": "break", "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"}}}}]}}}},
"annotation": {
"map": [
{
"key": {"variable": "description"},
"value": {"literal": {"string": "Separate elements by a newline (no leading whitespace)"}}}]}}}}},
{
"term": {
"name": "hydra.core.serialization.noPadding",
"signature": {"typeParameters": [], "parameters": [], "result": {"type": {"variable": "hydra.core.ast.Padding"}}},
"body": {
"annotated": {
"body": {
"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"}}}}]}},
"annotation": {
"map": [
{
"key": {"variable": "description"},
"value": {"literal": {"string": "Operator padding with no whitespace on either side"}}}]}}}}},
{
"term": {
"name": "hydra.core.serialization.noSep",
"signature": {
"typeParameters": [],
"parameters": [{"name": "arg0", "type": {"list": {"variable": "hydra.core.ast.Expr"}}, "isLazy": false}],
"result": {"type": {"variable": "hydra.core.ast.Expr"}}},
"body": {
"annotated": {
"body": {
"application": {
"function": {"variable": "hydra.core.serialization.sep"},
"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"}}}}]}}}},
"annotation": {
"map": [
{
"key": {"variable": "description"},
"value": {"literal": {"string": "Concatenate elements with no separator and no whitespace"}}}]}}}}},
{
"term": {
"name": "hydra.core.serialization.num",
"signature": {
"typeParameters": [],
"parameters": [{"name": "arg0", "type": {"literal": {"integer": "int32"}}, "isLazy": false}],
"result": {"type": {"variable": "hydra.core.ast.Expr"}}},
"body": {
"annotated": {
"body": {
"lambda": {
"parameter": "i",
"domain": {"literal": {"integer": "int32"}},
"body": {
"application": {
"function": {"variable": "hydra.core.serialization.cst"},
"argument": {"application": {"function": {"variable": "hydra.core.lib.literals.printInt32"}, "argument": {"variable": "i"}}}}}}},
"annotation": {
"map": [
{"key": {"variable": "description"}, "value": {"literal": {"string": "Construct a constant expression from an int32"}}}]}}}}},
{
"term": {
"name": "hydra.core.serialization.op",
"signature": {
"typeParameters": [],
"parameters": [
{"name": "arg0", "type": {"literal": "string"}, "isLazy": false},
{"name": "arg1", "type": {"literal": {"integer": "int32"}}, "isLazy": false},
{"name": "arg2", "type": {"variable": "hydra.core.ast.Associativity"}, "isLazy": false}],
"result": {"type": {"variable": "hydra.core.ast.Op"}}},
"body": {
"annotated": {
"body": {
"lambda": {
"parameter": "s",
"domain": {"literal": "string"},
"body": {
"lambda": {
"parameter": "p",
"domain": {"literal": {"integer": "int32"}},
"body": {
"lambda": {
"parameter": "assoc",
"domain": {"variable": "hydra.core.ast.Associativity"},
"body": {
"record": {
"typeName": "hydra.core.ast.Op",
"fields": [
{
"name": "symbol",
"term": {"application": {"function": {"variable": "hydra.core.serialization.sym"}, "argument": {"variable": "s"}}}},
{
"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": {"variable": "p"}}}},
{"name": "associativity", "term": {"variable": "assoc"}}]}}}}}}}},
"annotation": {
"map": [
{
"key": {"variable": "description"},
"value": {"literal": {"string": "Build an op with single-space padding from a symbol, precedence, and associativity"}}}]}}}}},
{
"term": {
"name": "hydra.core.serialization.orOp",
"signature": {
"typeParameters": [],
"parameters": [{"name": "arg0", "type": {"literal": "boolean"}, "isLazy": false}],
"result": {"type": {"variable": "hydra.core.ast.Op"}}},
"body": {
"annotated": {
"body": {
"lambda": {
"parameter": "newlines",
"domain": {"literal": "boolean"},
"body": {
"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": {
"application": {
"function": {
"application": {
"function": {
"application": {
"function": {"typeApplication": {"body": {"variable": "hydra.core.lib.logic.ifElse"}, "type": {"variable": "hydra.core.ast.Ws"}}},
"argument": {"variable": "newlines"}}},
"argument": {"inject": {"typeName": "hydra.core.ast.Ws", "field": {"name": "break", "term": "unit"}}}}},
"argument": {"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"}}}}]}}}},
"annotation": {
"map": [
{
"key": {"variable": "description"},
"value": {
"literal": {
"string": "Build the `|` alternative-separator operator. The flag selects whether the right side breaks onto a new line."}}}]}}}}},
{
"term": {
"name": "hydra.core.serialization.orSep",
"signature": {
"typeParameters": [],
"parameters": [
{"name": "arg0", "type": {"variable": "hydra.core.ast.BlockStyle"}, "isLazy": false},
{"name": "arg1", "type": {"list": {"variable": "hydra.core.ast.Expr"}}, "isLazy": false}],
"result": {"type": {"variable": "hydra.core.ast.Expr"}}},
"body": {
"annotated": {
"body": {
"lambda": {
"parameter": "style",
"domain": {"variable": "hydra.core.ast.BlockStyle"},
"body": {
"lambda": {
"parameter": "l",
"domain": {"list": {"variable": "hydra.core.ast.Expr"}},
"body": {
"let": {
"bindings": [
{
"name": "newlines",
"term": {
"application": {
"function": {"project": {"typeName": "hydra.core.ast.BlockStyle", "fieldName": "newlineBeforeContent"}},
"argument": {"variable": "style"}}},
"typeScheme": {"variables": [], "body": {"literal": "boolean"}, "constraints": []}}],
"body": {
"application": {
"function": {
"application": {
"function": {
"application": {
"function": {
"typeApplication": {
"body": {
"typeApplication": {"body": {"variable": "hydra.core.lib.optionals.match"}, "type": {"variable": "hydra.core.ast.Expr"}}},
"type": {"variable": "hydra.core.ast.Expr"}}},
"argument": {
"application": {
"function": {"typeApplication": {"body": {"variable": "hydra.core.lib.lists.head"}, "type": {"variable": "hydra.core.ast.Expr"}}},
"argument": {"variable": "l"}}}}},
"argument": {"application": {"function": {"variable": "hydra.core.serialization.cst"}, "argument": {"literal": {"string": ""}}}}}},
"argument": {
"lambda": {
"parameter": "h",
"domain": {"variable": "hydra.core.ast.Expr"},
"body": {
"application": {
"function": {
"application": {
"function": {
"application": {
"function": {
"typeApplication": {
"body": {"typeApplication": {"body": {"variable": "hydra.core.lib.lists.foldl"}, "type": {"variable": "hydra.core.ast.Expr"}}},
"type": {"variable": "hydra.core.ast.Expr"}}},
"argument": {
"lambda": {
"parameter": "acc",
"domain": {"variable": "hydra.core.ast.Expr"},
"body": {
"lambda": {
"parameter": "el",
"domain": {"variable": "hydra.core.ast.Expr"},
"body": {
"application": {
"function": {
"application": {
"function": {
"application": {
"function": {"variable": "hydra.core.serialization.ifx"},
"argument": {"application": {"function": {"variable": "hydra.core.serialization.orOp"}, "argument": {"variable": "newlines"}}}}},
"argument": {"variable": "acc"}}},
"argument": {"variable": "el"}}}}}}}}},
"argument": {"variable": "h"}}},
"argument": {
"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": "l"}}}}}}}}}}}}}}},
"annotation": {
"map": [
{
"key": {"variable": "description"},
"value": {
"literal": {
"string": "Separate alternatives with `|`, breaking onto separate lines when the block style requests a newline before content"}}}]}}}}},
{
"term": {
"name": "hydra.core.serialization.parenList",
"signature": {
"typeParameters": [],
"parameters": [
{"name": "arg0", "type": {"literal": "boolean"}, "isLazy": false},
{"name": "arg1", "type": {"list": {"variable": "hydra.core.ast.Expr"}}, "isLazy": false}],
"result": {"type": {"variable": "hydra.core.ast.Expr"}}},
"body": {
"annotated": {
"body": {
"lambda": {
"parameter": "newlines",
"domain": {"literal": "boolean"},
"body": {
"lambda": {
"parameter": "els",
"domain": {"list": {"variable": "hydra.core.ast.Expr"}},
"body": {
"let": {
"bindings": [
{
"name": "style",
"term": {
"application": {
"function": {
"application": {
"function": {
"application": {
"function": {
"typeApplication": {"body": {"variable": "hydra.core.lib.logic.ifElse"}, "type": {"variable": "hydra.core.ast.BlockStyle"}}},
"argument": {
"application": {
"function": {"application": {"function": {"variable": "hydra.core.lib.logic.and"}, "argument": {"variable": "newlines"}}},
"argument": {
"application": {
"function": {
"application": {
"function": {"typeApplication": {"body": {"variable": "hydra.core.lib.ordering.gt"}, "type": {"literal": {"integer": "int32"}}}},
"argument": {
"application": {
"function": {"typeApplication": {"body": {"variable": "hydra.core.lib.lists.length"}, "type": {"variable": "hydra.core.ast.Expr"}}},
"argument": {"variable": "els"}}}}},
"argument": {"literal": {"integer": {"int32": 1}}}}}}}}},
"argument": {"variable": "hydra.core.serialization.halfBlockStyle"}}},
"argument": {"variable": "hydra.core.serialization.inlineStyle"}}},
"typeScheme": {"variables": [], "body": {"variable": "hydra.core.ast.BlockStyle"}, "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": "els"}}}}},
"argument": {"application": {"function": {"variable": "hydra.core.serialization.cst"}, "argument": {"literal": {"string": "()"}}}}}},
"argument": {
"application": {
"function": {
"application": {
"function": {
"application": {
"function": {"variable": "hydra.core.serialization.brackets"},
"argument": {"variable": "hydra.core.serialization.parentheses"}}},
"argument": {"variable": "style"}}},
"argument": {
"application": {
"function": {"application": {"function": {"variable": "hydra.core.serialization.commaSep"}, "argument": {"variable": "style"}}},
"argument": {"variable": "els"}}}}}}}}}}}}},
"annotation": {
"map": [
{
"key": {"variable": "description"},
"value": {
"literal": {
"string": "Comma-separate the elements inside parentheses; switches to a half-block style when newlines are requested and there is more than one element. Renders as `()` when empty."}}}]}}}}},
{
"term": {
"name": "hydra.core.serialization.parenListAdaptive",
"signature": {
"typeParameters": [],
"parameters": [{"name": "arg0", "type": {"list": {"variable": "hydra.core.ast.Expr"}}, "isLazy": false}],
"result": {"type": {"variable": "hydra.core.ast.Expr"}}},
"body": {
"annotated": {
"body": {
"lambda": {
"parameter": "els",
"domain": {"list": {"variable": "hydra.core.ast.Expr"}},
"body": {
"application": {
"function": {
"application": {
"function": {
"application": {
"function": {"variable": "hydra.core.serialization.chooseLayout"},
"argument": {"variable": "hydra.core.serialization.maxLineWidth"}}},
"argument": {
"application": {
"function": {
"application": {"function": {"variable": "hydra.core.serialization.parenList"}, "argument": {"literal": {"boolean": false}}}},
"argument": {"variable": "els"}}}}},
"argument": {
"application": {
"function": {
"application": {"function": {"variable": "hydra.core.serialization.parenList"}, "argument": {"literal": {"boolean": true}}}},
"argument": {"variable": "els"}}}}}}},
"annotation": {
"map": [
{
"key": {"variable": "description"},
"value": {
"literal": {
"string": "Produce a parenthesized list which separates elements by spaces or newlines depending on the estimated width of the expression."}}}]}}}}},
{
"term": {
"name": "hydra.core.serialization.parens",
"signature": {
"typeParameters": [],
"parameters": [{"name": "arg0", "type": {"variable": "hydra.core.ast.Expr"}, "isLazy": false}],
"result": {"type": {"variable": "hydra.core.ast.Expr"}}},
"body": {
"annotated": {
"body": {
"application": {
"function": {
"application": {
"function": {"variable": "hydra.core.serialization.brackets"},
"argument": {"variable": "hydra.core.serialization.parentheses"}}},
"argument": {"variable": "hydra.core.serialization.inlineStyle"}}},
"annotation": {
"map": [{"key": {"variable": "description"}, "value": {"literal": {"string": "Wrap an expression in inline parentheses"}}}]}}}}},
{
"term": {
"name": "hydra.core.serialization.parentheses",
"signature": {"typeParameters": [], "parameters": [], "result": {"type": {"variable": "hydra.core.ast.Brackets"}}},
"body": {
"annotated": {
"body": {
"record": {
"typeName": "hydra.core.ast.Brackets",
"fields": [
{"name": "open", "term": {"wrap": {"typeName": "hydra.core.ast.Symbol", "body": {"literal": {"string": "("}}}}},
{"name": "close", "term": {"wrap": {"typeName": "hydra.core.ast.Symbol", "body": {"literal": {"string": ")"}}}}}]}},
"annotation": {
"map": [
{
"key": {"variable": "description"},
"value": {"literal": {"string": "Round parenthesis pair `(` `)` for use with `brackets`"}}}]}}}}},
{
"term": {
"name": "hydra.core.serialization.parenthesize",
"signature": {
"typeParameters": [],
"parameters": [{"name": "arg0", "type": {"variable": "hydra.core.ast.Expr"}, "isLazy": false}],
"result": {"type": {"variable": "hydra.core.ast.Expr"}}},
"body": {
"annotated": {
"body": {
"lambda": {
"parameter": "exp",
"domain": {"variable": "hydra.core.ast.Expr"},
"body": {
"let": {
"bindings": [
{
"name": "assocLeft",
"term": {
"lambda": {
"parameter": "a",
"domain": {"variable": "hydra.core.ast.Associativity"},
"body": {
"application": {
"function": {
"cases": {
"typeName": "hydra.core.ast.Associativity",
"default": {"literal": {"boolean": true}},
"cases": [
{"name": "right", "handler": {"lambda": {"parameter": "_", "domain": "unit", "body": {"literal": {"boolean": false}}}}}]}},
"argument": {"variable": "a"}}}}},
"typeScheme": {
"variables": [],
"body": {"function": {"domain": {"variable": "hydra.core.ast.Associativity"}, "codomain": {"literal": "boolean"}}},
"constraints": []}}],
"body": {
"let": {
"bindings": [
{
"name": "assocRight",
"term": {
"lambda": {
"parameter": "a",
"domain": {"variable": "hydra.core.ast.Associativity"},
"body": {
"application": {
"function": {
"cases": {
"typeName": "hydra.core.ast.Associativity",
"default": {"literal": {"boolean": true}},
"cases": [{"name": "left", "handler": {"lambda": {"parameter": "_", "domain": "unit", "body": {"literal": {"boolean": false}}}}}]}},
"argument": {"variable": "a"}}}}},
"typeScheme": {
"variables": [],
"body": {"function": {"domain": {"variable": "hydra.core.ast.Associativity"}, "codomain": {"literal": "boolean"}}},
"constraints": []}}],
"body": {
"application": {
"function": {
"cases": {
"typeName": "hydra.core.ast.Expr",
"cases": [
{
"name": "brackets",
"handler": {
"lambda": {
"parameter": "bracketExpr",
"domain": {"variable": "hydra.core.ast.BracketExpr"},
"body": {
"inject": {
"typeName": "hydra.core.ast.Expr",
"field": {
"name": "brackets",
"term": {
"record": {
"typeName": "hydra.core.ast.BracketExpr",
"fields": [
{
"name": "brackets",
"term": {
"application": {
"function": {"project": {"typeName": "hydra.core.ast.BracketExpr", "fieldName": "brackets"}},
"argument": {"variable": "bracketExpr"}}}},
{
"name": "enclosed",
"term": {
"application": {
"function": {"variable": "hydra.core.serialization.parenthesize"},
"argument": {
"application": {
"function": {"project": {"typeName": "hydra.core.ast.BracketExpr", "fieldName": "enclosed"}},
"argument": {"variable": "bracketExpr"}}}}}},
{
"name": "style",
"term": {
"application": {
"function": {"project": {"typeName": "hydra.core.ast.BracketExpr", "fieldName": "style"}},
"argument": {"variable": "bracketExpr"}}}}]}}}}}}}},
{
"name": "const",
"handler": {"lambda": {"parameter": "ignored", "domain": {"variable": "hydra.core.ast.Symbol"}, "body": {"variable": "exp"}}}},
{
"name": "indent",
"handler": {
"lambda": {
"parameter": "indentExpr",
"domain": {"variable": "hydra.core.ast.IndentedExpression"},
"body": {
"inject": {
"typeName": "hydra.core.ast.Expr",
"field": {
"name": "indent",
"term": {
"record": {
"typeName": "hydra.core.ast.IndentedExpression",
"fields": [
{
"name": "style",
"term": {
"application": {
"function": {"project": {"typeName": "hydra.core.ast.IndentedExpression", "fieldName": "style"}},
"argument": {"variable": "indentExpr"}}}},
{
"name": "expr",
"term": {
"application": {
"function": {"variable": "hydra.core.serialization.parenthesize"},
"argument": {
"application": {
"function": {"project": {"typeName": "hydra.core.ast.IndentedExpression", "fieldName": "expr"}},
"argument": {"variable": "indentExpr"}}}}}}]}}}}}}}},
{
"name": "seq",
"handler": {
"lambda": {
"parameter": "seqExpr",
"domain": {"variable": "hydra.core.ast.SeqExpr"},
"body": {
"inject": {
"typeName": "hydra.core.ast.Expr",
"field": {
"name": "seq",
"term": {
"record": {
"typeName": "hydra.core.ast.SeqExpr",
"fields": [
{
"name": "op",
"term": {
"application": {
"function": {"project": {"typeName": "hydra.core.ast.SeqExpr", "fieldName": "op"}},
"argument": {"variable": "seqExpr"}}}},
{
"name": "elements",
"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": {"variable": "hydra.core.serialization.parenthesize"}}},
"argument": {
"application": {
"function": {"project": {"typeName": "hydra.core.ast.SeqExpr", "fieldName": "elements"}},
"argument": {"variable": "seqExpr"}}}}}}]}}}}}}}},
{
"name": "op",
"handler": {
"lambda": {
"parameter": "opExpr",
"domain": {"variable": "hydra.core.ast.OpExpr"},
"body": {
"let": {
"bindings": [
{
"name": "op",
"term": {
"application": {"function": {"project": {"typeName": "hydra.core.ast.OpExpr", "fieldName": "op"}}, "argument": {"variable": "opExpr"}}},
"typeScheme": {"variables": [], "body": {"variable": "hydra.core.ast.Op"}, "constraints": []}}],
"body": {
"let": {
"bindings": [
{
"name": "prec",
"term": {
"application": {
"function": {"unwrap": "hydra.core.ast.Precedence"},
"argument": {
"application": {"function": {"project": {"typeName": "hydra.core.ast.Op", "fieldName": "precedence"}}, "argument": {"variable": "op"}}}}},
"typeScheme": {"variables": [], "body": {"literal": {"integer": "int32"}}, "constraints": []}}],
"body": {
"let": {
"bindings": [
{
"name": "assoc",
"term": {
"application": {
"function": {"project": {"typeName": "hydra.core.ast.Op", "fieldName": "associativity"}},
"argument": {"variable": "op"}}},
"typeScheme": {"variables": [], "body": {"variable": "hydra.core.ast.Associativity"}, "constraints": []}}],
"body": {
"let": {
"bindings": [
{
"name": "lhs",
"term": {
"application": {"function": {"project": {"typeName": "hydra.core.ast.OpExpr", "fieldName": "lhs"}}, "argument": {"variable": "opExpr"}}},
"typeScheme": {"variables": [], "body": {"variable": "hydra.core.ast.Expr"}, "constraints": []}}],
"body": {
"let": {
"bindings": [
{
"name": "rhs",
"term": {
"application": {"function": {"project": {"typeName": "hydra.core.ast.OpExpr", "fieldName": "rhs"}}, "argument": {"variable": "opExpr"}}},
"typeScheme": {"variables": [], "body": {"variable": "hydra.core.ast.Expr"}, "constraints": []}}],
"body": {
"let": {
"bindings": [
{
"name": "lhs'",
"term": {"application": {"function": {"variable": "hydra.core.serialization.parenthesize"}, "argument": {"variable": "lhs"}}},
"typeScheme": {"variables": [], "body": {"variable": "hydra.core.ast.Expr"}, "constraints": []}}],
"body": {
"let": {
"bindings": [
{
"name": "rhs'",
"term": {"application": {"function": {"variable": "hydra.core.serialization.parenthesize"}, "argument": {"variable": "rhs"}}},
"typeScheme": {"variables": [], "body": {"variable": "hydra.core.ast.Expr"}, "constraints": []}}],
"body": {
"let": {
"bindings": [
{
"name": "lhs2",
"term": {
"application": {
"function": {
"cases": {
"typeName": "hydra.core.ast.Expr",
"default": {"variable": "lhs'"},
"cases": [
{
"name": "op",
"handler": {
"lambda": {
"parameter": "lopExpr",
"domain": {"variable": "hydra.core.ast.OpExpr"},
"body": {
"let": {
"bindings": [
{
"name": "lop",
"term": {
"application": {"function": {"project": {"typeName": "hydra.core.ast.OpExpr", "fieldName": "op"}}, "argument": {"variable": "lopExpr"}}},
"typeScheme": {"variables": [], "body": {"variable": "hydra.core.ast.Op"}, "constraints": []}}],
"body": {
"let": {
"bindings": [
{
"name": "lprec",
"term": {
"application": {
"function": {"unwrap": "hydra.core.ast.Precedence"},
"argument": {
"application": {"function": {"project": {"typeName": "hydra.core.ast.Op", "fieldName": "precedence"}}, "argument": {"variable": "lop"}}}}},
"typeScheme": {"variables": [], "body": {"literal": {"integer": "int32"}}, "constraints": []}}],
"body": {
"let": {
"bindings": [
{
"name": "lassoc",
"term": {
"application": {
"function": {"project": {"typeName": "hydra.core.ast.Op", "fieldName": "associativity"}},
"argument": {"variable": "lop"}}},
"typeScheme": {"variables": [], "body": {"variable": "hydra.core.ast.Associativity"}, "constraints": []}}],
"body": {
"let": {
"bindings": [
{
"name": "comparison",
"term": {
"application": {
"function": {
"application": {
"function": {
"typeApplication": {"body": {"variable": "hydra.core.lib.ordering.compare"}, "type": {"literal": {"integer": "int32"}}}},
"argument": {"variable": "prec"}}},
"argument": {"variable": "lprec"}}},
"typeScheme": {"variables": [], "body": {"variable": "hydra.core.util.Comparison"}, "constraints": []}}],
"body": {
"application": {
"function": {
"cases": {
"typeName": "hydra.core.util.Comparison",
"cases": [
{"name": "lessThan", "handler": {"lambda": {"parameter": "_", "domain": "unit", "body": {"variable": "lhs'"}}}},
{
"name": "greaterThan",
"handler": {
"lambda": {
"parameter": "_",
"domain": "unit",
"body": {"application": {"function": {"variable": "hydra.core.serialization.parens"}, "argument": {"variable": "lhs'"}}}}}},
{
"name": "equalTo",
"handler": {
"lambda": {
"parameter": "_",
"domain": "unit",
"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": {"variable": "hydra.core.lib.logic.and"},
"argument": {"application": {"function": {"variable": "assocLeft"}, "argument": {"variable": "assoc"}}}}},
"argument": {"application": {"function": {"variable": "assocLeft"}, "argument": {"variable": "lassoc"}}}}}}},
"argument": {"variable": "lhs'"}}},
"argument": {"application": {"function": {"variable": "hydra.core.serialization.parens"}, "argument": {"variable": "lhs'"}}}}}}}}]}},
"argument": {"variable": "comparison"}}}}}}}}}}}}}}]}},
"argument": {"variable": "lhs'"}}},
"typeScheme": {"variables": [], "body": {"variable": "hydra.core.ast.Expr"}, "constraints": []}}],
"body": {
"let": {
"bindings": [
{
"name": "rhs2",
"term": {
"application": {
"function": {
"cases": {
"typeName": "hydra.core.ast.Expr",
"default": {"variable": "rhs'"},
"cases": [
{
"name": "op",
"handler": {
"lambda": {
"parameter": "ropExpr",
"domain": {"variable": "hydra.core.ast.OpExpr"},
"body": {
"let": {
"bindings": [
{
"name": "rop",
"term": {
"application": {"function": {"project": {"typeName": "hydra.core.ast.OpExpr", "fieldName": "op"}}, "argument": {"variable": "ropExpr"}}},
"typeScheme": {"variables": [], "body": {"variable": "hydra.core.ast.Op"}, "constraints": []}}],
"body": {
"let": {
"bindings": [
{
"name": "rprec",
"term": {
"application": {
"function": {"unwrap": "hydra.core.ast.Precedence"},
"argument": {
"application": {"function": {"project": {"typeName": "hydra.core.ast.Op", "fieldName": "precedence"}}, "argument": {"variable": "rop"}}}}},
"typeScheme": {"variables": [], "body": {"literal": {"integer": "int32"}}, "constraints": []}}],
"body": {
"let": {
"bindings": [
{
"name": "rassoc",
"term": {
"application": {
"function": {"project": {"typeName": "hydra.core.ast.Op", "fieldName": "associativity"}},
"argument": {"variable": "rop"}}},
"typeScheme": {"variables": [], "body": {"variable": "hydra.core.ast.Associativity"}, "constraints": []}}],
"body": {
"let": {
"bindings": [
{
"name": "comparison",
"term": {
"application": {
"function": {
"application": {
"function": {
"typeApplication": {"body": {"variable": "hydra.core.lib.ordering.compare"}, "type": {"literal": {"integer": "int32"}}}},
"argument": {"variable": "prec"}}},
"argument": {"variable": "rprec"}}},
"typeScheme": {"variables": [], "body": {"variable": "hydra.core.util.Comparison"}, "constraints": []}}],
"body": {
"application": {
"function": {
"cases": {
"typeName": "hydra.core.util.Comparison",
"cases": [
{"name": "lessThan", "handler": {"lambda": {"parameter": "_", "domain": "unit", "body": {"variable": "rhs'"}}}},
{
"name": "greaterThan",
"handler": {
"lambda": {
"parameter": "_",
"domain": "unit",
"body": {"application": {"function": {"variable": "hydra.core.serialization.parens"}, "argument": {"variable": "rhs'"}}}}}},
{
"name": "equalTo",
"handler": {
"lambda": {
"parameter": "_",
"domain": "unit",
"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": {"variable": "hydra.core.lib.logic.and"},
"argument": {"application": {"function": {"variable": "assocRight"}, "argument": {"variable": "assoc"}}}}},
"argument": {"application": {"function": {"variable": "assocRight"}, "argument": {"variable": "rassoc"}}}}}}},
"argument": {"variable": "rhs'"}}},
"argument": {"application": {"function": {"variable": "hydra.core.serialization.parens"}, "argument": {"variable": "rhs'"}}}}}}}}]}},
"argument": {"variable": "comparison"}}}}}}}}}}}}}}]}},
"argument": {"variable": "rhs'"}}},
"typeScheme": {"variables": [], "body": {"variable": "hydra.core.ast.Expr"}, "constraints": []}}],
"body": {
"inject": {
"typeName": "hydra.core.ast.Expr",
"field": {
"name": "op",
"term": {
"record": {
"typeName": "hydra.core.ast.OpExpr",
"fields": [
{"name": "op", "term": {"variable": "op"}},
{"name": "lhs", "term": {"variable": "lhs2"}},
{"name": "rhs", "term": {"variable": "rhs2"}}]}}}}}}}}}}}}}}}}}}}}}}}}}}]}},
"argument": {"variable": "exp"}}}}}}}}},
"annotation": {
"map": [
{
"key": {"variable": "description"},
"value": {
"literal": {
"string": "Recursively insert parentheses around subexpressions where required by operator precedence and associativity. The traversal descends into bracket, indent, sequence, and operator expressions and parenthesizes left or right operands whose binding is weaker than the surrounding operator."}}}]}}}}},
{
"term": {
"name": "hydra.core.serialization.prefix",
"signature": {
"typeParameters": [],
"parameters": [
{"name": "arg0", "type": {"literal": "string"}, "isLazy": false},
{"name": "arg1", "type": {"variable": "hydra.core.ast.Expr"}, "isLazy": false}],
"result": {"type": {"variable": "hydra.core.ast.Expr"}}},
"body": {
"annotated": {
"body": {
"lambda": {
"parameter": "p",
"domain": {"literal": "string"},
"body": {
"lambda": {
"parameter": "expr",
"domain": {"variable": "hydra.core.ast.Expr"},
"body": {
"let": {
"bindings": [
{
"name": "preOp",
"term": {
"record": {
"typeName": "hydra.core.ast.Op",
"fields": [
{
"name": "symbol",
"term": {"application": {"function": {"variable": "hydra.core.serialization.sym"}, "argument": {"variable": "p"}}}},
{
"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": {"variable": "hydra.core.serialization.ifx"}, "argument": {"variable": "preOp"}}},
"argument": {"application": {"function": {"variable": "hydra.core.serialization.cst"}, "argument": {"literal": {"string": ""}}}}}},
"argument": {"variable": "expr"}}}}}}}}},
"annotation": {
"map": [
{
"key": {"variable": "description"},
"value": {"literal": {"string": "Prepend a prefix string to an expression with no surrounding whitespace"}}}]}}}}},
{
"term": {
"name": "hydra.core.serialization.printExpr",
"signature": {
"typeParameters": [],
"parameters": [{"name": "arg0", "type": {"variable": "hydra.core.ast.Expr"}, "isLazy": false}],
"result": {"type": {"literal": "string"}}},
"body": {
"annotated": {
"body": {
"lambda": {
"parameter": "e",
"domain": {"variable": "hydra.core.ast.Expr"},
"body": {
"let": {
"bindings": [
{
"name": "pad",
"term": {
"lambda": {
"parameter": "ws",
"domain": {"variable": "hydra.core.ast.Ws"},
"body": {
"application": {
"function": {
"cases": {
"typeName": "hydra.core.ast.Ws",
"cases": [
{"name": "none", "handler": {"lambda": {"parameter": "_", "domain": "unit", "body": {"literal": {"string": ""}}}}},
{"name": "space", "handler": {"lambda": {"parameter": "_", "domain": "unit", "body": {"literal": {"string": " "}}}}},
{"name": "break", "handler": {"lambda": {"parameter": "_", "domain": "unit", "body": {"literal": {"string": "\n"}}}}},
{
"name": "breakAndIndent",
"handler": {"lambda": {"parameter": "ignored", "domain": {"literal": "string"}, "body": {"literal": {"string": "\n"}}}}},
{
"name": "doubleBreak",
"handler": {"lambda": {"parameter": "_", "domain": "unit", "body": {"literal": {"string": "\n\n"}}}}}]}},
"argument": {"variable": "ws"}}}}},
"typeScheme": {
"variables": [],
"body": {"function": {"domain": {"variable": "hydra.core.ast.Ws"}, "codomain": {"literal": "string"}}},
"constraints": []}}],
"body": {
"let": {
"bindings": [
{
"name": "idt",
"term": {
"lambda": {
"parameter": "ws",
"domain": {"variable": "hydra.core.ast.Ws"},
"body": {
"lambda": {
"parameter": "s",
"domain": {"literal": "string"},
"body": {
"application": {
"function": {
"cases": {
"typeName": "hydra.core.ast.Ws",
"default": {"variable": "s"},
"cases": [
{
"name": "breakAndIndent",
"handler": {
"lambda": {
"parameter": "indentStr",
"domain": {"literal": "string"},
"body": {
"application": {
"function": {
"application": {"function": {"variable": "hydra.core.serialization.customIndent"}, "argument": {"variable": "indentStr"}}},
"argument": {"variable": "s"}}}}}}]}},
"argument": {"variable": "ws"}}}}}}},
"typeScheme": {
"variables": [],
"body": {
"function": {
"domain": {"variable": "hydra.core.ast.Ws"},
"codomain": {"function": {"domain": {"literal": "string"}, "codomain": {"literal": "string"}}}}},
"constraints": []}}],
"body": {
"application": {
"function": {
"cases": {
"typeName": "hydra.core.ast.Expr",
"cases": [
{
"name": "const",
"handler": {
"lambda": {
"parameter": "symbol",
"domain": {"variable": "hydra.core.ast.Symbol"},
"body": {"application": {"function": {"unwrap": "hydra.core.ast.Symbol"}, "argument": {"variable": "symbol"}}}}}},
{
"name": "indent",
"handler": {
"lambda": {
"parameter": "indentExpr",
"domain": {"variable": "hydra.core.ast.IndentedExpression"},
"body": {
"let": {
"bindings": [
{
"name": "style",
"term": {
"application": {
"function": {"project": {"typeName": "hydra.core.ast.IndentedExpression", "fieldName": "style"}},
"argument": {"variable": "indentExpr"}}},
"typeScheme": {"variables": [], "body": {"variable": "hydra.core.ast.IndentStyle"}, "constraints": []}}],
"body": {
"let": {
"bindings": [
{
"name": "expr",
"term": {
"application": {
"function": {"project": {"typeName": "hydra.core.ast.IndentedExpression", "fieldName": "expr"}},
"argument": {"variable": "indentExpr"}}},
"typeScheme": {"variables": [], "body": {"variable": "hydra.core.ast.Expr"}, "constraints": []}}],
"body": {
"let": {
"bindings": [
{
"name": "lns",
"term": {
"application": {
"function": {"variable": "hydra.core.formatting.lines"},
"argument": {"application": {"function": {"variable": "hydra.core.serialization.printExpr"}, "argument": {"variable": "expr"}}}}},
"typeScheme": {"variables": [], "body": {"list": {"literal": "string"}}, "constraints": []}}],
"body": {
"let": {
"bindings": [
{
"name": "indentLine",
"term": {
"lambda": {
"parameter": "pre",
"domain": {"literal": "string"},
"body": {
"lambda": {
"parameter": "line",
"domain": {"literal": "string"},
"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.equality.equal"}, "type": {"literal": "string"}}},
"argument": {"variable": "line"}}},
"argument": {"literal": {"string": ""}}}}}},
"argument": {"variable": "line"}}},
"argument": {
"application": {
"function": {"application": {"function": {"variable": "hydra.core.lib.strings.concat2"}, "argument": {"variable": "pre"}}},
"argument": {"variable": "line"}}}}}}}}},
"typeScheme": {
"variables": [],
"body": {
"function": {
"domain": {"literal": "string"},
"codomain": {"function": {"domain": {"literal": "string"}, "codomain": {"literal": "string"}}}}},
"constraints": []}}],
"body": {
"let": {
"bindings": [
{
"name": "ilns",
"term": {
"application": {
"function": {
"cases": {
"typeName": "hydra.core.ast.IndentStyle",
"cases": [
{
"name": "allLines",
"handler": {
"lambda": {
"parameter": "pre",
"domain": {"literal": "string"},
"body": {
"application": {
"function": {
"application": {
"function": {
"typeApplication": {
"body": {"typeApplication": {"body": {"variable": "hydra.core.lib.lists.map"}, "type": {"literal": "string"}}},
"type": {"literal": "string"}}},
"argument": {"application": {"function": {"variable": "indentLine"}, "argument": {"variable": "pre"}}}}},
"argument": {"variable": "lns"}}}}}},
{
"name": "subsequentLines",
"handler": {
"lambda": {
"parameter": "pre",
"domain": {"literal": "string"},
"body": {
"application": {
"function": {
"application": {
"function": {
"application": {
"function": {"typeApplication": {"body": {"variable": "hydra.core.lib.logic.ifElse"}, "type": {"list": {"literal": "string"}}}},
"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": {"literal": "string"}}},
"argument": {"variable": "lns"}}}}},
"argument": {"literal": {"integer": {"int32": 1}}}}}}},
"argument": {"variable": "lns"}}},
"argument": {
"application": {
"function": {
"application": {
"function": {
"typeApplication": {"body": {"variable": "hydra.core.lib.optionals.withDefault"}, "type": {"list": {"literal": "string"}}}},
"argument": {"variable": "lns"}}},
"argument": {
"application": {
"function": {
"application": {
"function": {
"typeApplication": {
"body": {
"typeApplication": {
"body": {"variable": "hydra.core.lib.optionals.map"},
"type": {"pair": {"first": {"literal": "string"}, "second": {"list": {"literal": "string"}}}}}},
"type": {"list": {"literal": "string"}}}},
"argument": {
"lambda": {
"parameter": "uc",
"domain": {"pair": {"first": {"literal": "string"}, "second": {"list": {"literal": "string"}}}},
"body": {
"application": {
"function": {
"application": {
"function": {"typeApplication": {"body": {"variable": "hydra.core.lib.lists.cons"}, "type": {"literal": "string"}}},
"argument": {
"application": {
"function": {
"typeApplication": {
"body": {"typeApplication": {"body": {"variable": "hydra.core.lib.pairs.first"}, "type": {"literal": "string"}}},
"type": {"list": {"literal": "string"}}}},
"argument": {"variable": "uc"}}}}},
"argument": {
"application": {
"function": {
"application": {
"function": {
"typeApplication": {
"body": {"typeApplication": {"body": {"variable": "hydra.core.lib.lists.map"}, "type": {"literal": "string"}}},
"type": {"literal": "string"}}},
"argument": {"application": {"function": {"variable": "indentLine"}, "argument": {"variable": "pre"}}}}},
"argument": {
"application": {
"function": {
"typeApplication": {
"body": {"typeApplication": {"body": {"variable": "hydra.core.lib.pairs.second"}, "type": {"literal": "string"}}},
"type": {"list": {"literal": "string"}}}},
"argument": {"variable": "uc"}}}}}}}}}}},
"argument": {
"application": {
"function": {"typeApplication": {"body": {"variable": "hydra.core.lib.lists.uncons"}, "type": {"literal": "string"}}},
"argument": {"variable": "lns"}}}}}}}}}}}}]}},
"argument": {"variable": "style"}}},
"typeScheme": {"variables": [], "body": {"list": {"literal": "string"}}, "constraints": []}}],
"body": {
"application": {
"function": {"application": {"function": {"variable": "hydra.core.lib.strings.join"}, "argument": {"literal": {"string": "\n"}}}},
"argument": {"variable": "ilns"}}}}}}}}}}}}}}}},
{
"name": "seq",
"handler": {
"lambda": {
"parameter": "seqExpr",
"domain": {"variable": "hydra.core.ast.SeqExpr"},
"body": {
"let": {
"bindings": [
{
"name": "sop",
"term": {
"application": {
"function": {"project": {"typeName": "hydra.core.ast.SeqExpr", "fieldName": "op"}},
"argument": {"variable": "seqExpr"}}},
"typeScheme": {"variables": [], "body": {"variable": "hydra.core.ast.Op"}, "constraints": []}}],
"body": {
"let": {
"bindings": [
{
"name": "ssym",
"term": {
"application": {
"function": {"unwrap": "hydra.core.ast.Symbol"},
"argument": {
"application": {"function": {"project": {"typeName": "hydra.core.ast.Op", "fieldName": "symbol"}}, "argument": {"variable": "sop"}}}}},
"typeScheme": {"variables": [], "body": {"literal": "string"}, "constraints": []}}],
"body": {
"let": {
"bindings": [
{
"name": "spadding",
"term": {
"application": {"function": {"project": {"typeName": "hydra.core.ast.Op", "fieldName": "padding"}}, "argument": {"variable": "sop"}}},
"typeScheme": {"variables": [], "body": {"variable": "hydra.core.ast.Padding"}, "constraints": []}}],
"body": {
"let": {
"bindings": [
{
"name": "spadl",
"term": {
"application": {
"function": {"project": {"typeName": "hydra.core.ast.Padding", "fieldName": "left"}},
"argument": {"variable": "spadding"}}},
"typeScheme": {"variables": [], "body": {"variable": "hydra.core.ast.Ws"}, "constraints": []}}],
"body": {
"let": {
"bindings": [
{
"name": "spadr",
"term": {
"application": {
"function": {"project": {"typeName": "hydra.core.ast.Padding", "fieldName": "right"}},
"argument": {"variable": "spadding"}}},
"typeScheme": {"variables": [], "body": {"variable": "hydra.core.ast.Ws"}, "constraints": []}}],
"body": {
"let": {
"bindings": [
{
"name": "selements",
"term": {
"application": {
"function": {"project": {"typeName": "hydra.core.ast.SeqExpr", "fieldName": "elements"}},
"argument": {"variable": "seqExpr"}}},
"typeScheme": {"variables": [], "body": {"list": {"variable": "hydra.core.ast.Expr"}}, "constraints": []}}],
"body": {
"let": {
"bindings": [
{
"name": "printedElements",
"term": {
"application": {
"function": {
"application": {
"function": {
"typeApplication": {
"body": {"typeApplication": {"body": {"variable": "hydra.core.lib.lists.map"}, "type": {"variable": "hydra.core.ast.Expr"}}},
"type": {"literal": "string"}}},
"argument": {
"lambda": {
"parameter": "el",
"domain": {"variable": "hydra.core.ast.Expr"},
"body": {
"application": {
"function": {"application": {"function": {"variable": "idt"}, "argument": {"variable": "spadr"}}},
"argument": {"application": {"function": {"variable": "hydra.core.serialization.printExpr"}, "argument": {"variable": "el"}}}}}}}}},
"argument": {"variable": "selements"}}},
"typeScheme": {"variables": [], "body": {"list": {"literal": "string"}}, "constraints": []}}],
"body": {
"let": {
"bindings": [
{
"name": "isNewlineWs",
"term": {
"lambda": {
"parameter": "ws",
"domain": {"variable": "hydra.core.ast.Ws"},
"body": {
"application": {
"function": {
"cases": {
"typeName": "hydra.core.ast.Ws",
"default": {"literal": {"boolean": false}},
"cases": [
{"name": "break", "handler": {"lambda": {"parameter": "_", "domain": "unit", "body": {"literal": {"boolean": true}}}}},
{
"name": "breakAndIndent",
"handler": {"lambda": {"parameter": "_", "domain": {"literal": "string"}, "body": {"literal": {"boolean": true}}}}},
{
"name": "doubleBreak",
"handler": {"lambda": {"parameter": "_", "domain": "unit", "body": {"literal": {"boolean": true}}}}}]}},
"argument": {"variable": "ws"}}}}},
"typeScheme": {
"variables": [],
"body": {"function": {"domain": {"variable": "hydra.core.ast.Ws"}, "codomain": {"literal": "boolean"}}},
"constraints": []}}],
"body": {
"let": {
"bindings": [
{
"name": "spadlIsNewline",
"term": {"application": {"function": {"variable": "isNewlineWs"}, "argument": {"variable": "spadl"}}},
"typeScheme": {"variables": [], "body": {"literal": "boolean"}, "constraints": []}}],
"body": {
"let": {
"bindings": [
{
"name": "spadrIsNewline",
"term": {"application": {"function": {"variable": "isNewlineWs"}, "argument": {"variable": "spadr"}}},
"typeScheme": {"variables": [], "body": {"literal": "boolean"}, "constraints": []}}],
"body": {
"let": {
"bindings": [
{
"name": "joinElements",
"term": {
"lambda": {
"parameter": "acc",
"domain": {"literal": "string"},
"body": {
"lambda": {
"parameter": "el",
"domain": {"literal": "string"},
"body": {
"let": {
"bindings": [
{
"name": "elStartsWithNewline",
"term": {
"application": {
"function": {
"application": {
"function": {
"application": {
"function": {
"typeApplication": {
"body": {"typeApplication": {"body": {"variable": "hydra.core.lib.optionals.match"}, "type": {"literal": {"integer": "int32"}}}},
"type": {"literal": "boolean"}}},
"argument": {
"application": {
"function": {
"application": {"function": {"variable": "hydra.core.lib.strings.charAt"}, "argument": {"literal": {"integer": {"int32": 0}}}}},
"argument": {"variable": "el"}}}}},
"argument": {"literal": {"boolean": false}}}},
"argument": {
"lambda": {
"parameter": "c",
"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": {"literal": {"integer": {"int32": 10}}}}}}}}},
"typeScheme": {"variables": [], "body": {"literal": "boolean"}, "constraints": []}}],
"body": {
"let": {
"bindings": [
{
"name": "elIsEmpty",
"term": {
"application": {
"function": {
"application": {
"function": {"typeApplication": {"body": {"variable": "hydra.core.lib.equality.equal"}, "type": {"literal": "string"}}},
"argument": {"variable": "el"}}},
"argument": {"literal": {"string": ""}}}},
"typeScheme": {"variables": [], "body": {"literal": "boolean"}, "constraints": []}}],
"body": {
"let": {
"bindings": [
{
"name": "padlEff",
"term": {
"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.or"},
"argument": {
"application": {
"function": {"application": {"function": {"variable": "hydra.core.lib.logic.and"}, "argument": {"variable": "elStartsWithNewline"}}},
"argument": {"application": {"function": {"variable": "hydra.core.lib.logic.not"}, "argument": {"variable": "spadlIsNewline"}}}}}}},
"argument": {
"application": {
"function": {"application": {"function": {"variable": "hydra.core.lib.logic.and"}, "argument": {"variable": "elIsEmpty"}}},
"argument": {
"application": {
"function": {
"application": {
"function": {"typeApplication": {"body": {"variable": "hydra.core.lib.equality.equal"}, "type": {"literal": "string"}}},
"argument": {"variable": "ssym"}}},
"argument": {"literal": {"string": ""}}}}}}}}}},
"argument": {"literal": {"string": ""}}}},
"argument": {"application": {"function": {"variable": "pad"}, "argument": {"variable": "spadl"}}}}},
"typeScheme": {"variables": [], "body": {"literal": "string"}, "constraints": []}}],
"body": {
"let": {
"bindings": [
{
"name": "padrEff",
"term": {
"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.or"},
"argument": {
"application": {
"function": {"application": {"function": {"variable": "hydra.core.lib.logic.and"}, "argument": {"variable": "elStartsWithNewline"}}},
"argument": {"application": {"function": {"variable": "hydra.core.lib.logic.not"}, "argument": {"variable": "spadrIsNewline"}}}}}}},
"argument": {
"application": {
"function": {"application": {"function": {"variable": "hydra.core.lib.logic.and"}, "argument": {"variable": "elIsEmpty"}}},
"argument": {
"application": {
"function": {
"application": {
"function": {"typeApplication": {"body": {"variable": "hydra.core.lib.equality.equal"}, "type": {"literal": "string"}}},
"argument": {"variable": "ssym"}}},
"argument": {"literal": {"string": ""}}}}}}}}}},
"argument": {"literal": {"string": ""}}}},
"argument": {"application": {"function": {"variable": "pad"}, "argument": {"variable": "spadr"}}}}},
"typeScheme": {"variables": [], "body": {"literal": "string"}, "constraints": []}}],
"body": {
"application": {
"function": {"variable": "hydra.core.lib.strings.concat"},
"argument": {
"list": [{"variable": "acc"}, {"variable": "padlEff"}, {"variable": "ssym"}, {"variable": "padrEff"}, {"variable": "el"}]}}}}}}}}}}}}}}},
"typeScheme": {
"variables": [],
"body": {
"function": {
"domain": {"literal": "string"},
"codomain": {"function": {"domain": {"literal": "string"}, "codomain": {"literal": "string"}}}}},
"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": {"typeApplication": {"body": {"variable": "hydra.core.lib.lists.head"}, "type": {"literal": "string"}}},
"argument": {"variable": "printedElements"}}}}},
"argument": {"literal": {"string": ""}}}},
"argument": {
"lambda": {
"parameter": "h",
"domain": {"literal": "string"},
"body": {
"application": {
"function": {
"application": {
"function": {
"application": {
"function": {
"typeApplication": {
"body": {"typeApplication": {"body": {"variable": "hydra.core.lib.lists.foldl"}, "type": {"literal": "string"}}},
"type": {"literal": "string"}}},
"argument": {"variable": "joinElements"}}},
"argument": {"variable": "h"}}},
"argument": {
"application": {
"function": {
"application": {
"function": {"typeApplication": {"body": {"variable": "hydra.core.lib.lists.drop"}, "type": {"literal": "string"}}},
"argument": {"literal": {"integer": {"int32": 1}}}}},
"argument": {"variable": "printedElements"}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}},
{
"name": "op",
"handler": {
"lambda": {
"parameter": "opExpr",
"domain": {"variable": "hydra.core.ast.OpExpr"},
"body": {
"let": {
"bindings": [
{
"name": "op",
"term": {
"application": {"function": {"project": {"typeName": "hydra.core.ast.OpExpr", "fieldName": "op"}}, "argument": {"variable": "opExpr"}}},
"typeScheme": {"variables": [], "body": {"variable": "hydra.core.ast.Op"}, "constraints": []}}],
"body": {
"let": {
"bindings": [
{
"name": "sym",
"term": {
"application": {
"function": {"unwrap": "hydra.core.ast.Symbol"},
"argument": {
"application": {"function": {"project": {"typeName": "hydra.core.ast.Op", "fieldName": "symbol"}}, "argument": {"variable": "op"}}}}},
"typeScheme": {"variables": [], "body": {"literal": "string"}, "constraints": []}}],
"body": {
"let": {
"bindings": [
{
"name": "padding",
"term": {
"application": {"function": {"project": {"typeName": "hydra.core.ast.Op", "fieldName": "padding"}}, "argument": {"variable": "op"}}},
"typeScheme": {"variables": [], "body": {"variable": "hydra.core.ast.Padding"}, "constraints": []}}],
"body": {
"let": {
"bindings": [
{
"name": "padl",
"term": {
"application": {
"function": {"project": {"typeName": "hydra.core.ast.Padding", "fieldName": "left"}},
"argument": {"variable": "padding"}}},
"typeScheme": {"variables": [], "body": {"variable": "hydra.core.ast.Ws"}, "constraints": []}}],
"body": {
"let": {
"bindings": [
{
"name": "padr",
"term": {
"application": {
"function": {"project": {"typeName": "hydra.core.ast.Padding", "fieldName": "right"}},
"argument": {"variable": "padding"}}},
"typeScheme": {"variables": [], "body": {"variable": "hydra.core.ast.Ws"}, "constraints": []}}],
"body": {
"let": {
"bindings": [
{
"name": "l",
"term": {
"application": {"function": {"project": {"typeName": "hydra.core.ast.OpExpr", "fieldName": "lhs"}}, "argument": {"variable": "opExpr"}}},
"typeScheme": {"variables": [], "body": {"variable": "hydra.core.ast.Expr"}, "constraints": []}}],
"body": {
"let": {
"bindings": [
{
"name": "r",
"term": {
"application": {"function": {"project": {"typeName": "hydra.core.ast.OpExpr", "fieldName": "rhs"}}, "argument": {"variable": "opExpr"}}},
"typeScheme": {"variables": [], "body": {"variable": "hydra.core.ast.Expr"}, "constraints": []}}],
"body": {
"let": {
"bindings": [
{
"name": "lhs",
"term": {
"application": {
"function": {"application": {"function": {"variable": "idt"}, "argument": {"variable": "padl"}}},
"argument": {"application": {"function": {"variable": "hydra.core.serialization.printExpr"}, "argument": {"variable": "l"}}}}},
"typeScheme": {"variables": [], "body": {"literal": "string"}, "constraints": []}}],
"body": {
"let": {
"bindings": [
{
"name": "rhs",
"term": {
"application": {
"function": {"application": {"function": {"variable": "idt"}, "argument": {"variable": "padr"}}},
"argument": {"application": {"function": {"variable": "hydra.core.serialization.printExpr"}, "argument": {"variable": "r"}}}}},
"typeScheme": {"variables": [], "body": {"literal": "string"}, "constraints": []}}],
"body": {
"let": {
"bindings": [
{
"name": "padrIsNewline",
"term": {
"application": {
"function": {
"cases": {
"typeName": "hydra.core.ast.Ws",
"default": {"literal": {"boolean": false}},
"cases": [
{"name": "break", "handler": {"lambda": {"parameter": "_", "domain": "unit", "body": {"literal": {"boolean": true}}}}},
{
"name": "breakAndIndent",
"handler": {"lambda": {"parameter": "_", "domain": {"literal": "string"}, "body": {"literal": {"boolean": true}}}}},
{
"name": "doubleBreak",
"handler": {"lambda": {"parameter": "_", "domain": "unit", "body": {"literal": {"boolean": true}}}}}]}},
"argument": {"variable": "padr"}}},
"typeScheme": {"variables": [], "body": {"literal": "boolean"}, "constraints": []}}],
"body": {
"let": {
"bindings": [
{
"name": "padlIsNewline",
"term": {
"application": {
"function": {
"cases": {
"typeName": "hydra.core.ast.Ws",
"default": {"literal": {"boolean": false}},
"cases": [
{"name": "break", "handler": {"lambda": {"parameter": "_", "domain": "unit", "body": {"literal": {"boolean": true}}}}},
{
"name": "doubleBreak",
"handler": {"lambda": {"parameter": "_", "domain": "unit", "body": {"literal": {"boolean": true}}}}}]}},
"argument": {"variable": "padl"}}},
"typeScheme": {"variables": [], "body": {"literal": "boolean"}, "constraints": []}}],
"body": {
"let": {
"bindings": [
{
"name": "padlEffective",
"term": {
"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.lib.logic.not"}, "argument": {"variable": "padlIsNewline"}}}}},
"argument": {
"application": {
"function": {
"application": {
"function": {"variable": "hydra.core.lib.logic.and"},
"argument": {
"application": {
"function": {
"application": {
"function": {"typeApplication": {"body": {"variable": "hydra.core.lib.equality.equal"}, "type": {"literal": "string"}}},
"argument": {"variable": "sym"}}},
"argument": {"literal": {"string": ""}}}}}},
"argument": {
"application": {
"function": {"application": {"function": {"variable": "hydra.core.lib.logic.or"}, "argument": {"variable": "padrIsNewline"}}},
"argument": {
"application": {
"function": {
"application": {
"function": {"typeApplication": {"body": {"variable": "hydra.core.lib.equality.equal"}, "type": {"literal": "string"}}},
"argument": {"variable": "rhs"}}},
"argument": {"literal": {"string": ""}}}}}}}}}}}},
"argument": {"literal": {"string": ""}}}},
"argument": {"application": {"function": {"variable": "pad"}, "argument": {"variable": "padl"}}}}},
"typeScheme": {"variables": [], "body": {"literal": "string"}, "constraints": []}}],
"body": {
"let": {
"bindings": [
{
"name": "padrPad",
"term": {"application": {"function": {"variable": "pad"}, "argument": {"variable": "padr"}}},
"typeScheme": {"variables": [], "body": {"literal": "string"}, "constraints": []}}],
"body": {
"let": {
"bindings": [
{
"name": "rhsStartsWithNewline",
"term": {
"application": {
"function": {
"application": {
"function": {
"application": {
"function": {
"typeApplication": {
"body": {"typeApplication": {"body": {"variable": "hydra.core.lib.optionals.match"}, "type": {"literal": {"integer": "int32"}}}},
"type": {"literal": "boolean"}}},
"argument": {
"application": {
"function": {
"application": {"function": {"variable": "hydra.core.lib.strings.charAt"}, "argument": {"literal": {"integer": {"int32": 0}}}}},
"argument": {"variable": "rhs"}}}}},
"argument": {"literal": {"boolean": false}}}},
"argument": {
"lambda": {
"parameter": "c",
"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": {"literal": {"integer": {"int32": 10}}}}}}}}},
"typeScheme": {"variables": [], "body": {"literal": "boolean"}, "constraints": []}}],
"body": {
"let": {
"bindings": [
{
"name": "padrEffective",
"term": {
"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": {"variable": "rhsStartsWithNewline"}}},
"argument": {"application": {"function": {"variable": "hydra.core.lib.logic.not"}, "argument": {"variable": "padrIsNewline"}}}}}}},
"argument": {"literal": {"string": ""}}}},
"argument": {"variable": "padrPad"}}},
"typeScheme": {"variables": [], "body": {"literal": "string"}, "constraints": []}}],
"body": {
"application": {
"function": {
"application": {
"function": {"variable": "hydra.core.lib.strings.concat2"},
"argument": {
"application": {
"function": {
"application": {
"function": {"variable": "hydra.core.lib.strings.concat2"},
"argument": {
"application": {
"function": {
"application": {
"function": {"variable": "hydra.core.lib.strings.concat2"},
"argument": {
"application": {
"function": {"application": {"function": {"variable": "hydra.core.lib.strings.concat2"}, "argument": {"variable": "lhs"}}},
"argument": {"variable": "padlEffective"}}}}},
"argument": {"variable": "sym"}}}}},
"argument": {"variable": "padrEffective"}}}}},
"argument": {"variable": "rhs"}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}},
{
"name": "brackets",
"handler": {
"lambda": {
"parameter": "bracketExpr",
"domain": {"variable": "hydra.core.ast.BracketExpr"},
"body": {
"let": {
"bindings": [
{
"name": "brs",
"term": {
"application": {
"function": {"project": {"typeName": "hydra.core.ast.BracketExpr", "fieldName": "brackets"}},
"argument": {"variable": "bracketExpr"}}},
"typeScheme": {"variables": [], "body": {"variable": "hydra.core.ast.Brackets"}, "constraints": []}}],
"body": {
"let": {
"bindings": [
{
"name": "l",
"term": {
"application": {
"function": {"unwrap": "hydra.core.ast.Symbol"},
"argument": {
"application": {"function": {"project": {"typeName": "hydra.core.ast.Brackets", "fieldName": "open"}}, "argument": {"variable": "brs"}}}}},
"typeScheme": {"variables": [], "body": {"literal": "string"}, "constraints": []}}],
"body": {
"let": {
"bindings": [
{
"name": "r",
"term": {
"application": {
"function": {"unwrap": "hydra.core.ast.Symbol"},
"argument": {
"application": {
"function": {"project": {"typeName": "hydra.core.ast.Brackets", "fieldName": "close"}},
"argument": {"variable": "brs"}}}}},
"typeScheme": {"variables": [], "body": {"literal": "string"}, "constraints": []}}],
"body": {
"let": {
"bindings": [
{
"name": "e",
"term": {
"application": {
"function": {"project": {"typeName": "hydra.core.ast.BracketExpr", "fieldName": "enclosed"}},
"argument": {"variable": "bracketExpr"}}},
"typeScheme": {"variables": [], "body": {"variable": "hydra.core.ast.Expr"}, "constraints": []}}],
"body": {
"let": {
"bindings": [
{
"name": "style",
"term": {
"application": {
"function": {"project": {"typeName": "hydra.core.ast.BracketExpr", "fieldName": "style"}},
"argument": {"variable": "bracketExpr"}}},
"typeScheme": {"variables": [], "body": {"variable": "hydra.core.ast.BlockStyle"}, "constraints": []}}],
"body": {
"let": {
"bindings": [
{
"name": "body",
"term": {"application": {"function": {"variable": "hydra.core.serialization.printExpr"}, "argument": {"variable": "e"}}},
"typeScheme": {"variables": [], "body": {"literal": "string"}, "constraints": []}}],
"body": {
"let": {
"bindings": [
{
"name": "doIndent",
"term": {
"application": {
"function": {"project": {"typeName": "hydra.core.ast.BlockStyle", "fieldName": "indent"}},
"argument": {"variable": "style"}}},
"typeScheme": {"variables": [], "body": {"optional": {"literal": "string"}}, "constraints": []}}],
"body": {
"let": {
"bindings": [
{
"name": "nlBefore",
"term": {
"application": {
"function": {"project": {"typeName": "hydra.core.ast.BlockStyle", "fieldName": "newlineBeforeContent"}},
"argument": {"variable": "style"}}},
"typeScheme": {"variables": [], "body": {"literal": "boolean"}, "constraints": []}}],
"body": {
"let": {
"bindings": [
{
"name": "nlAfter",
"term": {
"application": {
"function": {"project": {"typeName": "hydra.core.ast.BlockStyle", "fieldName": "newlineAfterContent"}},
"argument": {"variable": "style"}}},
"typeScheme": {"variables": [], "body": {"literal": "boolean"}, "constraints": []}}],
"body": {
"let": {
"bindings": [
{
"name": "ibody",
"term": {
"application": {
"function": {
"application": {
"function": {
"application": {
"function": {
"typeApplication": {
"body": {"typeApplication": {"body": {"variable": "hydra.core.lib.optionals.match"}, "type": {"literal": "string"}}},
"type": {"literal": "string"}}},
"argument": {"variable": "doIndent"}}},
"argument": {"variable": "body"}}},
"argument": {
"lambda": {
"parameter": "pre",
"domain": {"literal": "string"},
"body": {
"application": {
"function": {"application": {"function": {"variable": "hydra.core.serialization.customIndent"}, "argument": {"variable": "pre"}}},
"argument": {"variable": "body"}}}}}}},
"typeScheme": {"variables": [], "body": {"literal": "string"}, "constraints": []}}],
"body": {
"let": {
"bindings": [
{
"name": "pre",
"term": {
"application": {
"function": {
"application": {
"function": {
"application": {
"function": {"typeApplication": {"body": {"variable": "hydra.core.lib.logic.ifElse"}, "type": {"literal": "string"}}},
"argument": {"variable": "nlBefore"}}},
"argument": {"literal": {"string": "\n"}}}},
"argument": {"literal": {"string": ""}}}},
"typeScheme": {"variables": [], "body": {"literal": "string"}, "constraints": []}}],
"body": {
"let": {
"bindings": [
{
"name": "suf",
"term": {
"application": {
"function": {
"application": {
"function": {
"application": {
"function": {"typeApplication": {"body": {"variable": "hydra.core.lib.logic.ifElse"}, "type": {"literal": "string"}}},
"argument": {"variable": "nlAfter"}}},
"argument": {"literal": {"string": "\n"}}}},
"argument": {"literal": {"string": ""}}}},
"typeScheme": {"variables": [], "body": {"literal": "string"}, "constraints": []}}],
"body": {
"application": {
"function": {
"application": {
"function": {"variable": "hydra.core.lib.strings.concat2"},
"argument": {
"application": {
"function": {
"application": {
"function": {"variable": "hydra.core.lib.strings.concat2"},
"argument": {
"application": {
"function": {
"application": {
"function": {"variable": "hydra.core.lib.strings.concat2"},
"argument": {
"application": {
"function": {"application": {"function": {"variable": "hydra.core.lib.strings.concat2"}, "argument": {"variable": "l"}}},
"argument": {"variable": "pre"}}}}},
"argument": {"variable": "ibody"}}}}},
"argument": {"variable": "suf"}}}}},
"argument": {"variable": "r"}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}]}},
"argument": {"variable": "e"}}}}}}}}},
"annotation": {
"map": [
{
"key": {"variable": "description"},
"value": {
"literal": {"string": "Render an expression to a string, expanding bracket pairs, block styles, indents, and operator chains"}}}]}}}}},
{
"term": {
"name": "hydra.core.serialization.semicolonSep",
"signature": {
"typeParameters": [],
"parameters": [{"name": "arg0", "type": {"list": {"variable": "hydra.core.ast.Expr"}}, "isLazy": false}],
"result": {"type": {"variable": "hydra.core.ast.Expr"}}},
"body": {
"annotated": {
"body": {
"application": {
"function": {
"application": {"function": {"variable": "hydra.core.serialization.symbolSep"}, "argument": {"literal": {"string": ";"}}}},
"argument": {"variable": "hydra.core.serialization.inlineStyle"}}},
"annotation": {"map": [{"key": {"variable": "description"}, "value": {"literal": {"string": "Separate elements with `;` inline"}}}]}}}}},
{
"term": {
"name": "hydra.core.serialization.sep",
"signature": {
"typeParameters": [],
"parameters": [
{"name": "arg0", "type": {"variable": "hydra.core.ast.Op"}, "isLazy": false},
{"name": "arg1", "type": {"list": {"variable": "hydra.core.ast.Expr"}}, "isLazy": false}],
"result": {"type": {"variable": "hydra.core.ast.Expr"}}},
"body": {
"annotated": {
"body": {
"lambda": {
"parameter": "op",
"domain": {"variable": "hydra.core.ast.Op"},
"body": {
"lambda": {
"parameter": "els",
"domain": {"list": {"variable": "hydra.core.ast.Expr"}},
"body": {
"application": {
"function": {
"application": {
"function": {
"application": {
"function": {
"typeApplication": {
"body": {
"typeApplication": {"body": {"variable": "hydra.core.lib.optionals.match"}, "type": {"variable": "hydra.core.ast.Expr"}}},
"type": {"variable": "hydra.core.ast.Expr"}}},
"argument": {
"application": {
"function": {"typeApplication": {"body": {"variable": "hydra.core.lib.lists.head"}, "type": {"variable": "hydra.core.ast.Expr"}}},
"argument": {"variable": "els"}}}}},
"argument": {"application": {"function": {"variable": "hydra.core.serialization.cst"}, "argument": {"literal": {"string": ""}}}}}},
"argument": {
"lambda": {
"parameter": "h",
"domain": {"variable": "hydra.core.ast.Expr"},
"body": {
"application": {
"function": {
"application": {
"function": {
"application": {
"function": {
"typeApplication": {
"body": {"typeApplication": {"body": {"variable": "hydra.core.lib.lists.foldl"}, "type": {"variable": "hydra.core.ast.Expr"}}},
"type": {"variable": "hydra.core.ast.Expr"}}},
"argument": {
"lambda": {
"parameter": "acc",
"domain": {"variable": "hydra.core.ast.Expr"},
"body": {
"lambda": {
"parameter": "el",
"domain": {"variable": "hydra.core.ast.Expr"},
"body": {
"application": {
"function": {
"application": {
"function": {"application": {"function": {"variable": "hydra.core.serialization.ifx"}, "argument": {"variable": "op"}}},
"argument": {"variable": "acc"}}},
"argument": {"variable": "el"}}}}}}}}},
"argument": {"variable": "h"}}},
"argument": {
"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": "els"}}}}}}}}}}}}},
"annotation": {
"map": [
{
"key": {"variable": "description"},
"value": {
"literal": {
"string": "Combine a list of expressions into a single OpExpr chain using the given operator. Returns the empty constant for an empty list."}}}]}}}}},
{
"term": {
"name": "hydra.core.serialization.spaceSep",
"signature": {
"typeParameters": [],
"parameters": [{"name": "arg0", "type": {"list": {"variable": "hydra.core.ast.Expr"}}, "isLazy": false}],
"result": {"type": {"variable": "hydra.core.ast.Expr"}}},
"body": {
"annotated": {
"body": {
"application": {
"function": {"variable": "hydra.core.serialization.sep"},
"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": "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"}}}}]}}}},
"annotation": {
"map": [
{
"key": {"variable": "description"},
"value": {"literal": {"string": "Space-separate elements (no break between them)"}}}]}}}}},
{
"term": {
"name": "hydra.core.serialization.spaceSepAdaptive",
"signature": {
"typeParameters": [],
"parameters": [{"name": "arg0", "type": {"list": {"variable": "hydra.core.ast.Expr"}}, "isLazy": false}],
"result": {"type": {"variable": "hydra.core.ast.Expr"}}},
"body": {
"annotated": {
"body": {
"lambda": {
"parameter": "els",
"domain": {"list": {"variable": "hydra.core.ast.Expr"}},
"body": {
"application": {
"function": {
"application": {
"function": {
"application": {
"function": {"variable": "hydra.core.serialization.chooseLayout"},
"argument": {"variable": "hydra.core.serialization.maxLineWidth"}}},
"argument": {"application": {"function": {"variable": "hydra.core.serialization.spaceSep"}, "argument": {"variable": "els"}}}}},
"argument": {"application": {"function": {"variable": "hydra.core.serialization.newlineSep"}, "argument": {"variable": "els"}}}}}}},
"annotation": {
"map": [
{
"key": {"variable": "description"},
"value": {
"literal": {
"string": "Space-separate elements inline if the joined width fits, otherwise newline-separate them. Useful for long signatures, type chains, and other space-joined sequences."}}}]}}}}},
{
"term": {
"name": "hydra.core.serialization.squareBrackets",
"signature": {"typeParameters": [], "parameters": [], "result": {"type": {"variable": "hydra.core.ast.Brackets"}}},
"body": {
"annotated": {
"body": {
"record": {
"typeName": "hydra.core.ast.Brackets",
"fields": [
{"name": "open", "term": {"wrap": {"typeName": "hydra.core.ast.Symbol", "body": {"literal": {"string": "["}}}}},
{"name": "close", "term": {"wrap": {"typeName": "hydra.core.ast.Symbol", "body": {"literal": {"string": "]"}}}}}]}},
"annotation": {
"map": [
{
"key": {"variable": "description"},
"value": {"literal": {"string": "Square bracket pair `[` `]` for use with `brackets`"}}}]}}}}},
{
"term": {
"name": "hydra.core.serialization.structuralSep",
"signature": {
"typeParameters": [],
"parameters": [
{"name": "arg0", "type": {"variable": "hydra.core.ast.Op"}, "isLazy": false},
{"name": "arg1", "type": {"list": {"variable": "hydra.core.ast.Expr"}}, "isLazy": false}],
"result": {"type": {"variable": "hydra.core.ast.Expr"}}},
"body": {
"annotated": {
"body": {
"lambda": {
"parameter": "op",
"domain": {"variable": "hydra.core.ast.Op"},
"body": {
"lambda": {
"parameter": "els",
"domain": {"list": {"variable": "hydra.core.ast.Expr"}},
"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": "els"}}}}},
"argument": {"application": {"function": {"variable": "hydra.core.serialization.cst"}, "argument": {"literal": {"string": ""}}}}}},
"argument": {
"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": "els"}}}}},
"argument": {"literal": {"integer": {"int32": 1}}}}}}},
"argument": {
"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": "els"}}}}}}},
"argument": {
"inject": {
"typeName": "hydra.core.ast.Expr",
"field": {
"name": "seq",
"term": {
"record": {
"typeName": "hydra.core.ast.SeqExpr",
"fields": [{"name": "op", "term": {"variable": "op"}}, {"name": "elements", "term": {"variable": "els"}}]}}}}}}}}}}}}},
"annotation": {
"map": [
{
"key": {"variable": "description"},
"value": {
"literal": {
"string": "Like sep, but produces a SeqExpr instead of an OpExpr chain. SeqExpr is treated as structural layout and is not subject to parenthesization."}}}]}}}}},
{
"term": {
"name": "hydra.core.serialization.structuralSpaceSep",
"signature": {
"typeParameters": [],
"parameters": [{"name": "arg0", "type": {"list": {"variable": "hydra.core.ast.Expr"}}, "isLazy": false}],
"result": {"type": {"variable": "hydra.core.ast.Expr"}}},
"body": {
"annotated": {
"body": {
"application": {
"function": {"variable": "hydra.core.serialization.structuralSep"},
"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": "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"}}}}]}}}},
"annotation": {
"map": [
{
"key": {"variable": "description"},
"value": {
"literal": {
"string": "Like spaceSep, but produces a SeqExpr. Use for structural layout that should not trigger parenthesization of children."}}}]}}}}},
{
"term": {
"name": "hydra.core.serialization.suffix",
"signature": {
"typeParameters": [],
"parameters": [
{"name": "arg0", "type": {"literal": "string"}, "isLazy": false},
{"name": "arg1", "type": {"variable": "hydra.core.ast.Expr"}, "isLazy": false}],
"result": {"type": {"variable": "hydra.core.ast.Expr"}}},
"body": {
"annotated": {
"body": {
"lambda": {
"parameter": "s",
"domain": {"literal": "string"},
"body": {
"lambda": {
"parameter": "expr",
"domain": {"variable": "hydra.core.ast.Expr"},
"body": {
"let": {
"bindings": [
{
"name": "sufOp",
"term": {
"record": {
"typeName": "hydra.core.ast.Op",
"fields": [
{
"name": "symbol",
"term": {"application": {"function": {"variable": "hydra.core.serialization.sym"}, "argument": {"variable": "s"}}}},
{
"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": {"variable": "hydra.core.serialization.ifx"}, "argument": {"variable": "sufOp"}}},
"argument": {"variable": "expr"}}},
"argument": {"application": {"function": {"variable": "hydra.core.serialization.cst"}, "argument": {"literal": {"string": ""}}}}}}}}}}}},
"annotation": {
"map": [{"key": {"variable": "description"}, "value": {"literal": {"string": "Append a suffix string to an expression"}}}]}}}}},
{
"term": {
"name": "hydra.core.serialization.sym",
"signature": {
"typeParameters": [],
"parameters": [{"name": "arg0", "type": {"literal": "string"}, "isLazy": false}],
"result": {"type": {"variable": "hydra.core.ast.Symbol"}}},
"body": {
"annotated": {
"body": {
"lambda": {
"parameter": "s",
"domain": {"literal": "string"},
"body": {"wrap": {"typeName": "hydra.core.ast.Symbol", "body": {"variable": "s"}}}}},
"annotation": {"map": [{"key": {"variable": "description"}, "value": {"literal": {"string": "Construct a Symbol from a string"}}}]}}}}},
{
"term": {
"name": "hydra.core.serialization.symbolSep",
"signature": {
"typeParameters": [],
"parameters": [
{"name": "arg0", "type": {"literal": "string"}, "isLazy": false},
{"name": "arg1", "type": {"variable": "hydra.core.ast.BlockStyle"}, "isLazy": false},
{"name": "arg2", "type": {"list": {"variable": "hydra.core.ast.Expr"}}, "isLazy": false}],
"result": {"type": {"variable": "hydra.core.ast.Expr"}}},
"body": {
"annotated": {
"body": {
"lambda": {
"parameter": "symb",
"domain": {"literal": "string"},
"body": {
"lambda": {
"parameter": "style",
"domain": {"variable": "hydra.core.ast.BlockStyle"},
"body": {
"lambda": {
"parameter": "l",
"domain": {"list": {"variable": "hydra.core.ast.Expr"}},
"body": {
"let": {
"bindings": [
{
"name": "breakCount",
"term": {
"application": {
"function": {"typeApplication": {"body": {"variable": "hydra.core.lib.lists.length"}, "type": {"literal": "boolean"}}},
"argument": {
"application": {
"function": {
"application": {
"function": {"typeApplication": {"body": {"variable": "hydra.core.lib.lists.filter"}, "type": {"literal": "boolean"}}},
"argument": {"lambda": {"parameter": "x_", "domain": {"literal": "boolean"}, "body": {"variable": "x_"}}}}},
"argument": {
"list": [
{
"application": {
"function": {"project": {"typeName": "hydra.core.ast.BlockStyle", "fieldName": "newlineBeforeContent"}},
"argument": {"variable": "style"}}},
{
"application": {
"function": {"project": {"typeName": "hydra.core.ast.BlockStyle", "fieldName": "newlineAfterContent"}},
"argument": {"variable": "style"}}}]}}}}},
"typeScheme": {"variables": [], "body": {"literal": {"integer": "int32"}}, "constraints": []}}],
"body": {
"let": {
"bindings": [
{
"name": "break",
"term": {
"application": {
"function": {
"application": {
"function": {
"application": {
"function": {"typeApplication": {"body": {"variable": "hydra.core.lib.logic.ifElse"}, "type": {"variable": "hydra.core.ast.Ws"}}},
"argument": {
"application": {
"function": {
"application": {
"function": {"typeApplication": {"body": {"variable": "hydra.core.lib.equality.equal"}, "type": {"literal": {"integer": "int32"}}}},
"argument": {"variable": "breakCount"}}},
"argument": {"literal": {"integer": {"int32": 0}}}}}}},
"argument": {"inject": {"typeName": "hydra.core.ast.Ws", "field": {"name": "space", "term": "unit"}}}}},
"argument": {
"application": {
"function": {
"application": {
"function": {
"application": {
"function": {"typeApplication": {"body": {"variable": "hydra.core.lib.logic.ifElse"}, "type": {"variable": "hydra.core.ast.Ws"}}},
"argument": {
"application": {
"function": {
"application": {
"function": {"typeApplication": {"body": {"variable": "hydra.core.lib.equality.equal"}, "type": {"literal": {"integer": "int32"}}}},
"argument": {"variable": "breakCount"}}},
"argument": {"literal": {"integer": {"int32": 1}}}}}}},
"argument": {"inject": {"typeName": "hydra.core.ast.Ws", "field": {"name": "break", "term": "unit"}}}}},
"argument": {"inject": {"typeName": "hydra.core.ast.Ws", "field": {"name": "doubleBreak", "term": "unit"}}}}}}},
"typeScheme": {"variables": [], "body": {"variable": "hydra.core.ast.Ws"}, "constraints": []}}],
"body": {
"let": {
"bindings": [
{
"name": "commaOp",
"term": {
"record": {
"typeName": "hydra.core.ast.Op",
"fields": [
{
"name": "symbol",
"term": {"application": {"function": {"variable": "hydra.core.serialization.sym"}, "argument": {"variable": "symb"}}}},
{
"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": {"variable": "break"}}]}}},
{
"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": {
"typeApplication": {"body": {"variable": "hydra.core.lib.optionals.match"}, "type": {"variable": "hydra.core.ast.Expr"}}},
"type": {"variable": "hydra.core.ast.Expr"}}},
"argument": {
"application": {
"function": {"typeApplication": {"body": {"variable": "hydra.core.lib.lists.head"}, "type": {"variable": "hydra.core.ast.Expr"}}},
"argument": {"variable": "l"}}}}},
"argument": {"application": {"function": {"variable": "hydra.core.serialization.cst"}, "argument": {"literal": {"string": ""}}}}}},
"argument": {
"lambda": {
"parameter": "h",
"domain": {"variable": "hydra.core.ast.Expr"},
"body": {
"application": {
"function": {
"application": {
"function": {
"application": {
"function": {
"typeApplication": {
"body": {"typeApplication": {"body": {"variable": "hydra.core.lib.lists.foldl"}, "type": {"variable": "hydra.core.ast.Expr"}}},
"type": {"variable": "hydra.core.ast.Expr"}}},
"argument": {
"lambda": {
"parameter": "acc",
"domain": {"variable": "hydra.core.ast.Expr"},
"body": {
"lambda": {
"parameter": "el",
"domain": {"variable": "hydra.core.ast.Expr"},
"body": {
"application": {
"function": {
"application": {
"function": {"application": {"function": {"variable": "hydra.core.serialization.ifx"}, "argument": {"variable": "commaOp"}}},
"argument": {"variable": "acc"}}},
"argument": {"variable": "el"}}}}}}}}},
"argument": {"variable": "h"}}},
"argument": {
"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": "l"}}}}}}}}}}}}}}}}}}}}},
"annotation": {
"map": [
{
"key": {"variable": "description"},
"value": {
"literal": {
"string": "Separate elements with the given symbol; trailing whitespace per element is determined by the block style's newline-before/after flags (space, single break, or double break)"}}}]}}}}},
{
"term": {
"name": "hydra.core.serialization.tabIndent",
"signature": {
"typeParameters": [],
"parameters": [{"name": "arg0", "type": {"variable": "hydra.core.ast.Expr"}, "isLazy": false}],
"result": {"type": {"variable": "hydra.core.ast.Expr"}}},
"body": {
"annotated": {
"body": {
"lambda": {
"parameter": "e",
"domain": {"variable": "hydra.core.ast.Expr"},
"body": {
"inject": {
"typeName": "hydra.core.ast.Expr",
"field": {
"name": "indent",
"term": {
"record": {
"typeName": "hydra.core.ast.IndentedExpression",
"fields": [
{
"name": "style",
"term": {
"inject": {"typeName": "hydra.core.ast.IndentStyle", "field": {"name": "allLines", "term": {"literal": {"string": " "}}}}}},
{"name": "expr", "term": {"variable": "e"}}]}}}}}}},
"annotation": {
"map": [
{
"key": {"variable": "description"},
"value": {"literal": {"string": "Indent every line of an expression by four spaces"}}}]}}}}},
{
"term": {
"name": "hydra.core.serialization.tabIndentDoubleSpace",
"signature": {
"typeParameters": [],
"parameters": [{"name": "arg0", "type": {"list": {"variable": "hydra.core.ast.Expr"}}, "isLazy": false}],
"result": {"type": {"variable": "hydra.core.ast.Expr"}}},
"body": {
"annotated": {
"body": {
"lambda": {
"parameter": "exprs",
"domain": {"list": {"variable": "hydra.core.ast.Expr"}},
"body": {
"application": {
"function": {"variable": "hydra.core.serialization.tabIndent"},
"argument": {
"application": {"function": {"variable": "hydra.core.serialization.doubleNewlineSep"}, "argument": {"variable": "exprs"}}}}}}},
"annotation": {
"map": [
{
"key": {"variable": "description"},
"value": {"literal": {"string": "Tab-indent a list of expressions, separated by blank lines"}}}]}}}}},
{
"term": {
"name": "hydra.core.serialization.tabIndentSingleSpace",
"signature": {
"typeParameters": [],
"parameters": [{"name": "arg0", "type": {"list": {"variable": "hydra.core.ast.Expr"}}, "isLazy": false}],
"result": {"type": {"variable": "hydra.core.ast.Expr"}}},
"body": {
"annotated": {
"body": {
"lambda": {
"parameter": "exprs",
"domain": {"list": {"variable": "hydra.core.ast.Expr"}},
"body": {
"application": {
"function": {"variable": "hydra.core.serialization.tabIndent"},
"argument": {"application": {"function": {"variable": "hydra.core.serialization.newlineSep"}, "argument": {"variable": "exprs"}}}}}}},
"annotation": {
"map": [
{
"key": {"variable": "description"},
"value": {"literal": {"string": "Tab-indent a list of expressions, separated by single newlines"}}}]}}}}},
{
"term": {
"name": "hydra.core.serialization.unsupportedType",
"signature": {
"typeParameters": [],
"parameters": [{"name": "arg0", "type": {"literal": "string"}, "isLazy": false}],
"result": {"type": {"variable": "hydra.core.ast.Expr"}}},
"body": {
"annotated": {
"body": {
"lambda": {
"parameter": "label",
"domain": {"literal": "string"},
"body": {
"application": {
"function": {"variable": "hydra.core.serialization.cst"},
"argument": {
"application": {
"function": {
"application": {
"function": {"variable": "hydra.core.lib.strings.concat2"},
"argument": {
"application": {
"function": {"application": {"function": {"variable": "hydra.core.lib.strings.concat2"}, "argument": {"literal": {"string": "["}}}},
"argument": {"variable": "label"}}}}},
"argument": {"literal": {"string": "]"}}}}}}}},
"annotation": {
"map": [
{
"key": {"variable": "description"},
"value": {"literal": {"string": "Render a placeholder for a type the writer does not yet handle, e.g. `[bigint]`"}}}]}}}}},
{
"term": {
"name": "hydra.core.serialization.unsupportedVariant",
"signature": {
"typeParameters": [],
"parameters": [
{"name": "arg0", "type": {"literal": "string"}, "isLazy": false},
{"name": "arg1", "type": {"literal": "string"}, "isLazy": false}],
"result": {"type": {"variable": "hydra.core.ast.Expr"}}},
"body": {
"annotated": {
"body": {
"lambda": {
"parameter": "label",
"domain": {"literal": "string"},
"body": {
"lambda": {
"parameter": "obj",
"domain": {"literal": "string"},
"body": {
"application": {
"function": {"variable": "hydra.core.serialization.cst"},
"argument": {
"application": {
"function": {
"application": {
"function": {"variable": "hydra.core.lib.strings.concat2"},
"argument": {
"application": {
"function": {
"application": {
"function": {"variable": "hydra.core.lib.strings.concat2"},
"argument": {
"application": {
"function": {
"application": {
"function": {"variable": "hydra.core.lib.strings.concat2"},
"argument": {
"application": {
"function": {
"application": {"function": {"variable": "hydra.core.lib.strings.concat2"}, "argument": {"literal": {"string": "[unsupported "}}}},
"argument": {"variable": "label"}}}}},
"argument": {"literal": {"string": ": "}}}}}},
"argument": {"application": {"function": {"variable": "hydra.core.lib.literals.printString"}, "argument": {"variable": "obj"}}}}}}},
"argument": {"literal": {"string": "]"}}}}}}}}}},
"annotation": {
"map": [
{
"key": {"variable": "description"},
"value": {
"literal": {"string": "Render a placeholder for an unsupported variant, including a string representation of the offending value"}}}]}}}}},
{
"term": {
"name": "hydra.core.serialization.withComma",
"signature": {
"typeParameters": [],
"parameters": [{"name": "arg0", "type": {"variable": "hydra.core.ast.Expr"}, "isLazy": false}],
"result": {"type": {"variable": "hydra.core.ast.Expr"}}},
"body": {
"annotated": {
"body": {
"lambda": {
"parameter": "e",
"domain": {"variable": "hydra.core.ast.Expr"},
"body": {
"application": {
"function": {"variable": "hydra.core.serialization.noSep"},
"argument": {
"list": [
{"variable": "e"},
{"application": {"function": {"variable": "hydra.core.serialization.cst"}, "argument": {"literal": {"string": ","}}}}]}}}}},
"annotation": {
"map": [{"key": {"variable": "description"}, "value": {"literal": {"string": "Append a trailing comma to an expression"}}}]}}}}},
{
"term": {
"name": "hydra.core.serialization.withSemi",
"signature": {
"typeParameters": [],
"parameters": [{"name": "arg0", "type": {"variable": "hydra.core.ast.Expr"}, "isLazy": false}],
"result": {"type": {"variable": "hydra.core.ast.Expr"}}},
"body": {
"annotated": {
"body": {
"lambda": {
"parameter": "e",
"domain": {"variable": "hydra.core.ast.Expr"},
"body": {
"application": {
"function": {"variable": "hydra.core.serialization.noSep"},
"argument": {
"list": [
{"variable": "e"},
{"application": {"function": {"variable": "hydra.core.serialization.cst"}, "argument": {"literal": {"string": ";"}}}}]}}}}},
"annotation": {
"map": [{"key": {"variable": "description"}, "value": {"literal": {"string": "Append a trailing semicolon to an expression"}}}]}}}}}]}