[{"name":"Pretty","comment":" Wadler's Pretty printer. Use the constructor functions to build up a `Doc` and\nlay it out to fit a page width using the `pretty` function.\n\n@docs Doc\n\n\n# Pretty printing documents\n\n@docs pretty\n\n\n# Building documents from string data\n\n@docs empty, space, string, taggedString, char\n\n\n# Joining documents together\n\n@docs append, a, join, lines, separators, softlines, words, fold\n\n\n# Fitting documents onto lines\n\n@docs group, line, tightline, softline\n\n\n# Indenting and alinging documents\n\n@docs align, nest, hang, indent\n\n\n# Putting things around documents\n\n@docs surround, parens, braces, brackets\n\n\n# Updating tags in documents\n\n@docs setTag, updateTag\n\n","unions":[],"aliases":[{"name":"Doc","comment":" A document describes possible layouts for pretty printing. The type parameter\n`t` allows tagging text for syntax highlighting.\n\nBuild documents with combinators like `string`, `line`, `nest`, then render with `pretty`:\n\n    pretty 40 (group (nest 4 (string \"hello\" |> a line |> a (string \"world\"))))\n    -- Fits on one line: \"hello world\"\n    -- If too wide: \"hello\\n    world\"\n\n","args":["t"],"type":"Internals.Doc t"}],"values":[{"name":"a","comment":" Flip of `append` for use in pipelines. Read as \"and\":\n\n    string \"if\"\n        |> a space\n        |> a (string \"x > 0\")\n        |> a space\n        |> a (string \"then\")\n    -- \"if x > 0 then\"\n\n","type":"Pretty.Doc t -> Pretty.Doc t -> Pretty.Doc t"},{"name":"align","comment":" Aligns subsequent lines to the current column position. Unlike `nest` which\nadds a fixed indent, `align` indents relative to where you are now.\n\n    string \"let \" |> a (align (lines [ string \"x = 1\", string \"y = 2\" ]))\n    -- \"let x = 1\\n    y = 2\"\n    --     ^--- aligned to column 4 (after \"let \")\n\nUseful for hanging indentation that adapts to context.\n\n","type":"Pretty.Doc t -> Pretty.Doc t"},{"name":"append","comment":" Concatenates two documents. The first argument comes before the second.\n\n    append (string \"hello\") (string \"world\") -- \"helloworld\"\n\nUsually it's more convenient to use `a` for pipelines, or `join`/`words`/`lines`\nfor lists.\n\n","type":"Pretty.Doc t -> Pretty.Doc t -> Pretty.Doc t"},{"name":"braces","comment":" Wraps a document in curly braces.\n\n    braces (string \"x: 1\")  -- \"{x: 1}\"\n\n","type":"Pretty.Doc t -> Pretty.Doc t"},{"name":"brackets","comment":" Wraps a document in square brackets.\n\n    brackets (string \"1, 2, 3\")  -- \"[1, 2, 3]\"\n\n","type":"Pretty.Doc t -> Pretty.Doc t"},{"name":"char","comment":" Creates a document from a single character.\n\n    char '(' |> a (string \"x\") |> a (char ')')  -- \"(x)\"\n\n","type":"Char.Char -> Pretty.Doc t"},{"name":"empty","comment":" An empty document that produces no output.\n\nUnlike `string \"\"`, empties are filtered out by `join`, `lines`, `words`, etc.\nThis prevents double separators when some items are conditionally absent:\n\n    words [ string \"a\", empty, string \"b\" ] -- \"a b\", not \"a  b\"\n\n    -- Conditional content:\n    words [ string \"hello\", if showName then string name else empty ]\n\n","type":"Pretty.Doc t"},{"name":"fold","comment":" Left fold over a list, starting from `empty`. Useful for custom joining:\n\n    -- Join with \" -> \" between items\n    fold (\\item acc ->\n        if acc == empty then string item\n        else acc |> a (string \" -> \") |> a (string item)\n    ) [ \"a\", \"b\", \"c\" ]\n    -- \"a -> b -> c\"\n\n","type":"(a -> Pretty.Doc t -> Pretty.Doc t) -> List.List a -> Pretty.Doc t"},{"name":"group","comment":" Try to lay out a document on one line; if it doesn't fit, break it.\n\nThis is the key combinator for flexible layouts. It creates a choice between\nthe flattened version (line breaks become spaces) and the original.\n\n    items = string \"one\" |> a line |> a (string \"two\") |> a line |> a (string \"three\")\n\n    pretty 20 (group items) == \"one two three\"  -- fits\n    pretty 10 (group items) == \"one\\ntwo\\nthree\" -- doesn't fit, breaks\n\nNested groups break outside-in: the outer group breaks first, inner groups\nmay still fit on their lines.\n\n","type":"Pretty.Doc t -> Pretty.Doc t"},{"name":"hang","comment":" Combines `align` with additional nesting. Equivalent to `align (nest n doc)`.\n\n    string \"fn(\" |> a (hang 2 (lines [ string \"arg1\", string \"arg2\" ])) |> a (string \")\")\n    -- \"fn(arg1\\n     arg2)\"\n    --    ^--- aligned to column 3, plus 2 more = column 5\n\n","type":"Basics.Int -> Pretty.Doc t -> Pretty.Doc t"},{"name":"indent","comment":" Indents the first line AND all subsequent lines by the given amount.\n\n    indent 4 (lines [ string \"one\", string \"two\" ])\n    -- \"    one\\n    two\"\n\nCompare with `nest` which only affects lines after breaks, not the first line.\n\n","type":"Basics.Int -> Pretty.Doc t -> Pretty.Doc t"},{"name":"join","comment":" Joins documents with a separator between each pair. Empty documents are\nfiltered out to prevent double separators.\n\n    join (string \", \") [ string \"a\", string \"b\", string \"c\" ]  -- \"a, b, c\"\n\n    join (string \", \") [ string \"a\", empty, string \"c\" ]  -- \"a, c\" (not \"a, , c\")\n\nSee also `words` (join with space), `lines` (join with line), `separators`.\n\n","type":"Pretty.Doc t -> List.List (Pretty.Doc t) -> Pretty.Doc t"},{"name":"line","comment":" A line break that becomes a space when flattened by `group`.\n\n    -- Without group: always breaks\n    string \"a\" |> a line |> a (string \"b\")  -- \"a\\nb\"\n\n    -- With group: breaks only if needed\n    group (string \"a\" |> a line |> a (string \"b\"))\n    -- Wide: \"a b\"    (line becomes space)\n    -- Narrow: \"a\\nb\" (line breaks)\n\nUse `tightline` if you want no space when flattened.\n\n","type":"Pretty.Doc t"},{"name":"lines","comment":" Joins documents with `line` between each. Equivalent to `join line`.\n\n    lines [ string \"one\", string \"two\", string \"three\" ]\n    -- \"one\\ntwo\\nthree\"\n\nWrap in `group` for flexible breaking:\n\n    group (lines [ string \"a\", string \"b\" ])\n    -- Wide: \"a b\"  |  Narrow: \"a\\nb\"\n\n","type":"List.List (Pretty.Doc t) -> Pretty.Doc t"},{"name":"nest","comment":" Adds indentation to all line breaks inside a document. The first line is\nNOT indented—only lines after breaks.\n\n    string \"{\" |> a (nest 4 (line |> a (string \"body\"))) |> a line |> a (string \"}\")\n    -- \"{\\n    body\\n}\"\n\nCommon mistake—nest around content without a line break inside:\n\n    nest 4 (string \"no effect\")  -- just \"no effect\", no indentation\n\nThe line break must be INSIDE the nest for indentation to apply.\n\n","type":"Basics.Int -> Pretty.Doc t -> Pretty.Doc t"},{"name":"parens","comment":" Wraps a document in parentheses.\n\n    parens (string \"x + y\")  -- \"(x + y)\"\n\n","type":"Pretty.Doc t -> Pretty.Doc t"},{"name":"pretty","comment":" Renders a document to a string, fitting it within the given column width.\n\nThe algorithm makes greedy left-to-right decisions: when a `group` fits on the\nremaining line, it stays flat; otherwise it breaks.\n\n    doc = group (string \"aaa\" |> a line |> a (string \"bbb\"))\n\n    pretty 10 doc == \"aaa bbb\"   -- fits in 10 columns\n    pretty 5 doc  == \"aaa\\nbbb\"  -- too wide, breaks\n\n","type":"Basics.Int -> Pretty.Doc t -> String.String"},{"name":"separators","comment":" Joins documents with a separator that appears both when flat and when broken.\nUseful for leading-comma or leading-pipe style:\n\n    separators \", \" [ string \"a\", string \"b\", string \"c\" ] |> group\n    -- Wide:   \"a, b, c\"\n    -- Narrow: \"a\\n, b\\n, c\"\n\n    separators \"| \" [ string \"A\", string \"B\" ] |> group\n    -- Wide:   \"A| B\"\n    -- Narrow: \"A\\n| B\"\n\n","type":"String.String -> List.List (Pretty.Doc t) -> Pretty.Doc t"},{"name":"setTag","comment":" Tags all strings in a document for syntax highlighting.\n\n    type Tag = Error\n\n    setTag Error (words [ string \"undefined\", string \"variable\" ])\n    -- Both strings will be tagged as Error\n\n","type":"t -> Pretty.Doc t -> Pretty.Doc t"},{"name":"softline","comment":" A line break that tries to be a space. Equivalent to `group line`.\n\nUnlike `line` inside a `group`, each `softline` makes its own independent\nbreak decision:\n\n    string \"a\" |> a softline |> a (string \"b\") |> a softline |> a (string \"c\")\n    -- Might render as: \"a b\\nc\" if \"a b\" fits but \"a b c\" doesn't\n\n","type":"Pretty.Doc t"},{"name":"softlines","comment":" Joins documents with `softline` (each break decides independently).\n\n    softlines [ string \"one\", string \"two\", string \"three\" ]\n    -- Each softline independently becomes space or newline based on fit\n\nUnlike `group (lines [...])` where all breaks happen together, here each\nbreak point makes its own decision.\n\n","type":"List.List (Pretty.Doc t) -> Pretty.Doc t"},{"name":"space","comment":" A single space character. Equivalent to `char ' '`.\n\n    string \"hello\" |> a space |> a (string \"world\")  -- \"hello world\"\n\n","type":"Pretty.Doc t"},{"name":"string","comment":" Creates a document from a string. This is the primary way to add text content.\n\n    pretty 80 (string \"hello\") == \"hello\"\n\n    string \"let\" |> a space |> a (string \"x = 1\")  -- \"let x = 1\"\n\n","type":"String.String -> Pretty.Doc t"},{"name":"surround","comment":" Wraps a document with left and right delimiters.\n\n    surround (string \"<<\") (string \">>\") (string \"content\")  -- \"<<content>>\"\n\nSee also `parens`, `braces`, `brackets` for common cases.\n\n","type":"Pretty.Doc t -> Pretty.Doc t -> Pretty.Doc t -> Pretty.Doc t"},{"name":"taggedString","comment":" Creates a tagged string for syntax highlighting. Use with `Pretty.Renderer`\nto produce HTML or other formatted output.\n\n    type Tag = Keyword | Literal\n\n    taggedString \"let\" Keyword |> a space |> a (taggedString \"42\" Literal)\n\n","type":"String.String -> t -> Pretty.Doc t"},{"name":"tightline","comment":" A line break that becomes nothing when flattened by `group`.\n\nUse this before closing delimiters to avoid unwanted spaces:\n\n    -- Array formatting\n    group (\n        char '[' |> a tightline\n            |> a (string \"items\")\n            |> a tightline |> a (char ']')\n    )\n    -- Wide:   \"[items]\"  (no spaces)\n    -- Narrow: \"[\\nitems\\n]\"\n\nCompare with `line` which would produce \"[ items ]\" when flat.\n\n","type":"Pretty.Doc t"},{"name":"updateTag","comment":" Conditionally update tags based on string content and current tag.\n\n    -- Tag numbers as literals\n    updateTag (\\s _ ->\n        if String.all Char.isDigit s then Just Literal else Nothing\n    ) doc\n\n    -- Remove all tags\n    updateTag (\\_ _ -> Nothing) doc\n\n","type":"(String.String -> Maybe.Maybe t -> Maybe.Maybe t) -> Pretty.Doc t -> Pretty.Doc t"},{"name":"words","comment":" Joins documents with spaces. Equivalent to `join space`.\n\n    words [ string \"hello\", string \"world\" ]  -- \"hello world\"\n\nEmpty docs are filtered out, preventing double spaces.\n\n","type":"List.List (Pretty.Doc t) -> Pretty.Doc t"}],"binops":[]},{"name":"Pretty.Renderer","comment":" Pretty.Renderer lets you specify custom rendering functions to modify the\noutput of the pretty printer as it is layed out. You do not need to use this\nmodule for the default monochrome text only rendering which can be achieved\nwith `Pretty.pretty`.\n\nIf you have a tagged `Doc` model, you can use the tags to do syntax highlighting\nwith a custom `Renderer`. You can also turn the output into other structured\nforms such as HTML.\n\n@docs pretty, Renderer\n\n","unions":[],"aliases":[{"name":"Renderer","comment":" A custom `Renderer`.\n\nThis works a bit like a `foldl` operation. Note that the text being rendered\nis folded left to right, which means if you accumulate intermediate results into\n`List`s, you will need to reverse them.\n\n  - The `init` value defines the initial state of an accumulator that is passed\n    over the entire rendering.\n\n  - Tagged and untagged string from the `Doc` are passed through the `tagged`\n    and `untagged` functions.\n\n  - When the end of a line is reached, `untagged` is invoked to update the\n    accumulator. Note that you must manually add `\\n` newline character here if\n    you need one. You may not be using newlines for an HTML rendering.\n\n  - The `outer` function is invoked on the complete accumulator, and provides an\n    opportunity to complete the layout, for example by adding outer HTML tags\n    around in, and so on.\n\n","args":["t","a","b"],"type":"{ init : a, tagged : t -> String.String -> a -> a, untagged : String.String -> a -> a, newline : a -> a, outer : a -> b }"}],"values":[{"name":"pretty","comment":" Pretty prints a document trying to fit it as best as possible to the specified\ncolumn width of the page.\n\nA custom `Renderer` must be specified to handle the different parts of the output.\n\n","type":"Basics.Int -> Pretty.Renderer.Renderer t a b -> Internals.Doc t -> b"}],"binops":[]}]