hydra-kernel-0.18.1: hydra-kernel-json/hydra/core/formatting.json
{
"name": "hydra.core.formatting",
"metadata": {"description": "String formatting types and functions.", "comments": [], "seeAlso": [], "provisions": []},
"dependencies": [
{"module": "hydra.core.lib.chars"},
{"module": "hydra.core.lib.equality"},
{"module": "hydra.core.lib.lists"},
{"module": "hydra.core.lib.logic"},
{"module": "hydra.core.lib.maps"},
{"module": "hydra.core.lib.math"},
{"module": "hydra.core.lib.optionals"},
{"module": "hydra.core.lib.ordering"},
{"module": "hydra.core.lib.pairs"},
{"module": "hydra.core.lib.sets"},
{"module": "hydra.core.lib.strings"},
{"module": "hydra.core.util"}],
"definitions": [
{
"term": {
"name": "hydra.core.formatting.capitalize",
"signature": {
"typeParameters": [],
"parameters": [{"name": "arg0", "type": {"literal": "string"}, "isLazy": false}],
"result": {"type": {"literal": "string"}}},
"body": {
"annotated": {
"body": {
"application": {
"function": {"variable": "hydra.core.formatting.mapFirstLetter"},
"argument": {"variable": "hydra.core.lib.strings.toUpper"}}},
"annotation": {
"map": [{"key": {"variable": "description"}, "value": {"literal": {"string": "Capitalize the first letter of a string"}}}]}}}}},
{
"term": {
"name": "hydra.core.formatting.convertCase",
"signature": {
"typeParameters": [],
"parameters": [
{"name": "arg0", "type": {"variable": "hydra.core.util.CaseConvention"}, "isLazy": false},
{"name": "arg1", "type": {"variable": "hydra.core.util.CaseConvention"}, "isLazy": false},
{"name": "arg2", "type": {"literal": "string"}, "isLazy": false}],
"result": {"type": {"literal": "string"}}},
"body": {
"annotated": {
"body": {
"lambda": {
"parameter": "from",
"domain": {"variable": "hydra.core.util.CaseConvention"},
"body": {
"lambda": {
"parameter": "to",
"domain": {"variable": "hydra.core.util.CaseConvention"},
"body": {
"lambda": {
"parameter": "original",
"domain": {"literal": "string"},
"body": {
"let": {
"bindings": [
{
"name": "parts",
"term": {
"let": {
"bindings": [
{
"name": "byCaps",
"term": {
"let": {
"bindings": [
{
"name": "splitOnUppercase",
"term": {
"lambda": {
"parameter": "acc",
"domain": {"list": {"list": {"literal": {"integer": "int32"}}}},
"body": {
"lambda": {
"parameter": "c",
"domain": {"literal": {"integer": "int32"}},
"body": {
"application": {
"function": {
"application": {
"function": {
"typeApplication": {"body": {"variable": "hydra.core.lib.lists.concat2"}, "type": {"list": {"literal": {"integer": "int32"}}}}},
"argument": {
"application": {
"function": {
"application": {
"function": {
"application": {
"function": {
"typeApplication": {"body": {"variable": "hydra.core.lib.logic.ifElse"}, "type": {"list": {"list": {"literal": {"integer": "int32"}}}}}},
"argument": {"application": {"function": {"variable": "hydra.core.lib.chars.isUpper"}, "argument": {"variable": "c"}}}}},
"argument": {"list": [{"typeApplication": {"body": {"list": []}, "type": {"literal": {"integer": "int32"}}}}]}}},
"argument": {"typeApplication": {"body": {"list": []}, "type": {"list": {"literal": {"integer": "int32"}}}}}}}}},
"argument": {
"application": {
"function": {
"application": {
"function": {
"typeApplication": {
"body": {"variable": "hydra.core.lib.optionals.withDefault"},
"type": {"list": {"list": {"literal": {"integer": "int32"}}}}}},
"argument": {"variable": "acc"}}},
"argument": {
"application": {
"function": {
"application": {
"function": {
"typeApplication": {
"body": {
"typeApplication": {
"body": {"variable": "hydra.core.lib.optionals.map"},
"type": {
"pair": {"first": {"list": {"literal": {"integer": "int32"}}}, "second": {"list": {"list": {"literal": {"integer": "int32"}}}}}}}},
"type": {"list": {"list": {"literal": {"integer": "int32"}}}}}},
"argument": {
"lambda": {
"parameter": "uc",
"domain": {
"pair": {"first": {"list": {"literal": {"integer": "int32"}}}, "second": {"list": {"list": {"literal": {"integer": "int32"}}}}}},
"body": {
"application": {
"function": {
"application": {
"function": {
"typeApplication": {"body": {"variable": "hydra.core.lib.lists.cons"}, "type": {"list": {"literal": {"integer": "int32"}}}}},
"argument": {
"application": {
"function": {
"application": {
"function": {"typeApplication": {"body": {"variable": "hydra.core.lib.lists.cons"}, "type": {"literal": {"integer": "int32"}}}},
"argument": {"variable": "c"}}},
"argument": {
"application": {
"function": {
"typeApplication": {
"body": {
"typeApplication": {"body": {"variable": "hydra.core.lib.pairs.first"}, "type": {"list": {"literal": {"integer": "int32"}}}}},
"type": {"list": {"list": {"literal": {"integer": "int32"}}}}}},
"argument": {"variable": "uc"}}}}}}},
"argument": {
"application": {
"function": {
"typeApplication": {
"body": {
"typeApplication": {"body": {"variable": "hydra.core.lib.pairs.second"}, "type": {"list": {"literal": {"integer": "int32"}}}}},
"type": {"list": {"list": {"literal": {"integer": "int32"}}}}}},
"argument": {"variable": "uc"}}}}}}}}},
"argument": {
"application": {
"function": {
"typeApplication": {"body": {"variable": "hydra.core.lib.lists.uncons"}, "type": {"list": {"literal": {"integer": "int32"}}}}},
"argument": {"variable": "acc"}}}}}}}}}}}}},
"typeScheme": {
"variables": [],
"body": {
"function": {
"domain": {"list": {"list": {"literal": {"integer": "int32"}}}},
"codomain": {
"function": {"domain": {"literal": {"integer": "int32"}}, "codomain": {"list": {"list": {"literal": {"integer": "int32"}}}}}}}},
"constraints": []}}],
"body": {
"application": {
"function": {
"application": {
"function": {
"typeApplication": {
"body": {
"typeApplication": {"body": {"variable": "hydra.core.lib.lists.map"}, "type": {"list": {"literal": {"integer": "int32"}}}}},
"type": {"literal": "string"}}},
"argument": {"variable": "hydra.core.lib.strings.fromList"}}},
"argument": {
"application": {
"function": {
"application": {
"function": {
"application": {
"function": {
"typeApplication": {
"body": {
"typeApplication": {"body": {"variable": "hydra.core.lib.lists.foldl"}, "type": {"list": {"list": {"literal": {"integer": "int32"}}}}}},
"type": {"literal": {"integer": "int32"}}}},
"argument": {"variable": "splitOnUppercase"}}},
"argument": {"list": [{"typeApplication": {"body": {"list": []}, "type": {"literal": {"integer": "int32"}}}}]}}},
"argument": {
"application": {
"function": {"typeApplication": {"body": {"variable": "hydra.core.lib.lists.reverse"}, "type": {"literal": {"integer": "int32"}}}},
"argument": {
"application": {
"function": {"variable": "hydra.core.lib.strings.toList"},
"argument": {"application": {"function": {"variable": "hydra.core.formatting.decapitalize"}, "argument": {"variable": "original"}}}}}}}}}}}}},
"typeScheme": {"variables": [], "body": {"list": {"literal": "string"}}, "constraints": []}},
{
"name": "byUnderscores",
"term": {
"application": {
"function": {"application": {"function": {"variable": "hydra.core.lib.strings.splitOn"}, "argument": {"literal": {"string": "_"}}}},
"argument": {"variable": "original"}}},
"typeScheme": {"variables": [], "body": {"list": {"literal": "string"}}, "constraints": []}},
{
"name": "byDashes",
"term": {
"application": {
"function": {"application": {"function": {"variable": "hydra.core.lib.strings.splitOn"}, "argument": {"literal": {"string": "-"}}}},
"argument": {"variable": "original"}}},
"typeScheme": {"variables": [], "body": {"list": {"literal": "string"}}, "constraints": []}}],
"body": {
"application": {
"function": {
"cases": {
"typeName": "hydra.core.util.CaseConvention",
"cases": [
{"name": "camel", "handler": {"lambda": {"parameter": "_", "domain": "unit", "body": {"variable": "byCaps"}}}},
{"name": "pascal", "handler": {"lambda": {"parameter": "_", "domain": "unit", "body": {"variable": "byCaps"}}}},
{
"name": "lowerSnake",
"handler": {"lambda": {"parameter": "_", "domain": "unit", "body": {"variable": "byUnderscores"}}}},
{
"name": "upperSnake",
"handler": {"lambda": {"parameter": "_", "domain": "unit", "body": {"variable": "byUnderscores"}}}},
{"name": "upperDashed", "handler": {"lambda": {"parameter": "_", "domain": "unit", "body": {"variable": "byDashes"}}}}]}},
"argument": {"variable": "from"}}}}},
"typeScheme": {"variables": [], "body": {"list": {"literal": "string"}}, "constraints": []}}],
"body": {
"application": {
"function": {
"cases": {
"typeName": "hydra.core.util.CaseConvention",
"cases": [
{
"name": "camel",
"handler": {
"lambda": {
"parameter": "_",
"domain": "unit",
"body": {
"application": {
"function": {"variable": "hydra.core.formatting.decapitalize"},
"argument": {
"application": {
"function": {"variable": "hydra.core.lib.strings.concat"},
"argument": {
"application": {
"function": {
"application": {
"function": {
"typeApplication": {
"body": {"typeApplication": {"body": {"variable": "hydra.core.lib.lists.map"}, "type": {"literal": "string"}}},
"type": {"literal": "string"}}},
"argument": {
"lambda": {
"parameter": "arg_",
"domain": {"literal": "string"},
"body": {
"application": {
"function": {"variable": "hydra.core.formatting.capitalize"},
"argument": {"application": {"function": {"variable": "hydra.core.lib.strings.toLower"}, "argument": {"variable": "arg_"}}}}}}}}},
"argument": {"variable": "parts"}}}}}}}}}},
{
"name": "pascal",
"handler": {
"lambda": {
"parameter": "_",
"domain": "unit",
"body": {
"application": {
"function": {"variable": "hydra.core.lib.strings.concat"},
"argument": {
"application": {
"function": {
"application": {
"function": {
"typeApplication": {
"body": {"typeApplication": {"body": {"variable": "hydra.core.lib.lists.map"}, "type": {"literal": "string"}}},
"type": {"literal": "string"}}},
"argument": {
"lambda": {
"parameter": "arg_",
"domain": {"literal": "string"},
"body": {
"application": {
"function": {"variable": "hydra.core.formatting.capitalize"},
"argument": {"application": {"function": {"variable": "hydra.core.lib.strings.toLower"}, "argument": {"variable": "arg_"}}}}}}}}},
"argument": {"variable": "parts"}}}}}}}},
{
"name": "lowerSnake",
"handler": {
"lambda": {
"parameter": "_",
"domain": "unit",
"body": {
"application": {
"function": {"application": {"function": {"variable": "hydra.core.lib.strings.join"}, "argument": {"literal": {"string": "_"}}}},
"argument": {
"application": {
"function": {
"application": {
"function": {
"typeApplication": {
"body": {"typeApplication": {"body": {"variable": "hydra.core.lib.lists.map"}, "type": {"literal": "string"}}},
"type": {"literal": "string"}}},
"argument": {"variable": "hydra.core.lib.strings.toLower"}}},
"argument": {"variable": "parts"}}}}}}}},
{
"name": "upperSnake",
"handler": {
"lambda": {
"parameter": "_",
"domain": "unit",
"body": {
"application": {
"function": {"application": {"function": {"variable": "hydra.core.lib.strings.join"}, "argument": {"literal": {"string": "_"}}}},
"argument": {
"application": {
"function": {
"application": {
"function": {
"typeApplication": {
"body": {"typeApplication": {"body": {"variable": "hydra.core.lib.lists.map"}, "type": {"literal": "string"}}},
"type": {"literal": "string"}}},
"argument": {"variable": "hydra.core.lib.strings.toUpper"}}},
"argument": {"variable": "parts"}}}}}}}},
{
"name": "upperDashed",
"handler": {
"lambda": {
"parameter": "_",
"domain": "unit",
"body": {
"application": {
"function": {"application": {"function": {"variable": "hydra.core.lib.strings.join"}, "argument": {"literal": {"string": "-"}}}},
"argument": {
"application": {
"function": {
"application": {
"function": {
"typeApplication": {
"body": {"typeApplication": {"body": {"variable": "hydra.core.lib.lists.map"}, "type": {"literal": "string"}}},
"type": {"literal": "string"}}},
"argument": {"variable": "hydra.core.lib.strings.toUpper"}}},
"argument": {"variable": "parts"}}}}}}}}]}},
"argument": {"variable": "to"}}}}}}}}}}},
"annotation": {
"map": [
{
"key": {"variable": "description"},
"value": {"literal": {"string": "Convert a string from one case convention to another"}}}]}}}}},
{
"term": {
"name": "hydra.core.formatting.convertCaseCamelOrUnderscoreToLowerSnake",
"signature": {
"typeParameters": [],
"parameters": [{"name": "arg0", "type": {"literal": "string"}, "isLazy": false}],
"result": {"type": {"literal": "string"}}},
"body": {
"annotated": {
"body": {
"lambda": {
"parameter": "s",
"domain": {"literal": "string"},
"body": {
"let": {
"bindings": [
{
"name": "parts",
"term": {
"application": {
"function": {"application": {"function": {"variable": "hydra.core.lib.strings.splitOn"}, "argument": {"literal": {"string": "_"}}}},
"argument": {"variable": "s"}}},
"typeScheme": {"variables": [], "body": {"list": {"literal": "string"}}, "constraints": []}}],
"body": {
"let": {
"bindings": [
{
"name": "snakeParts",
"term": {
"application": {
"function": {
"application": {
"function": {
"typeApplication": {
"body": {"typeApplication": {"body": {"variable": "hydra.core.lib.lists.map"}, "type": {"literal": "string"}}},
"type": {"literal": "string"}}},
"argument": {
"lambda": {
"parameter": "p",
"domain": {"literal": "string"},
"body": {
"application": {"function": {"variable": "hydra.core.formatting.convertCaseCamelToLowerSnake"}, "argument": {"variable": "p"}}}}}}},
"argument": {"variable": "parts"}}},
"typeScheme": {"variables": [], "body": {"list": {"literal": "string"}}, "constraints": []}}],
"body": {
"application": {
"function": {"application": {"function": {"variable": "hydra.core.lib.strings.join"}, "argument": {"literal": {"string": "_"}}}},
"argument": {"variable": "snakeParts"}}}}}}}}},
"annotation": {
"map": [
{
"key": {"variable": "description"},
"value": {
"literal": {
"string": "Convert a string from camel case (possibly with underscores) to lower snake case. Splits on underscores first, then converts each part from camel case."}}}]}}}}},
{
"term": {
"name": "hydra.core.formatting.convertCaseCamelToLowerSnake",
"signature": {
"typeParameters": [],
"parameters": [{"name": "arg0", "type": {"literal": "string"}, "isLazy": false}],
"result": {"type": {"literal": "string"}}},
"body": {
"annotated": {
"body": {
"application": {
"function": {
"application": {
"function": {"variable": "hydra.core.formatting.convertCase"},
"argument": {"inject": {"typeName": "hydra.core.util.CaseConvention", "field": {"name": "camel", "term": "unit"}}}}},
"argument": {"inject": {"typeName": "hydra.core.util.CaseConvention", "field": {"name": "lowerSnake", "term": "unit"}}}}},
"annotation": {
"map": [
{
"key": {"variable": "description"},
"value": {"literal": {"string": "Convert a string from camel case to lower snake case"}}}]}}}}},
{
"term": {
"name": "hydra.core.formatting.convertCaseCamelToUpperSnake",
"signature": {
"typeParameters": [],
"parameters": [{"name": "arg0", "type": {"literal": "string"}, "isLazy": false}],
"result": {"type": {"literal": "string"}}},
"body": {
"annotated": {
"body": {
"application": {
"function": {
"application": {
"function": {"variable": "hydra.core.formatting.convertCase"},
"argument": {"inject": {"typeName": "hydra.core.util.CaseConvention", "field": {"name": "camel", "term": "unit"}}}}},
"argument": {"inject": {"typeName": "hydra.core.util.CaseConvention", "field": {"name": "upperSnake", "term": "unit"}}}}},
"annotation": {
"map": [
{
"key": {"variable": "description"},
"value": {"literal": {"string": "Convert a string from camel case to upper snake case"}}}]}}}}},
{
"term": {
"name": "hydra.core.formatting.convertCasePascalToUpperSnake",
"signature": {
"typeParameters": [],
"parameters": [{"name": "arg0", "type": {"literal": "string"}, "isLazy": false}],
"result": {"type": {"literal": "string"}}},
"body": {
"annotated": {
"body": {
"application": {
"function": {
"application": {
"function": {"variable": "hydra.core.formatting.convertCase"},
"argument": {"inject": {"typeName": "hydra.core.util.CaseConvention", "field": {"name": "pascal", "term": "unit"}}}}},
"argument": {"inject": {"typeName": "hydra.core.util.CaseConvention", "field": {"name": "upperSnake", "term": "unit"}}}}},
"annotation": {
"map": [
{
"key": {"variable": "description"},
"value": {"literal": {"string": "Convert a string from pascal case to upper snake case"}}}]}}}}},
{
"term": {
"name": "hydra.core.formatting.decapitalize",
"signature": {
"typeParameters": [],
"parameters": [{"name": "arg0", "type": {"literal": "string"}, "isLazy": false}],
"result": {"type": {"literal": "string"}}},
"body": {
"annotated": {
"body": {
"application": {
"function": {"variable": "hydra.core.formatting.mapFirstLetter"},
"argument": {"variable": "hydra.core.lib.strings.toLower"}}},
"annotation": {
"map": [{"key": {"variable": "description"}, "value": {"literal": {"string": "Decapitalize the first letter of a string"}}}]}}}}},
{
"term": {
"name": "hydra.core.formatting.escapeWithUnderscore",
"signature": {
"typeParameters": [],
"parameters": [
{"name": "arg0", "type": {"set": {"literal": "string"}}, "isLazy": false},
{"name": "arg1", "type": {"literal": "string"}, "isLazy": false}],
"result": {"type": {"literal": "string"}}},
"body": {
"annotated": {
"body": {
"lambda": {
"parameter": "reserved",
"domain": {"set": {"literal": "string"}},
"body": {
"lambda": {
"parameter": "s",
"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.sets.member"}, "type": {"literal": "string"}}},
"argument": {"variable": "s"}}},
"argument": {"variable": "reserved"}}}}},
"argument": {
"application": {
"function": {"application": {"function": {"variable": "hydra.core.lib.strings.concat2"}, "argument": {"variable": "s"}}},
"argument": {"literal": {"string": "_"}}}}}},
"argument": {"variable": "s"}}}}}}},
"annotation": {
"map": [
{
"key": {"variable": "description"},
"value": {"literal": {"string": "Escape reserved words by appending an underscore"}}}]}}}}},
{
"term": {
"name": "hydra.core.formatting.indentLines",
"signature": {
"typeParameters": [],
"parameters": [{"name": "arg0", "type": {"literal": "string"}, "isLazy": false}],
"result": {"type": {"literal": "string"}}},
"body": {
"annotated": {
"body": {
"lambda": {
"parameter": "s",
"domain": {"literal": "string"},
"body": {
"let": {
"bindings": [
{
"name": "indent",
"term": {
"lambda": {
"parameter": "l",
"domain": {"literal": "string"},
"body": {
"application": {
"function": {
"application": {"function": {"variable": "hydra.core.lib.strings.concat2"}, "argument": {"literal": {"string": " "}}}},
"argument": {"variable": "l"}}}}},
"typeScheme": {
"variables": [],
"body": {"function": {"domain": {"literal": "string"}, "codomain": {"literal": "string"}}},
"constraints": []}}],
"body": {
"application": {
"function": {"variable": "hydra.core.formatting.unlines"},
"argument": {
"application": {
"function": {
"application": {
"function": {
"typeApplication": {
"body": {"typeApplication": {"body": {"variable": "hydra.core.lib.lists.map"}, "type": {"literal": "string"}}},
"type": {"literal": "string"}}},
"argument": {"variable": "indent"}}},
"argument": {"application": {"function": {"variable": "hydra.core.formatting.lines"}, "argument": {"variable": "s"}}}}}}}}}}},
"annotation": {
"map": [
{"key": {"variable": "description"}, "value": {"literal": {"string": "Indent each line of a string with four spaces"}}}]}}}}},
{
"term": {
"name": "hydra.core.formatting.javaStyleComment",
"signature": {
"typeParameters": [],
"parameters": [{"name": "arg0", "type": {"literal": "string"}, "isLazy": false}],
"result": {"type": {"literal": "string"}}},
"body": {
"annotated": {
"body": {
"lambda": {
"parameter": "s",
"domain": {"literal": "string"},
"body": {
"application": {
"function": {
"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": "/**\n"}}}},
"argument": {"literal": {"string": " * "}}}}}},
"argument": {"variable": "s"}}}}},
"argument": {"literal": {"string": "\n */"}}}}}},
"annotation": {
"map": [
{"key": {"variable": "description"}, "value": {"literal": {"string": "Format a string as a Java-style block comment"}}}]}}}}},
{
"term": {
"name": "hydra.core.formatting.lines",
"signature": {
"typeParameters": [],
"parameters": [{"name": "arg0", "type": {"literal": "string"}, "isLazy": false}],
"result": {"type": {"list": {"literal": "string"}}}},
"body": {
"annotated": {
"body": {
"lambda": {
"parameter": "s",
"domain": {"literal": "string"},
"body": {
"application": {
"function": {
"application": {
"function": {
"application": {
"function": {"typeApplication": {"body": {"variable": "hydra.core.lib.logic.ifElse"}, "type": {"list": {"literal": "string"}}}},
"argument": {"application": {"function": {"variable": "hydra.core.lib.strings.isEmpty"}, "argument": {"variable": "s"}}}}},
"argument": {"typeApplication": {"body": {"list": []}, "type": {"literal": "string"}}}}},
"argument": {
"let": {
"bindings": [
{
"name": "parts",
"term": {
"application": {
"function": {"application": {"function": {"variable": "hydra.core.lib.strings.splitOn"}, "argument": {"literal": {"string": "\n"}}}},
"argument": {"variable": "s"}}},
"typeScheme": {"variables": [], "body": {"list": {"literal": "string"}}, "constraints": []}}],
"body": {
"application": {
"function": {
"application": {
"function": {
"typeApplication": {"body": {"variable": "hydra.core.lib.optionals.withDefault"}, "type": {"list": {"literal": "string"}}}},
"argument": {"variable": "parts"}}},
"argument": {
"application": {
"function": {
"application": {
"function": {
"typeApplication": {
"body": {"typeApplication": {"body": {"variable": "hydra.core.lib.optionals.map"}, "type": {"literal": "string"}}},
"type": {"list": {"literal": "string"}}}},
"argument": {
"lambda": {
"parameter": "lst",
"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": {"variable": "hydra.core.lib.strings.isEmpty"}, "argument": {"variable": "lst"}}}}},
"argument": {
"application": {
"function": {
"application": {
"function": {
"typeApplication": {"body": {"variable": "hydra.core.lib.optionals.withDefault"}, "type": {"list": {"literal": "string"}}}},
"argument": {"variable": "parts"}}},
"argument": {
"application": {
"function": {"typeApplication": {"body": {"variable": "hydra.core.lib.lists.init"}, "type": {"literal": "string"}}},
"argument": {"variable": "parts"}}}}}}},
"argument": {"variable": "parts"}}}}}}},
"argument": {
"application": {
"function": {"typeApplication": {"body": {"variable": "hydra.core.lib.lists.last"}, "type": {"literal": "string"}}},
"argument": {"variable": "parts"}}}}}}}}}}}}},
"annotation": {
"map": [
{
"key": {"variable": "description"},
"value": {
"literal": {
"string": "Split a string into lines on newline (U+000A); a trailing newline is consumed without producing an empty trailing element, and the empty string yields the empty list."}}}]}}}}},
{
"term": {
"name": "hydra.core.formatting.mapFirstLetter",
"signature": {
"typeParameters": [],
"parameters": [
{
"name": "arg0",
"type": {"function": {"domain": {"literal": "string"}, "codomain": {"literal": "string"}}},
"isLazy": false},
{"name": "arg1", "type": {"literal": "string"}, "isLazy": false}],
"result": {"type": {"literal": "string"}}},
"body": {
"annotated": {
"body": {
"lambda": {
"parameter": "mapping",
"domain": {"function": {"domain": {"literal": "string"}, "codomain": {"literal": "string"}}},
"body": {
"lambda": {
"parameter": "s",
"domain": {"literal": "string"},
"body": {
"application": {
"function": {
"application": {
"function": {
"application": {
"function": {"typeApplication": {"body": {"variable": "hydra.core.lib.logic.ifElse"}, "type": {"literal": "string"}}},
"argument": {"application": {"function": {"variable": "hydra.core.lib.strings.isEmpty"}, "argument": {"variable": "s"}}}}},
"argument": {"variable": "s"}}},
"argument": {
"let": {
"bindings": [
{
"name": "list",
"term": {"application": {"function": {"variable": "hydra.core.lib.strings.toList"}, "argument": {"variable": "s"}}},
"typeScheme": {"variables": [], "body": {"list": {"literal": {"integer": "int32"}}}, "constraints": []}}],
"body": {
"application": {
"function": {
"application": {
"function": {"typeApplication": {"body": {"variable": "hydra.core.lib.optionals.withDefault"}, "type": {"literal": "string"}}},
"argument": {"variable": "s"}}},
"argument": {
"application": {
"function": {
"application": {
"function": {
"typeApplication": {
"body": {
"typeApplication": {
"body": {"variable": "hydra.core.lib.optionals.map"},
"type": {"pair": {"first": {"literal": {"integer": "int32"}}, "second": {"list": {"literal": {"integer": "int32"}}}}}}},
"type": {"literal": "string"}}},
"argument": {
"lambda": {
"parameter": "uc",
"domain": {"pair": {"first": {"literal": {"integer": "int32"}}, "second": {"list": {"literal": {"integer": "int32"}}}}},
"body": {
"let": {
"bindings": [
{
"name": "firstLetter",
"term": {
"application": {
"function": {"variable": "mapping"},
"argument": {
"application": {
"function": {"variable": "hydra.core.lib.strings.fromList"},
"argument": {
"application": {
"function": {"typeApplication": {"body": {"variable": "hydra.core.lib.lists.singleton"}, "type": {"literal": {"integer": "int32"}}}},
"argument": {
"application": {
"function": {
"typeApplication": {
"body": {"typeApplication": {"body": {"variable": "hydra.core.lib.pairs.first"}, "type": {"literal": {"integer": "int32"}}}},
"type": {"list": {"literal": {"integer": "int32"}}}}},
"argument": {"variable": "uc"}}}}}}}}},
"typeScheme": {"variables": [], "body": {"literal": "string"}, "constraints": []}}],
"body": {
"application": {
"function": {"application": {"function": {"variable": "hydra.core.lib.strings.concat2"}, "argument": {"variable": "firstLetter"}}},
"argument": {
"application": {
"function": {"variable": "hydra.core.lib.strings.fromList"},
"argument": {
"application": {
"function": {
"typeApplication": {
"body": {"typeApplication": {"body": {"variable": "hydra.core.lib.pairs.second"}, "type": {"literal": {"integer": "int32"}}}},
"type": {"list": {"literal": {"integer": "int32"}}}}},
"argument": {"variable": "uc"}}}}}}}}}}}}},
"argument": {
"application": {
"function": {"typeApplication": {"body": {"variable": "hydra.core.lib.lists.uncons"}, "type": {"literal": {"integer": "int32"}}}},
"argument": {"variable": "list"}}}}}}}}}}}}}}},
"annotation": {
"map": [
{
"key": {"variable": "description"},
"value": {"literal": {"string": "A helper which maps the first letter of a string to another string"}}}]}}}}},
{
"term": {
"name": "hydra.core.formatting.nonAlnumToUnderscores",
"signature": {
"typeParameters": [],
"parameters": [{"name": "arg0", "type": {"literal": "string"}, "isLazy": false}],
"result": {"type": {"literal": "string"}}},
"body": {
"annotated": {
"body": {
"lambda": {
"parameter": "input",
"domain": {"literal": "string"},
"body": {
"let": {
"bindings": [
{
"name": "isAlnum",
"term": {
"lambda": {
"parameter": "c",
"domain": {"literal": {"integer": "int32"}},
"body": {
"application": {
"function": {
"application": {
"function": {"variable": "hydra.core.lib.logic.or"},
"argument": {
"application": {
"function": {
"application": {
"function": {"variable": "hydra.core.lib.logic.and"},
"argument": {
"application": {
"function": {
"application": {
"function": {"typeApplication": {"body": {"variable": "hydra.core.lib.ordering.gte"}, "type": {"literal": {"integer": "int32"}}}},
"argument": {"variable": "c"}}},
"argument": {"literal": {"integer": {"int32": 65}}}}}}},
"argument": {
"application": {
"function": {
"application": {
"function": {"typeApplication": {"body": {"variable": "hydra.core.lib.ordering.lte"}, "type": {"literal": {"integer": "int32"}}}},
"argument": {"variable": "c"}}},
"argument": {"literal": {"integer": {"int32": 90}}}}}}}}},
"argument": {
"application": {
"function": {
"application": {
"function": {"variable": "hydra.core.lib.logic.or"},
"argument": {
"application": {
"function": {
"application": {
"function": {"variable": "hydra.core.lib.logic.and"},
"argument": {
"application": {
"function": {
"application": {
"function": {"typeApplication": {"body": {"variable": "hydra.core.lib.ordering.gte"}, "type": {"literal": {"integer": "int32"}}}},
"argument": {"variable": "c"}}},
"argument": {"literal": {"integer": {"int32": 97}}}}}}},
"argument": {
"application": {
"function": {
"application": {
"function": {"typeApplication": {"body": {"variable": "hydra.core.lib.ordering.lte"}, "type": {"literal": {"integer": "int32"}}}},
"argument": {"variable": "c"}}},
"argument": {"literal": {"integer": {"int32": 122}}}}}}}}},
"argument": {
"application": {
"function": {
"application": {
"function": {"variable": "hydra.core.lib.logic.and"},
"argument": {
"application": {
"function": {
"application": {
"function": {"typeApplication": {"body": {"variable": "hydra.core.lib.ordering.gte"}, "type": {"literal": {"integer": "int32"}}}},
"argument": {"variable": "c"}}},
"argument": {"literal": {"integer": {"int32": 48}}}}}}},
"argument": {
"application": {
"function": {
"application": {
"function": {"typeApplication": {"body": {"variable": "hydra.core.lib.ordering.lte"}, "type": {"literal": {"integer": "int32"}}}},
"argument": {"variable": "c"}}},
"argument": {"literal": {"integer": {"int32": 57}}}}}}}}}}}}},
"typeScheme": {
"variables": [],
"body": {"function": {"domain": {"literal": {"integer": "int32"}}, "codomain": {"literal": "boolean"}}},
"constraints": []}}],
"body": {
"let": {
"bindings": [
{
"name": "replace",
"term": {
"lambda": {
"parameter": "p",
"domain": {"pair": {"first": {"list": {"literal": {"integer": "int32"}}}, "second": {"literal": "boolean"}}},
"body": {
"lambda": {
"parameter": "c",
"domain": {"literal": {"integer": "int32"}},
"body": {
"let": {
"bindings": [
{
"name": "s",
"term": {
"application": {
"function": {
"typeApplication": {
"body": {
"typeApplication": {"body": {"variable": "hydra.core.lib.pairs.first"}, "type": {"list": {"literal": {"integer": "int32"}}}}},
"type": {"literal": "boolean"}}},
"argument": {"variable": "p"}}},
"typeScheme": {"variables": [], "body": {"list": {"literal": {"integer": "int32"}}}, "constraints": []}}],
"body": {
"let": {
"bindings": [
{
"name": "b",
"term": {
"application": {
"function": {
"typeApplication": {
"body": {
"typeApplication": {"body": {"variable": "hydra.core.lib.pairs.second"}, "type": {"list": {"literal": {"integer": "int32"}}}}},
"type": {"literal": "boolean"}}},
"argument": {"variable": "p"}}},
"typeScheme": {"variables": [], "body": {"literal": "boolean"}, "constraints": []}}],
"body": {
"application": {
"function": {
"application": {
"function": {
"application": {
"function": {
"typeApplication": {
"body": {"variable": "hydra.core.lib.logic.ifElse"},
"type": {"pair": {"first": {"list": {"literal": {"integer": "int32"}}}, "second": {"literal": "boolean"}}}}},
"argument": {"application": {"function": {"variable": "isAlnum"}, "argument": {"variable": "c"}}}}},
"argument": {
"typeApplication": {
"body": {
"typeApplication": {
"body": {
"pair": {
"first": {
"application": {
"function": {
"application": {
"function": {"typeApplication": {"body": {"variable": "hydra.core.lib.lists.cons"}, "type": {"literal": {"integer": "int32"}}}},
"argument": {"variable": "c"}}},
"argument": {"variable": "s"}}},
"second": {"literal": {"boolean": false}}}},
"type": {"list": {"literal": {"integer": "int32"}}}}},
"type": {"literal": "boolean"}}}}},
"argument": {
"application": {
"function": {
"application": {
"function": {
"application": {
"function": {
"typeApplication": {
"body": {"variable": "hydra.core.lib.logic.ifElse"},
"type": {"pair": {"first": {"list": {"literal": {"integer": "int32"}}}, "second": {"literal": "boolean"}}}}},
"argument": {"variable": "b"}}},
"argument": {
"typeApplication": {
"body": {
"typeApplication": {
"body": {"pair": {"first": {"variable": "s"}, "second": {"literal": {"boolean": true}}}},
"type": {"list": {"literal": {"integer": "int32"}}}}},
"type": {"literal": "boolean"}}}}},
"argument": {
"typeApplication": {
"body": {
"typeApplication": {
"body": {
"pair": {
"first": {
"application": {
"function": {
"application": {
"function": {"typeApplication": {"body": {"variable": "hydra.core.lib.lists.cons"}, "type": {"literal": {"integer": "int32"}}}},
"argument": {"literal": {"integer": {"int32": 95}}}}},
"argument": {"variable": "s"}}},
"second": {"literal": {"boolean": true}}}},
"type": {"list": {"literal": {"integer": "int32"}}}}},
"type": {"literal": "boolean"}}}}}}}}}}}}}}},
"typeScheme": {
"variables": [],
"body": {
"function": {
"domain": {"pair": {"first": {"list": {"literal": {"integer": "int32"}}}, "second": {"literal": "boolean"}}},
"codomain": {
"function": {
"domain": {"literal": {"integer": "int32"}},
"codomain": {"pair": {"first": {"list": {"literal": {"integer": "int32"}}}, "second": {"literal": "boolean"}}}}}}},
"constraints": []}}],
"body": {
"let": {
"bindings": [
{
"name": "result",
"term": {
"application": {
"function": {
"application": {
"function": {
"application": {
"function": {
"typeApplication": {
"body": {
"typeApplication": {
"body": {"variable": "hydra.core.lib.lists.foldl"},
"type": {"pair": {"first": {"list": {"literal": {"integer": "int32"}}}, "second": {"literal": "boolean"}}}}},
"type": {"literal": {"integer": "int32"}}}},
"argument": {"variable": "replace"}}},
"argument": {
"typeApplication": {
"body": {
"typeApplication": {
"body": {
"pair": {
"first": {"typeApplication": {"body": {"list": []}, "type": {"literal": {"integer": "int32"}}}},
"second": {"literal": {"boolean": false}}}},
"type": {"list": {"literal": {"integer": "int32"}}}}},
"type": {"literal": "boolean"}}}}},
"argument": {"application": {"function": {"variable": "hydra.core.lib.strings.toList"}, "argument": {"variable": "input"}}}}},
"typeScheme": {
"variables": [],
"body": {"pair": {"first": {"list": {"literal": {"integer": "int32"}}}, "second": {"literal": "boolean"}}},
"constraints": []}}],
"body": {
"application": {
"function": {"variable": "hydra.core.lib.strings.fromList"},
"argument": {
"application": {
"function": {"typeApplication": {"body": {"variable": "hydra.core.lib.lists.reverse"}, "type": {"literal": {"integer": "int32"}}}},
"argument": {
"application": {
"function": {
"typeApplication": {
"body": {
"typeApplication": {"body": {"variable": "hydra.core.lib.pairs.first"}, "type": {"list": {"literal": {"integer": "int32"}}}}},
"type": {"literal": "boolean"}}},
"argument": {"variable": "result"}}}}}}}}}}}}}}},
"annotation": {
"map": [
{
"key": {"variable": "description"},
"value": {"literal": {"string": "Replace sequences of non-alphanumeric characters with single underscores"}}}]}}}}},
{
"term": {
"name": "hydra.core.formatting.normalizeComment",
"signature": {
"typeParameters": [],
"parameters": [{"name": "arg0", "type": {"literal": "string"}, "isLazy": false}],
"result": {"type": {"literal": "string"}}},
"body": {
"annotated": {
"body": {
"lambda": {
"parameter": "s",
"domain": {"literal": "string"},
"body": {
"let": {
"bindings": [
{
"name": "stripped",
"term": {
"application": {"function": {"variable": "hydra.core.formatting.stripLeadingAndTrailingWhitespace"}, "argument": {"variable": "s"}}},
"typeScheme": {"variables": [], "body": {"literal": "string"}, "constraints": []}}],
"body": {
"application": {
"function": {
"application": {
"function": {
"application": {
"function": {"typeApplication": {"body": {"variable": "hydra.core.lib.logic.ifElse"}, "type": {"literal": "string"}}},
"argument": {"application": {"function": {"variable": "hydra.core.lib.strings.isEmpty"}, "argument": {"variable": "stripped"}}}}},
"argument": {"literal": {"string": ""}}}},
"argument": {
"let": {
"bindings": [
{
"name": "lastIdx",
"term": {
"application": {
"function": {
"application": {
"function": {"typeApplication": {"body": {"variable": "hydra.core.lib.math.sub"}, "type": {"literal": {"integer": "int32"}}}},
"argument": {"application": {"function": {"variable": "hydra.core.lib.strings.length"}, "argument": {"variable": "stripped"}}}}},
"argument": {"literal": {"integer": {"int32": 1}}}}},
"typeScheme": {"variables": [], "body": {"literal": {"integer": "int32"}}, "constraints": []}}],
"body": {
"let": {
"bindings": [
{
"name": "appended",
"term": {
"application": {
"function": {"application": {"function": {"variable": "hydra.core.lib.strings.concat2"}, "argument": {"variable": "stripped"}}},
"argument": {"literal": {"string": "."}}}},
"typeScheme": {"variables": [], "body": {"literal": "string"}, "constraints": []}}],
"body": {
"application": {
"function": {
"application": {
"function": {
"application": {
"function": {
"typeApplication": {
"body": {"typeApplication": {"body": {"variable": "hydra.core.lib.optionals.match"}, "type": {"literal": {"integer": "int32"}}}},
"type": {"literal": "string"}}},
"argument": {
"application": {
"function": {"application": {"function": {"variable": "hydra.core.lib.strings.charAt"}, "argument": {"variable": "lastIdx"}}},
"argument": {"variable": "stripped"}}}}},
"argument": {"variable": "appended"}}},
"argument": {
"lambda": {
"parameter": "lastChar",
"domain": {"literal": {"integer": "int32"}},
"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": {"integer": "int32"}}}},
"argument": {"variable": "lastChar"}}},
"argument": {"literal": {"integer": {"int32": 46}}}}}}},
"argument": {"variable": "stripped"}}},
"argument": {"variable": "appended"}}}}}}}}}}}}}}}}},
"annotation": {
"map": [
{
"key": {"variable": "description"},
"value": {"literal": {"string": "Normalize a comment string for consistent output across coders"}}}]}}}}},
{
"term": {
"name": "hydra.core.formatting.sanitizeWithUnderscores",
"signature": {
"typeParameters": [],
"parameters": [
{"name": "arg0", "type": {"set": {"literal": "string"}}, "isLazy": false},
{"name": "arg1", "type": {"literal": "string"}, "isLazy": false}],
"result": {"type": {"literal": "string"}}},
"body": {
"annotated": {
"body": {
"lambda": {
"parameter": "reserved",
"domain": {"set": {"literal": "string"}},
"body": {
"lambda": {
"parameter": "s",
"domain": {"literal": "string"},
"body": {
"application": {
"function": {
"application": {"function": {"variable": "hydra.core.formatting.escapeWithUnderscore"}, "argument": {"variable": "reserved"}}},
"argument": {
"application": {"function": {"variable": "hydra.core.formatting.nonAlnumToUnderscores"}, "argument": {"variable": "s"}}}}}}}}},
"annotation": {
"map": [
{
"key": {"variable": "description"},
"value": {"literal": {"string": "Sanitize a string by replacing non-alphanumeric characters and escaping reserved words"}}}]}}}}},
{
"term": {
"name": "hydra.core.formatting.showList",
"signature": {
"typeParameters": [{"name": "t0", "constraints": []}],
"parameters": [
{
"name": "arg0",
"type": {"function": {"domain": {"variable": "t0"}, "codomain": {"literal": "string"}}},
"isLazy": false},
{"name": "arg1", "type": {"list": {"variable": "t0"}}, "isLazy": false}],
"result": {"type": {"literal": "string"}}},
"body": {
"typeLambda": {
"parameter": "t0",
"body": {
"annotated": {
"body": {
"lambda": {
"parameter": "f",
"domain": {"function": {"domain": {"variable": "t0"}, "codomain": {"literal": "string"}}},
"body": {
"lambda": {
"parameter": "els",
"domain": {"list": {"variable": "t0"}},
"body": {
"application": {
"function": {"variable": "hydra.core.lib.strings.concat"},
"argument": {
"list": [
{"literal": {"string": "["}},
{
"application": {
"function": {"application": {"function": {"variable": "hydra.core.lib.strings.join"}, "argument": {"literal": {"string": ", "}}}},
"argument": {
"application": {
"function": {
"application": {
"function": {
"typeApplication": {
"body": {"typeApplication": {"body": {"variable": "hydra.core.lib.lists.map"}, "type": {"variable": "t0"}}},
"type": {"literal": "string"}}},
"argument": {"variable": "f"}}},
"argument": {"variable": "els"}}}}},
{"literal": {"string": "]"}}]}}}}}}},
"annotation": {
"map": [
{
"key": {"variable": "description"},
"value": {"literal": {"string": "Format a list of elements as a bracketed, comma-separated string"}}}]}}}}}}},
{
"term": {
"name": "hydra.core.formatting.stripLeadingAndTrailingWhitespace",
"signature": {
"typeParameters": [],
"parameters": [{"name": "arg0", "type": {"literal": "string"}, "isLazy": false}],
"result": {"type": {"literal": "string"}}},
"body": {
"annotated": {
"body": {
"lambda": {
"parameter": "s",
"domain": {"literal": "string"},
"body": {
"application": {
"function": {"variable": "hydra.core.lib.strings.fromList"},
"argument": {
"application": {
"function": {
"application": {
"function": {"typeApplication": {"body": {"variable": "hydra.core.lib.lists.dropWhile"}, "type": {"literal": {"integer": "int32"}}}},
"argument": {"variable": "hydra.core.lib.chars.isSpace"}}},
"argument": {
"application": {
"function": {"typeApplication": {"body": {"variable": "hydra.core.lib.lists.reverse"}, "type": {"literal": {"integer": "int32"}}}},
"argument": {
"application": {
"function": {
"application": {
"function": {"typeApplication": {"body": {"variable": "hydra.core.lib.lists.dropWhile"}, "type": {"literal": {"integer": "int32"}}}},
"argument": {"variable": "hydra.core.lib.chars.isSpace"}}},
"argument": {
"application": {
"function": {"typeApplication": {"body": {"variable": "hydra.core.lib.lists.reverse"}, "type": {"literal": {"integer": "int32"}}}},
"argument": {"application": {"function": {"variable": "hydra.core.lib.strings.toList"}, "argument": {"variable": "s"}}}}}}}}}}}}}}},
"annotation": {
"map": [
{
"key": {"variable": "description"},
"value": {"literal": {"string": "Remove leading and trailing whitespace from a string"}}}]}}}}},
{
"term": {
"name": "hydra.core.formatting.unlines",
"signature": {
"typeParameters": [],
"parameters": [{"name": "arg0", "type": {"list": {"literal": "string"}}, "isLazy": false}],
"result": {"type": {"literal": "string"}}},
"body": {
"annotated": {
"body": {
"lambda": {
"parameter": "xs",
"domain": {"list": {"literal": "string"}},
"body": {
"application": {
"function": {"variable": "hydra.core.lib.strings.concat"},
"argument": {
"application": {
"function": {
"application": {
"function": {
"typeApplication": {
"body": {"typeApplication": {"body": {"variable": "hydra.core.lib.lists.map"}, "type": {"literal": "string"}}},
"type": {"literal": "string"}}},
"argument": {
"lambda": {
"parameter": "l",
"domain": {"literal": "string"},
"body": {
"application": {
"function": {"application": {"function": {"variable": "hydra.core.lib.strings.concat2"}, "argument": {"variable": "l"}}},
"argument": {"literal": {"string": "\n"}}}}}}}},
"argument": {"variable": "xs"}}}}}}},
"annotation": {
"map": [
{
"key": {"variable": "description"},
"value": {
"literal": {
"string": "Join a list of strings with newlines (U+000A), appending a newline after each element including the last; the empty list yields the empty string."}}}]}}}}},
{
"term": {
"name": "hydra.core.formatting.withCharacterAliases",
"signature": {
"typeParameters": [],
"parameters": [{"name": "arg0", "type": {"literal": "string"}, "isLazy": false}],
"result": {"type": {"literal": "string"}}},
"body": {
"annotated": {
"body": {
"lambda": {
"parameter": "original",
"domain": {"literal": "string"},
"body": {
"let": {
"bindings": [
{
"name": "aliases",
"term": {
"application": {
"function": {
"typeApplication": {
"body": {"typeApplication": {"body": {"variable": "hydra.core.lib.maps.fromList"}, "type": {"literal": {"integer": "int32"}}}},
"type": {"literal": "string"}}},
"argument": {
"list": [
{
"typeApplication": {
"body": {
"typeApplication": {
"body": {"pair": {"first": {"literal": {"integer": {"int32": 32}}}, "second": {"literal": {"string": "sp"}}}},
"type": {"literal": {"integer": "int32"}}}},
"type": {"literal": "string"}}},
{
"typeApplication": {
"body": {
"typeApplication": {
"body": {"pair": {"first": {"literal": {"integer": {"int32": 33}}}, "second": {"literal": {"string": "excl"}}}},
"type": {"literal": {"integer": "int32"}}}},
"type": {"literal": "string"}}},
{
"typeApplication": {
"body": {
"typeApplication": {
"body": {"pair": {"first": {"literal": {"integer": {"int32": 34}}}, "second": {"literal": {"string": "quot"}}}},
"type": {"literal": {"integer": "int32"}}}},
"type": {"literal": "string"}}},
{
"typeApplication": {
"body": {
"typeApplication": {
"body": {"pair": {"first": {"literal": {"integer": {"int32": 35}}}, "second": {"literal": {"string": "num"}}}},
"type": {"literal": {"integer": "int32"}}}},
"type": {"literal": "string"}}},
{
"typeApplication": {
"body": {
"typeApplication": {
"body": {"pair": {"first": {"literal": {"integer": {"int32": 36}}}, "second": {"literal": {"string": "dollar"}}}},
"type": {"literal": {"integer": "int32"}}}},
"type": {"literal": "string"}}},
{
"typeApplication": {
"body": {
"typeApplication": {
"body": {"pair": {"first": {"literal": {"integer": {"int32": 37}}}, "second": {"literal": {"string": "percnt"}}}},
"type": {"literal": {"integer": "int32"}}}},
"type": {"literal": "string"}}},
{
"typeApplication": {
"body": {
"typeApplication": {
"body": {"pair": {"first": {"literal": {"integer": {"int32": 38}}}, "second": {"literal": {"string": "amp"}}}},
"type": {"literal": {"integer": "int32"}}}},
"type": {"literal": "string"}}},
{
"typeApplication": {
"body": {
"typeApplication": {
"body": {"pair": {"first": {"literal": {"integer": {"int32": 39}}}, "second": {"literal": {"string": "apos"}}}},
"type": {"literal": {"integer": "int32"}}}},
"type": {"literal": "string"}}},
{
"typeApplication": {
"body": {
"typeApplication": {
"body": {"pair": {"first": {"literal": {"integer": {"int32": 40}}}, "second": {"literal": {"string": "lpar"}}}},
"type": {"literal": {"integer": "int32"}}}},
"type": {"literal": "string"}}},
{
"typeApplication": {
"body": {
"typeApplication": {
"body": {"pair": {"first": {"literal": {"integer": {"int32": 41}}}, "second": {"literal": {"string": "rpar"}}}},
"type": {"literal": {"integer": "int32"}}}},
"type": {"literal": "string"}}},
{
"typeApplication": {
"body": {
"typeApplication": {
"body": {"pair": {"first": {"literal": {"integer": {"int32": 42}}}, "second": {"literal": {"string": "ast"}}}},
"type": {"literal": {"integer": "int32"}}}},
"type": {"literal": "string"}}},
{
"typeApplication": {
"body": {
"typeApplication": {
"body": {"pair": {"first": {"literal": {"integer": {"int32": 43}}}, "second": {"literal": {"string": "plus"}}}},
"type": {"literal": {"integer": "int32"}}}},
"type": {"literal": "string"}}},
{
"typeApplication": {
"body": {
"typeApplication": {
"body": {"pair": {"first": {"literal": {"integer": {"int32": 44}}}, "second": {"literal": {"string": "comma"}}}},
"type": {"literal": {"integer": "int32"}}}},
"type": {"literal": "string"}}},
{
"typeApplication": {
"body": {
"typeApplication": {
"body": {"pair": {"first": {"literal": {"integer": {"int32": 45}}}, "second": {"literal": {"string": "minus"}}}},
"type": {"literal": {"integer": "int32"}}}},
"type": {"literal": "string"}}},
{
"typeApplication": {
"body": {
"typeApplication": {
"body": {"pair": {"first": {"literal": {"integer": {"int32": 46}}}, "second": {"literal": {"string": "period"}}}},
"type": {"literal": {"integer": "int32"}}}},
"type": {"literal": "string"}}},
{
"typeApplication": {
"body": {
"typeApplication": {
"body": {"pair": {"first": {"literal": {"integer": {"int32": 47}}}, "second": {"literal": {"string": "sol"}}}},
"type": {"literal": {"integer": "int32"}}}},
"type": {"literal": "string"}}},
{
"typeApplication": {
"body": {
"typeApplication": {
"body": {"pair": {"first": {"literal": {"integer": {"int32": 58}}}, "second": {"literal": {"string": "colon"}}}},
"type": {"literal": {"integer": "int32"}}}},
"type": {"literal": "string"}}},
{
"typeApplication": {
"body": {
"typeApplication": {
"body": {"pair": {"first": {"literal": {"integer": {"int32": 59}}}, "second": {"literal": {"string": "semi"}}}},
"type": {"literal": {"integer": "int32"}}}},
"type": {"literal": "string"}}},
{
"typeApplication": {
"body": {
"typeApplication": {
"body": {"pair": {"first": {"literal": {"integer": {"int32": 60}}}, "second": {"literal": {"string": "lt"}}}},
"type": {"literal": {"integer": "int32"}}}},
"type": {"literal": "string"}}},
{
"typeApplication": {
"body": {
"typeApplication": {
"body": {"pair": {"first": {"literal": {"integer": {"int32": 61}}}, "second": {"literal": {"string": "equals"}}}},
"type": {"literal": {"integer": "int32"}}}},
"type": {"literal": "string"}}},
{
"typeApplication": {
"body": {
"typeApplication": {
"body": {"pair": {"first": {"literal": {"integer": {"int32": 62}}}, "second": {"literal": {"string": "gt"}}}},
"type": {"literal": {"integer": "int32"}}}},
"type": {"literal": "string"}}},
{
"typeApplication": {
"body": {
"typeApplication": {
"body": {"pair": {"first": {"literal": {"integer": {"int32": 63}}}, "second": {"literal": {"string": "quest"}}}},
"type": {"literal": {"integer": "int32"}}}},
"type": {"literal": "string"}}},
{
"typeApplication": {
"body": {
"typeApplication": {
"body": {"pair": {"first": {"literal": {"integer": {"int32": 64}}}, "second": {"literal": {"string": "commat"}}}},
"type": {"literal": {"integer": "int32"}}}},
"type": {"literal": "string"}}},
{
"typeApplication": {
"body": {
"typeApplication": {
"body": {"pair": {"first": {"literal": {"integer": {"int32": 91}}}, "second": {"literal": {"string": "lsqb"}}}},
"type": {"literal": {"integer": "int32"}}}},
"type": {"literal": "string"}}},
{
"typeApplication": {
"body": {
"typeApplication": {
"body": {"pair": {"first": {"literal": {"integer": {"int32": 92}}}, "second": {"literal": {"string": "bsol"}}}},
"type": {"literal": {"integer": "int32"}}}},
"type": {"literal": "string"}}},
{
"typeApplication": {
"body": {
"typeApplication": {
"body": {"pair": {"first": {"literal": {"integer": {"int32": 93}}}, "second": {"literal": {"string": "rsqb"}}}},
"type": {"literal": {"integer": "int32"}}}},
"type": {"literal": "string"}}},
{
"typeApplication": {
"body": {
"typeApplication": {
"body": {"pair": {"first": {"literal": {"integer": {"int32": 94}}}, "second": {"literal": {"string": "circ"}}}},
"type": {"literal": {"integer": "int32"}}}},
"type": {"literal": "string"}}},
{
"typeApplication": {
"body": {
"typeApplication": {
"body": {"pair": {"first": {"literal": {"integer": {"int32": 95}}}, "second": {"literal": {"string": "lowbar"}}}},
"type": {"literal": {"integer": "int32"}}}},
"type": {"literal": "string"}}},
{
"typeApplication": {
"body": {
"typeApplication": {
"body": {"pair": {"first": {"literal": {"integer": {"int32": 96}}}, "second": {"literal": {"string": "grave"}}}},
"type": {"literal": {"integer": "int32"}}}},
"type": {"literal": "string"}}},
{
"typeApplication": {
"body": {
"typeApplication": {
"body": {"pair": {"first": {"literal": {"integer": {"int32": 123}}}, "second": {"literal": {"string": "lcub"}}}},
"type": {"literal": {"integer": "int32"}}}},
"type": {"literal": "string"}}},
{
"typeApplication": {
"body": {
"typeApplication": {
"body": {"pair": {"first": {"literal": {"integer": {"int32": 124}}}, "second": {"literal": {"string": "verbar"}}}},
"type": {"literal": {"integer": "int32"}}}},
"type": {"literal": "string"}}},
{
"typeApplication": {
"body": {
"typeApplication": {
"body": {"pair": {"first": {"literal": {"integer": {"int32": 125}}}, "second": {"literal": {"string": "rcub"}}}},
"type": {"literal": {"integer": "int32"}}}},
"type": {"literal": "string"}}},
{
"typeApplication": {
"body": {
"typeApplication": {
"body": {"pair": {"first": {"literal": {"integer": {"int32": 126}}}, "second": {"literal": {"string": "tilde"}}}},
"type": {"literal": {"integer": "int32"}}}},
"type": {"literal": "string"}}}]}}},
"typeScheme": {
"variables": [],
"body": {"map": {"keys": {"literal": {"integer": "int32"}}, "values": {"literal": "string"}}},
"constraints": []}},
{
"name": "alias",
"term": {
"lambda": {
"parameter": "c",
"domain": {"literal": {"integer": "int32"}},
"body": {
"application": {
"function": {
"application": {
"function": {
"typeApplication": {"body": {"variable": "hydra.core.lib.optionals.withDefault"}, "type": {"list": {"literal": {"integer": "int32"}}}}},
"argument": {
"application": {
"function": {"typeApplication": {"body": {"variable": "hydra.core.lib.lists.singleton"}, "type": {"literal": {"integer": "int32"}}}},
"argument": {"variable": "c"}}}}},
"argument": {
"application": {
"function": {
"application": {
"function": {
"typeApplication": {
"body": {"typeApplication": {"body": {"variable": "hydra.core.lib.optionals.map"}, "type": {"literal": "string"}}},
"type": {"list": {"literal": {"integer": "int32"}}}}},
"argument": {"variable": "hydra.core.lib.strings.toList"}}},
"argument": {
"application": {
"function": {
"application": {
"function": {
"typeApplication": {
"body": {"typeApplication": {"body": {"variable": "hydra.core.lib.maps.lookup"}, "type": {"literal": {"integer": "int32"}}}},
"type": {"literal": "string"}}},
"argument": {"variable": "c"}}},
"argument": {"variable": "aliases"}}}}}}}}},
"typeScheme": {
"variables": [],
"body": {"function": {"domain": {"literal": {"integer": "int32"}}, "codomain": {"list": {"literal": {"integer": "int32"}}}}},
"constraints": []}}],
"body": {
"application": {
"function": {"variable": "hydra.core.lib.strings.fromList"},
"argument": {
"application": {
"function": {
"application": {
"function": {"typeApplication": {"body": {"variable": "hydra.core.lib.lists.filter"}, "type": {"literal": {"integer": "int32"}}}},
"argument": {"variable": "hydra.core.lib.chars.isAlphaNum"}}},
"argument": {
"application": {
"function": {"typeApplication": {"body": {"variable": "hydra.core.lib.lists.concat"}, "type": {"literal": {"integer": "int32"}}}},
"argument": {
"application": {
"function": {
"application": {
"function": {
"typeApplication": {
"body": {"typeApplication": {"body": {"variable": "hydra.core.lib.lists.map"}, "type": {"literal": {"integer": "int32"}}}},
"type": {"list": {"literal": {"integer": "int32"}}}}},
"argument": {"variable": "alias"}}},
"argument": {"application": {"function": {"variable": "hydra.core.lib.strings.toList"}, "argument": {"variable": "original"}}}}}}}}}}}}}}},
"annotation": {
"map": [
{
"key": {"variable": "description"},
"value": {"literal": {"string": "Replace special characters with their alphanumeric aliases"}}}]}}}}},
{
"term": {
"name": "hydra.core.formatting.wrapLine",
"signature": {
"typeParameters": [],
"parameters": [
{"name": "arg0", "type": {"literal": {"integer": "int32"}}, "isLazy": false},
{"name": "arg1", "type": {"literal": "string"}, "isLazy": false}],
"result": {"type": {"literal": "string"}}},
"body": {
"annotated": {
"body": {
"lambda": {
"parameter": "maxlen",
"domain": {"literal": {"integer": "int32"}},
"body": {
"lambda": {
"parameter": "input",
"domain": {"literal": "string"},
"body": {
"let": {
"bindings": [
{
"name": "helper",
"term": {
"lambda": {
"parameter": "prev",
"domain": {"list": {"list": {"literal": {"integer": "int32"}}}},
"body": {
"lambda": {
"parameter": "rem",
"domain": {"list": {"literal": {"integer": "int32"}}},
"body": {
"let": {
"bindings": [
{
"name": "trunc",
"term": {
"application": {
"function": {
"application": {
"function": {"typeApplication": {"body": {"variable": "hydra.core.lib.lists.take"}, "type": {"literal": {"integer": "int32"}}}},
"argument": {"variable": "maxlen"}}},
"argument": {"variable": "rem"}}},
"typeScheme": {"variables": [], "body": {"list": {"literal": {"integer": "int32"}}}, "constraints": []}},
{
"name": "spanResult",
"term": {
"application": {
"function": {
"application": {
"function": {"typeApplication": {"body": {"variable": "hydra.core.lib.lists.span"}, "type": {"literal": {"integer": "int32"}}}},
"argument": {
"lambda": {
"parameter": "c",
"domain": {"literal": {"integer": "int32"}},
"body": {
"application": {
"function": {
"application": {
"function": {"variable": "hydra.core.lib.logic.and"},
"argument": {
"application": {
"function": {"variable": "hydra.core.lib.logic.not"},
"argument": {
"application": {
"function": {
"application": {
"function": {"typeApplication": {"body": {"variable": "hydra.core.lib.equality.equal"}, "type": {"literal": {"integer": "int32"}}}},
"argument": {"variable": "c"}}},
"argument": {"literal": {"integer": {"int32": 32}}}}}}}}},
"argument": {
"application": {
"function": {"variable": "hydra.core.lib.logic.not"},
"argument": {
"application": {
"function": {
"application": {
"function": {"typeApplication": {"body": {"variable": "hydra.core.lib.equality.equal"}, "type": {"literal": {"integer": "int32"}}}},
"argument": {"variable": "c"}}},
"argument": {"literal": {"integer": {"int32": 9}}}}}}}}}}}}},
"argument": {
"application": {
"function": {"typeApplication": {"body": {"variable": "hydra.core.lib.lists.reverse"}, "type": {"literal": {"integer": "int32"}}}},
"argument": {"variable": "trunc"}}}}},
"typeScheme": {
"variables": [],
"body": {"pair": {"first": {"list": {"literal": {"integer": "int32"}}}, "second": {"list": {"literal": {"integer": "int32"}}}}},
"constraints": []}},
{
"name": "prefix",
"term": {
"application": {
"function": {"typeApplication": {"body": {"variable": "hydra.core.lib.lists.reverse"}, "type": {"literal": {"integer": "int32"}}}},
"argument": {
"application": {
"function": {
"typeApplication": {
"body": {
"typeApplication": {"body": {"variable": "hydra.core.lib.pairs.second"}, "type": {"list": {"literal": {"integer": "int32"}}}}},
"type": {"list": {"literal": {"integer": "int32"}}}}},
"argument": {"variable": "spanResult"}}}}},
"typeScheme": {"variables": [], "body": {"list": {"literal": {"integer": "int32"}}}, "constraints": []}},
{
"name": "suffix",
"term": {
"application": {
"function": {"typeApplication": {"body": {"variable": "hydra.core.lib.lists.reverse"}, "type": {"literal": {"integer": "int32"}}}},
"argument": {
"application": {
"function": {
"typeApplication": {
"body": {
"typeApplication": {"body": {"variable": "hydra.core.lib.pairs.first"}, "type": {"list": {"literal": {"integer": "int32"}}}}},
"type": {"list": {"literal": {"integer": "int32"}}}}},
"argument": {"variable": "spanResult"}}}}},
"typeScheme": {"variables": [], "body": {"list": {"literal": {"integer": "int32"}}}, "constraints": []}}],
"body": {
"application": {
"function": {
"application": {
"function": {
"application": {
"function": {
"typeApplication": {"body": {"variable": "hydra.core.lib.logic.ifElse"}, "type": {"list": {"list": {"literal": {"integer": "int32"}}}}}},
"argument": {
"application": {
"function": {
"application": {
"function": {"typeApplication": {"body": {"variable": "hydra.core.lib.ordering.lte"}, "type": {"literal": {"integer": "int32"}}}},
"argument": {
"application": {
"function": {"typeApplication": {"body": {"variable": "hydra.core.lib.lists.length"}, "type": {"literal": {"integer": "int32"}}}},
"argument": {"variable": "rem"}}}}},
"argument": {"variable": "maxlen"}}}}},
"argument": {
"application": {
"function": {
"typeApplication": {"body": {"variable": "hydra.core.lib.lists.reverse"}, "type": {"list": {"literal": {"integer": "int32"}}}}},
"argument": {
"application": {
"function": {
"application": {
"function": {
"typeApplication": {"body": {"variable": "hydra.core.lib.lists.cons"}, "type": {"list": {"literal": {"integer": "int32"}}}}},
"argument": {"variable": "rem"}}},
"argument": {"variable": "prev"}}}}}}},
"argument": {
"application": {
"function": {
"application": {
"function": {
"application": {
"function": {
"typeApplication": {"body": {"variable": "hydra.core.lib.logic.ifElse"}, "type": {"list": {"list": {"literal": {"integer": "int32"}}}}}},
"argument": {
"application": {
"function": {"typeApplication": {"body": {"variable": "hydra.core.lib.lists.isEmpty"}, "type": {"literal": {"integer": "int32"}}}},
"argument": {"variable": "prefix"}}}}},
"argument": {
"application": {
"function": {
"application": {
"function": {"variable": "helper"},
"argument": {
"application": {
"function": {
"application": {
"function": {
"typeApplication": {"body": {"variable": "hydra.core.lib.lists.cons"}, "type": {"list": {"literal": {"integer": "int32"}}}}},
"argument": {"variable": "trunc"}}},
"argument": {"variable": "prev"}}}}},
"argument": {
"application": {
"function": {
"application": {
"function": {"typeApplication": {"body": {"variable": "hydra.core.lib.lists.drop"}, "type": {"literal": {"integer": "int32"}}}},
"argument": {"variable": "maxlen"}}},
"argument": {"variable": "rem"}}}}}}},
"argument": {
"application": {
"function": {
"application": {
"function": {
"typeApplication": {
"body": {"variable": "hydra.core.lib.optionals.withDefault"},
"type": {"list": {"list": {"literal": {"integer": "int32"}}}}}},
"argument": {
"application": {
"function": {
"application": {
"function": {"variable": "helper"},
"argument": {
"application": {
"function": {
"application": {
"function": {
"typeApplication": {"body": {"variable": "hydra.core.lib.lists.cons"}, "type": {"list": {"literal": {"integer": "int32"}}}}},
"argument": {"variable": "trunc"}}},
"argument": {"variable": "prev"}}}}},
"argument": {
"application": {
"function": {
"application": {
"function": {"typeApplication": {"body": {"variable": "hydra.core.lib.lists.drop"}, "type": {"literal": {"integer": "int32"}}}},
"argument": {"variable": "maxlen"}}},
"argument": {"variable": "rem"}}}}}}},
"argument": {
"application": {
"function": {
"application": {
"function": {
"typeApplication": {
"body": {
"typeApplication": {"body": {"variable": "hydra.core.lib.optionals.map"}, "type": {"list": {"literal": {"integer": "int32"}}}}},
"type": {"list": {"list": {"literal": {"integer": "int32"}}}}}},
"argument": {
"lambda": {
"parameter": "pfxInit",
"domain": {"list": {"literal": {"integer": "int32"}}},
"body": {
"application": {
"function": {
"application": {
"function": {"variable": "helper"},
"argument": {
"application": {
"function": {
"application": {
"function": {
"typeApplication": {"body": {"variable": "hydra.core.lib.lists.cons"}, "type": {"list": {"literal": {"integer": "int32"}}}}},
"argument": {"variable": "pfxInit"}}},
"argument": {"variable": "prev"}}}}},
"argument": {
"application": {
"function": {
"application": {
"function": {"typeApplication": {"body": {"variable": "hydra.core.lib.lists.concat2"}, "type": {"literal": {"integer": "int32"}}}},
"argument": {"variable": "suffix"}}},
"argument": {
"application": {
"function": {
"application": {
"function": {"typeApplication": {"body": {"variable": "hydra.core.lib.lists.drop"}, "type": {"literal": {"integer": "int32"}}}},
"argument": {"variable": "maxlen"}}},
"argument": {"variable": "rem"}}}}}}}}}}},
"argument": {
"application": {
"function": {"typeApplication": {"body": {"variable": "hydra.core.lib.lists.init"}, "type": {"literal": {"integer": "int32"}}}},
"argument": {"variable": "prefix"}}}}}}}}}}}}}}}}},
"typeScheme": {
"variables": [],
"body": {
"function": {
"domain": {"list": {"list": {"literal": {"integer": "int32"}}}},
"codomain": {
"function": {
"domain": {"list": {"literal": {"integer": "int32"}}},
"codomain": {"list": {"list": {"literal": {"integer": "int32"}}}}}}}},
"constraints": []}}],
"body": {
"application": {
"function": {"variable": "hydra.core.lib.strings.fromList"},
"argument": {
"application": {
"function": {
"application": {
"function": {"typeApplication": {"body": {"variable": "hydra.core.lib.lists.join"}, "type": {"literal": {"integer": "int32"}}}},
"argument": {"list": [{"literal": {"integer": {"int32": 10}}}]}}},
"argument": {
"application": {
"function": {
"application": {
"function": {"variable": "helper"},
"argument": {"typeApplication": {"body": {"list": []}, "type": {"list": {"literal": {"integer": "int32"}}}}}}},
"argument": {"application": {"function": {"variable": "hydra.core.lib.strings.toList"}, "argument": {"variable": "input"}}}}}}}}}}}}}}},
"annotation": {
"map": [
{
"key": {"variable": "description"},
"value": {"literal": {"string": "A simple soft line wrap which is suitable for code comments"}}}]}}}}}]}