[{"name":"Kdl","comment":" General types and functions which are used throughout the library\n\n@docs Document\n@docs SourceRange\n","unions":[],"aliases":[{"name":"Document","comment":" A KDL document, held within Elm\n\nThis is the core type of this library, and all of the tooling revolves around it.  Check out some of the sub-modules to see things you can do with this document, and how you can create them.\n","args":[],"type":"Kdl.Types.Document"},{"name":"SourceRange","comment":" A range of characters within the source file\n\nThis is a type alias for `((Int, Int), (Int, Int))`, where the first pair of ints is the row and column of the first character, and the second pair of ints is the row and column of the final character.\n\nNote that this is and *inclusive* range, which means that both the characters at both the first and second position are considered to be within the range, as well as all characters between them.\n","args":[],"type":"Kdl.Types.SourceRange"}],"values":[],"binops":[]},{"name":"Kdl.Decode","comment":" Tools for building a translator from KDL to your Elm datastructure\n\nThis module follow's the same decoding philosophy as Elm uses for its JSON\ndecoders.  If you haven't read the [JSON chapter of Elm's official guide][1],\nI recommend it!  It's a 5-10 minute read, and it'll give you a great high-level\noverview that'll make working with this module a lot easier.\n\nIn short, this philosophy centers around Decoders, which are objects that\nconvert data from KDL (or another format) into Elm data structures.  At first,\nyou start out with very simple decoders, like a decoder that simply converts a\nKDL string into an Elm string.  What makes this technique powerful, though, is\nthat decoders snap together like legos to construct bigger decoders.  The\nfunctions that combine these decoders are known as *combinators*.\n\nBy piecing together these simple decoders with simple combinators, you can\nconstruct a decoder for pretty much any datastructure you can imagine, and\nadding validation and intuitive error messages is a snap!\n\nOne distinction between this library and Elm's JSON library is that JSON\nobjects all belong to one \"class\", so Elm only needs one type of decoder.  In\nKDL, values, properties, and nodes behave differently, so this library uses a\ndifferent decoder type for each.  Fear not though!  A simple set of combinators\nis provided for each, and the documentation will make it clear which one you\nneed.\n\n[1]: https://guide.elm-lang.org/effects/json.html\n\n# Where The Magic Happens\n\n@docs decode\n\n# Types\n\nThese are the decoder types.  They fit together much like you would\nexpect:  [`DocumentDecoder`][]s are built out of [`NodeDecoder`][], and\n[`NodeDecoder`][]s are built out of [`ValueDecoder`][]s and [`DocumentDecoder`]s\n(for decoding child nodes).\n\nYou'll notice that all of the decoders here are generic over two types.\n- The last type, `t` is the output type of the decoder--  The datastructure that\nthe decoder spits out.\n- The `e` type is your custom error type.  For maximum flexibility, you can\nchoose whatever type you want here.  The quickest and easiest way to get started\nis to just use the unit type (aka the empty tuple) `()`.  This will let you\nbuild fast, but you won't get much information about what went wrong when a\ndecode fails.  At some point, you'll probably want actual error messages, so you\nmay want to use a `String` or even a custom enum to represent possible errors.\n\n[`ValueDecoder`]: #ValueDecoder\n[`NodeDecoder`]: #NodeDecoder\n[`DocumentDecoder`]: #DocumentDecoder\n\n@docs ValueDecoder\n@docs NodeDecoder\n@docs DocumentDecoder\n\n# Combinators\n\nCombinators are what you use to combine decoders.  The ones in this section are generic, so you can use them with any of the five decoders.\n\n@docs map\n@docs map2\n@docs andApply\n@docs andRequire\n@docs andThen\n@docs succeed\n\n# Values\n\nValues are the most basic building block of KDL, and can be used to construct decoders for arguments and properties.\n\n@docs rational\n@docs float\n@docs int\n@docs string\n@docs bool\n@docs null\n@docs guardV\n@docs failV\n@docs oneOfV\n\n# Arguments\n\nArguments are values applied directly to nodes, like `my-node 1 2 \"hello\" myprop=10`.  In this example, `1`, `2`, and `\"hello\"` are all arguments. `myprop=10` is **not** an argument, but a property, which is the other way of associating values with a node.\n\nThe decoders in this section are concerned with making sure that nodes have the right number of arguments, in the right order (if there is one).\n\n@docs argument\n@docs optionalArgument\n@docs arguments\n@docs noOtherArguments\n\n# Properties\n\nProperties are key/value associations tied to nodes.  For example in `my-node hello=world favorite-number=1080`, there's two properties:  One called `\"hello\"` with the value `\"world\"`, and one called \"favorite-number\" with the value `1080`.  Property keys are always strings, while property values can be any KDL value.\n\nThis section is dedicated to making sure that all the right properties are specified, and none of the wrong ones.\n\n@docs property\n@docs optionalProperty\n@docs properties\n@docs noOtherProperties\n\n# Children\n\nThese decoders help you decode the children of a node.  If you don't specify either of these, then by default your decoder will simply ignore any children which are present.  It's recommended that you do specify a behavior though, so that accidental misuse is met by a helpful error rather than silent acceptance.\n\n@docs children\n@docs noChildren\n\n# Nodes\n\nThese decoders help you get a little bit more information about your nodes.  Note that the [Arguments](#arguments), [Properties](#properties), and [Children](#Children) all also contain [`NodeDecoder`](#NodeDecoder)s as well, but this section is dedicated to decoders for node metadata alone.\n\n@docs nodeName\n@docs guardN\n@docs failN\n\n# Documents & Child Blocks\n\nThere are several strategies you can use to decode documents and child blocks\n(which are treated as equivalent by this decoder).  This section is broken up\nby strategy.\n\n## Property-List Documents\n\nOne of the more common types of documents you'll see has a series of nodes\nwhich each encode some property.  For example, the block of child nodes for an\nemployee record might contain a `name` node, an optional `birthday` node, and a\nseveral `project` nodes.  Note that this does not fit neatly as a dict-like node\n(from the next section) since there are a fixed number of keys, and each key has\na special meaning.\n\nIn parse this example, you could parse the employee's name with [`entry`]\n(#entry), their birthday with [`optionalEntry`](#optionalEntry), and their\nproject with [`entries`](#entries).  This method would be agnostic to the order\nof the properties in the block, but would require exactly one `name` and no more\nmore one `birthday`.\n\n    type alias EmployeeData =\n        { name : String\n        , birthday : Maybe Int\n        , projects : List String\n        }\n\n    decodeEmployeeData = succeed EmployeeData\n        |> andApply (entry \"name\" (argument string))\n        |> andApply (optionalEntry \"birthday\" (argument int))\n        |> andApply (entries \"project\" (argument string))\n        |> andRequire noOtherEntries\n\nThis decoder could successfully decode this document:\n\n```\nname bob\nbirthday 944937799\nproject big-freaking-contraption\nproject evil-laser-beam\n```\n\nOne thing to note about this parsing strategy is that while most of the\nrest of the parsing strategies simply take arguments and return a complete\n[`Documentdecoder`](#DocumentDecoder), this parsing strategy looks a little\nbit more like the parsing strategy for arguments and values, where smaller unit\ndecoders are combined with [`andApply`](#andApply) to form a bigger decoder.\n\n@docs entry\n@docs entries\n@docs optionalEntry\n@docs noOtherEntries\n\n## Dict-Like Documents\n\nA common use of documents is to represent dict-like structures.  In these cases,\nthe names of nodes are arbitrary strings which represent keys in a dictionary,\nand the bodies of those nodes are simple types corresponding to the values in\nthat dictionary.\n\nCrucially, the keys shouldn't be preset keywords, and the values should all be\ndecoded in the same way.\n\n@docs dictDocument\n@docs multidictDocument\n\n## Single-Node Documents\n\nSometimes your document only has one node, so you don't need much to parse it!\n\n@docs singleNodeDocument\n@docs singleNodeDocumentF\n\n## Order-Signifigant Documents\n\nThe most powerful document decoders are these, which preserve the order of\nthe nodes which they parse rather than forming them into a more ergonomic\ndatastructure.  This means that you can arrange the nodes into your own\norder-aware datastructure, although it forces you to do a little bit more work.\n\n@docs document\n@docs documentF\n\n# Error Handling\n\nSometimes, users or programmers make mistakes, and produce a KDL document which\nis valid KDL, but still contains mistakes that make it un-decodeable.  When this\nhappens, it's important to provide helpful and specific error messages so that\nthe problem can be quickly identified and resolved.  This module contains some\nerror handling tools which aim to make this proccess simpler.\n\n@docs Error\n@docs ErrorKind\n@docs ContextFrame\n@docs ValueType\n@docs showDecodeError\n","unions":[{"name":"ContextFrame","comment":" Describes where in the document tree an error occured\n\n`WithinProperty` and `WithinValue` of course describe the name of the property\nthe error occured in and the order of the value that the problem occured in,\nrespectively. `WithinNode` describes both the name of the node, and the order\nthe node appears within its parent document/child block.\n\n\"Deeper\" parts of the structure will be located closer to the top/front of the\ncontext stack.  By the nature of KDL.\n","args":[],"cases":[["WithinNode",["String.String","Basics.Int"]],["WithinProperty",["String.String"]],["WithinValue",["Basics.Int"]]]},{"name":"ErrorKind","comment":" Describes what went wrong in a decoding error\n\nSee [`Error`](#Error) for more information about decoding errors in general.\n\nThere are several ways that a decode can fail, all of which are enumerated by this type:\n- **WrongType** - This error occurs when attempting to decode a number as a\n  string, when trying to decode `#inf` as a rational, or any other time that the\n  type you're trying to decode into can't handle whatever the actual KDL value is.\n  Takes two arguments, the first being the expected type, and the latter being the\n  actual type.\n- **Failed** - This error occurs whenever a decoder failure is requested by the\n  programmer, for example in `guard` methods or by the `fail` decoder.  See the\n  docs for [`Error`](#Error) for more information.\n- **PossibilitiesExhausted** - Any time that an error occurs within a `oneOf`\n  decoder, there tend to be multiple possibilities for why that failure occured,\n  since if *any* of the branches had succeeded, the decode would have succeeded.\n  When this occurs, this error kind is returned, describing all of the errors\n  that occured for each branch of the `oneOf`.  The order of errors in the list\n  is guaranteed to exactly match the order of cases in the `oneOf` that triggered\n  the error.\n- **TooFewArguments** - A node had a minimum number of required arguments that\n  wasn't met\n- **TooManyArguments** - A node had more arguments than could be decoded\n- **PropertyAbsent** - A node lacked a required property.  The attached string\n  is the name of the missing property.\n- **UnexpectedProperty** - A property was present that wasn't expected.  The\n  name of the property can be found in the context stack.\n- **MissingNode** - The decoder expected to see a node, but it was absent.  The\n  attached string is the name of the node that was expected, or an empty string\n  if an expected name wasn't explicitly passed.\n- **DuplicateNode** - More than one node appears with a given name, but the\n  document decoder being used doesn't support nodes with duplicate names.\n- **UnexpectedNode** - A node was seen that the document decoder didn't recognize.\n- **TooManyNodes** - The decoder expected a specific, finite number of nodes,\n  but saw more than it could handle.\n","args":["e"],"cases":[["WrongType",["Kdl.Decode.ValueType","Kdl.Types.ValueContents"]],["Failed",["e"]],["PossibilitiesExhausted",["List.List (Kdl.Decode.Error e)"]],["TooFewArguments",[]],["TooManyArguments",[]],["PropertyAbsent",["String.String"]],["UnexpectedProperty",[]],["NoNodes",[]],["MissingNode",["String.String"]],["DuplicateNode",[]],["UnexpectedNode",[]],["TooManyNodes",[]]]},{"name":"ValueType","comment":" Represents each of the possible types that built-in decoders are available for.\n\nUsed to describe the expected type in a [`WrongType`](#ErrorKind) error.\n","args":[],"cases":[["IntType",[]],["RationalType",[]],["FloatType",[]],["StringType",[]],["BoolType",[]],["NullType",[]]]}],"aliases":[{"name":"DocumentDecoder","comment":" A decoder for KDL documents, and equivalently, child blocks of KDL nodes\n\n'cause they're both just lists of Nodes.\n","args":["e","t"],"type":"Kdl.Decode.Decoder Kdl.Decode.EnumeratedDocument e t"},{"name":"Error","comment":" An error which occurs during decoding\n\nContains information about exactly where the error occured through the `context`\nstack, which describes the location in terms of semantics (see\n[`ContextFrame`](#ContextFrame)), and the `location` attribute, which describes\nthe location within the original text document.\n\nThe `kind` attribute describes the error itself -- What exactly went wrong.  See\n[`ErrorKind`](#ErrorKind) for more details.\n\nYou'll notice that `Error` and [`ErrorKind`](#ErrorKind) are both parameterized\nin terms of some type `e`.  That is a custom error type that you can use to\npass more information about certain kinds of failures.  In particular, when\n`guard` methods like [`guardV`](#guardV) or [`guardN`](#guardN) fail, or\nwhen you deliberately trigger a failure with the [`fail`](#fail) decoder,\nyou may use your own error type to describe why the failure occured.  If\nyou don't use either of these decoders, feel free to set this type to\n[`Never`](https://package.elm-lang.org/packages/elm/core/1.0.5/Basics#Never).\n","args":["e"],"type":"{ kind : Kdl.Decode.ErrorKind e, context : List.List Kdl.Decode.ContextFrame, location : Kdl.Types.SourceRange }"},{"name":"NodeDecoder","comment":" A decoder for KDL nodes\n","args":["e","t"],"type":"Kdl.Decode.Decoder Kdl.Decode.EnumeratedNode e t"},{"name":"ValueDecoder","comment":" A decoder for simple KDL values, like strings, numbers, and booleans\n","args":["e","t"],"type":"Kdl.Decode.Decoder Kdl.Types.Value e t"}],"values":[{"name":"andApply","comment":" Add another requirement to a decoder and combine their values through application\n\nThis can be very helpful when defining decoders for documents, properties, and arguments, especially when combined with `succeed`.  This can be a little easier to see through example:\n\n    type MyWeirdDatatype = MyWeirdDatatype String Int\n\n    mkMyWeirdDatatype : Int -> String -> Int -> MyWeirdDatatype\n    mkMyWeirdDatatype x str y = MyWeirdDatatype str (x - y)\n\n    decodeMyWeirdData : DocumentDecoder String MyWeirdDatatype\n    decodeMyWeirdData =\n        succeed mkMyWeirdDatatype\n            |> andApply (argument int)\n            |> andApply (argument string)\n            |> andApply (argument int)\n            |> andRequire noOtherArguments\n            |> andRequire noOtherProperties\n            |> andRequire noChildren\n            |> singleNodeDocument \"my-weird-data\"\n\n    (parse \"my-weird-data 5 meowy 2\" |> Result.map (decode decodeMyWeirdData)) == Ok (Ok (MyWeirdDatatype \"meowy\" 3))\n\n**Note:**  This combinator is generic, and can be used with any of the three decoders in this module, though most of the time you'll be using it with [`NodeDecoder`](#NodeDecoder)s.\n","type":"Kdl.Decode.Decoder f e i -> Kdl.Decode.Decoder f e (i -> o) -> Kdl.Decode.Decoder f e o"},{"name":"andRequire","comment":" A version of [`andApply`](#andApply) that ignores the output of its first argument and while still adding the constraints\n\n**Note:**  This combinator is generic, and can be used with any of the three decoders in this module, though most of the time you'll be using it with [`NodeDecoder`](#NodeDecoder)s.\n","type":"Kdl.Decode.Decoder f e ignore -> Kdl.Decode.Decoder f e t -> Kdl.Decode.Decoder f e t"},{"name":"andThen","comment":" Run a decoder, then run a function on the result to produce a new decoder, which is *also* run.\n\nSometimes the behaviour of the decoder going forward is contingent on values already decoded.  This is the function to turn to in that case.  Analagous to [`Json.Decode.andThen`](https://package.elm-lang.org/packages/elm/json/latest/Json-Decode#andThen).\n\n**Note:**  This combinator is generic, and can be used with any of the three decoders in this module.\n","type":"(i -> Kdl.Decode.Decoder f e o) -> Kdl.Decode.Decoder f e i -> Kdl.Decode.Decoder f e o"},{"name":"argument","comment":" Add a required argument to a node\n\nThe argument takes the form of a [`ValueDecoder`](#ValueDecoder), which will be used to decode the argument itself.  If the argument is absent, however, a `TooFewArguments` error will be returned\n\nOne thing to keep in mind is that arguments are *order sensitive*.  Arguments will be expected to appear in the same order that they are applied to the [`NodeDecoder`](#NodeDecoder) being built.  That is:\n\n    -- Decodes `tuple hi 1` but not `tuple 1 hi`\n    tuple1 = succeed pair\n        |> andApply (argument string)\n        |> andApply (argument int)\n        |> andRequire noOtherArguments\n        |> singleNodeDocument \"tuple\"\n\n    -- Decodes `tuple 1 hi` but not `tuple hi 1`\n    tuple2 = succeed pair\n        |> andApply (argument int)\n        |> andApply (argument string)\n        |> andRequire noOtherArguments\n        |> singleNodeDocument \"tuple\"\n\nSimilarly, if [`noOtherArguments`](#noOtherArguments) or [`arguments`](#arguments) is used, they should be come *after* all other arguments.\n\nIf you'd rather the argument be completely optional, see [`optionalArgument`](#optionalArgument).  If you would like to decode an arbitrary number of arguments all using the same decoder, see [`arguments`](#arguments). \n\nThis function mirrors the behavior of [`property`](#property), but for arguments rather than properties.\n","type":"Kdl.Decode.ValueDecoder e t -> Kdl.Decode.NodeDecoder e t"},{"name":"arguments","comment":" Decodes all remaining arguments into a list\n\nRequires that you provide a decoder which will be used on all arguments which have not yet been decoded.  The results of each decode will be compiled into a list.\n\nThis mirrors the behavior of [`properties`](#properties) but for arguments rather than properties.\n","type":"Kdl.Decode.ValueDecoder e t -> Kdl.Decode.NodeDecoder e (List.List t)"},{"name":"bool","comment":" Decode a Boolean\n\nThis will decode `#true` and `#false` into their Elm `Bool` equivalents\n\nThis will produce a `WrongType` error when applied to non-boolean data, like numbers or strings.\n","type":"Kdl.Decode.ValueDecoder e Basics.Bool"},{"name":"children","comment":" Parse the children of a node\n\nThe children of a node is parsed as just another document.  Any of the functions you use to create [`DocumentDecoder`](#DocumentDecoder)s can be used to construct a document decoder which works for the children of a node.\n\nBy default, any child nodes are simply ignored without fanfare, but you can specify a specific expectation by either using this function or [`noChildren`](#noChildren), which can ensure that the child nodes are what you expect.\n\nSee also:  [`document`](#document)\n","type":"Kdl.Decode.DocumentDecoder e t -> Kdl.Decode.NodeDecoder e t"},{"name":"decode","comment":" Use a decoder to decode a KDL document\n\nAt the end of the day, once you've built up your KDL decoder, this function is\nhow you use it.  Just provide your decoder and a [`Document`](Kdl#Document) to\ndecode, and you'll either get back the data structure your decoder was designed\nfor, or one of your error types if something went wrong.\n","type":"Kdl.Decode.DocumentDecoder e t -> Kdl.Types.Document -> Result.Result (Kdl.Decode.Error e) t"},{"name":"dictDocument","comment":" Decode a dict-like document\n\nFor each node in the document, that node is treated like an entry in a\ndictionary.  The name of the node is seen as the key, and the value is what\nthat node decodes to.  Consider this subsection of the `cargo.kdl` official\nKDL example:\n\n```kdl\ndependencies {\n    nom \"6.0.1\"\n    thiserror \"1.0.22\"\n}\n```\n\nWe could parse this like so:\n\n    decodeDependencyVersion : NodeDecoder String String\n    decodeDependencyVersion =\n        argument string\n        |> andRequire noOtherArguments\n        |> andRequire noOtherProperties\n        |> andRequire noChildren\n\n    decodeDependencies : DocumentDecoder String (Dict String String)\n    decodeDependencies =\n        children (dictDocument decodeDependencyVersion)\n        |> andRequire noOtherArguments\n        |> andRequire noOtherProperties\n        |> singleNodeDocument \"dependencies\"\n\nNotice that this will return `DuplicateNode` if someone\ntries to specify a dependency twice.\n","type":"Kdl.Decode.NodeDecoder e t -> Kdl.Decode.DocumentDecoder e (Dict.Dict String.String t)"},{"name":"document","comment":" Decode a docmunt with an arbitrary number of nodes\n\nThis is the most basic, unspecialized type of document decoder.  It simply\ndecodes all of the nodes that appear in the document, in order, choosing a\n[`NodeDecoder`](#NodeDecoder) based on the provided lookup table.\n\nFor each node to be decoded, its name will be checked against the provided\n`Dict`.  If a decoder is found there, it will be returned.  Otherwise, an\n`UnexpectedNode` error is returned.\n\nIt is often helpful to set `fallbackNodeDecoder` to [`fail`](#fail) with some error.\n\nFor a more powerful version of this, see [`documentF`](#documentF).\n","type":"Dict.Dict String.String (Kdl.Decode.NodeDecoder e t) -> Kdl.Decode.DocumentDecoder e (List.List t)"},{"name":"documentF","comment":" Decode a document with an arbitrary number of nodes, and the power to choose which decoder to use based on an algorithm\n\nSimilar to [`document`][], `documentF` allows for parsing an arbitrary number of\nnodes in a document, ultimately yeilding a list.  But while [`document`][] chose\nhow to decode a node based on a `Dict` lookup, and always failed when the node\nwas absent from the dict, `documentF` allows you to specify your own algorithm\nfor choosing a subsequent decoder.\n\n[`document`]: #document\n","type":"(String.String -> Kdl.Decode.NodeDecoder e t) -> Kdl.Decode.DocumentDecoder e (List.List t)"},{"name":"entries","comment":" Decode an entry which may occur any number of times (including zero)\n\nTakes two arguments:\n - The name of the entries (aka the name of the nodes to look for)\n - A decoder for the node once it's found\n","type":"String.String -> Kdl.Decode.NodeDecoder e t -> Kdl.Decode.DocumentDecoder e (List.List t)"},{"name":"entry","comment":" Decode one entry which should occur exactly once\n\nReturns `MissingNode` when the entry is absent, and `DuplicateEntry` if the entry is present more than once\n\nTakes two arguments:\n - The name of the entry (aka the name of the node to look for)\n - A decoder for the node once it's found\n","type":"String.String -> Kdl.Decode.NodeDecoder e t -> Kdl.Decode.DocumentDecoder e t"},{"name":"failN","comment":" A decoder which always fails with an error of your choice rather than parsing a node\n","type":"e -> Kdl.Decode.NodeDecoder e never"},{"name":"failV","comment":" A decoder which always fails with an error of your choice rather than parsing a value\n","type":"e -> Kdl.Decode.ValueDecoder e never"},{"name":"float","comment":" Decode a number as a floating point\n\nUnlike [`rational`](#rational), this can decode values like NaN (`#nan`) and infinity (`#inf`), but may not necessarily represent a number with maximal position, and can introduce minor numeric errors, so isn't ideal for situations where absolute accuracy is important.\n\nThis will produced a `WrongType` error when applied to non-numeric data, like strings or booleans.\n","type":"Kdl.Decode.ValueDecoder e Basics.Float"},{"name":"guardN","comment":" Require that a condition be true of the value returned by a [`NodeDecoder`](#NodeDecoder)\n\nIf that condition isn't true, then an error of your choice is raised.  Here's\none way you could use this to parse a list that needs at least three elments:\n\n    -- Decodes \"favorite-things \\\"raindrops on roses\\\" \\\"whiskers on kittens\\\" \\\"bright copper kettles\\\"\"\n    -- But fails on \"favorite-things \\\"pussy willows\\\" \\\"christmas\\\"\"\n    decodeFavoriteThings =\n        arguments string\n        |> guardN \"You need to least at least three of your favorite things\" (\\l -> length l >= 3)\n        |> singleNodeDocument \"favorite-things\"\n\nSee also: [`guardV`](#guardV), the [`ValueDecoder`](#ValueDecoder) equivalent of this function\n","type":"e -> (t -> Basics.Bool) -> Kdl.Decode.NodeDecoder e t -> Kdl.Decode.NodeDecoder e t"},{"name":"guardV","comment":" Require that a condition be true of the value returned by a [`ValueDecoder`](#ValueDecoder)\n\nIf that condition isn't true, then an error of your choice is raised.  Here's\na simple example.  Say you want a node `count` that only accepts non-negative\nintegers as an argument.  You could describe this node like this:\n\n    decodeCount =\n        argument (\n            int\n            |> guardV \"can't have a negative count!\" (\\x -> x >= 0)\n        )\n        |> andRequire noOtherArguments\n        |> singleNodeDocument \"count\"\n\nSee also: [`guardN`](#guardN), the [`NodeDecoder`](#NodeDecoder) equivalent of this function\n","type":"e -> (t -> Basics.Bool) -> Kdl.Decode.ValueDecoder e t -> Kdl.Decode.ValueDecoder e t"},{"name":"int","comment":" Decode a number as an integer\n\nThis will decode a value as an integer.  However, it will fail (and return its first argument as an error) if used to decode non-integer data, or any numbers too large or to small to be represented by Elm's `Int` type.\n\nNote that `1.1e1` and `1.0` *are* considered integers.\n\nThis will produced a `WrongType` error when applied to non-numeric data, like strings or booleans.\n","type":"Kdl.Decode.ValueDecoder e Basics.Int"},{"name":"map","comment":" Alter the output type of an existing combinator\n\nSometimes a simple existing decoder isn't enough.  Suppose you want to decode a\npercentage, but in KDL it's represented as an integer between 0 and 100, but in\nyour datastructure, you want to represent it as a floating point between 0.0 and\n1.0. You could represent that decoder like this:\n\n    -- the `float` decoder automatically converts integers to floats\n    decodePercent = float\n        |> map (\\input -> input / 100.0)\n\n**Note:**  This combinator is generic, and can be used with any of the three\ndecoders in this module.\n","type":"(i -> o) -> Kdl.Decode.Decoder f e i -> Kdl.Decode.Decoder f e o"},{"name":"map2","comment":" Require two things to be true of a value\n\nFor those familiar with the JSON decoding module, this function is included to\nmake you feel at home.  But most of the time you'll probably want to use the\n[`andApply`](#andApply) function instead.\n\nThis function runs TWO decoders on one object.  The decode succeeds only if\n*both* of the component decoders succeed.  If that's the case, then the output of\neach constituent decoder is fed to the provided function.\n\n**Note:**  This combinator is generic, and can be used with any of the three\ndecoders in this module.\n","type":"(t1 -> t2 -> o) -> Kdl.Decode.Decoder f e t1 -> Kdl.Decode.Decoder f e t2 -> Kdl.Decode.Decoder f e o"},{"name":"multidictDocument","comment":" Decode a document as if it were a multidict (a dict that can have multiple values associated with a single key)\n\nThis behaves much like [`dictDocument`](#dictDocument), but rather than raise an error when there are multiple nodes with one key, \n","type":"Kdl.Decode.NodeDecoder e t -> Kdl.Decode.DocumentDecoder e (Dict.Dict String.String (List.List t))"},{"name":"noChildren","comment":" Assert that a node does not have any children\n\nInstead of simply ignoring the children of a node, it's often preferable to ensure that the node definitely does not have children, and therefore is less likely to be being used incorrectly.  This function concisely accomplishes that.\n\nEquivalent to `children noOtherEntries`\n\nSee also:  [`children`](#children), [`noOtherEntries`](#noOtherEntries)\n","type":"Kdl.Decode.NodeDecoder e ()"},{"name":"noOtherArguments","comment":" Automatically fails if there are any arguments which have not yet been decoded\n\nBy default, if there are trailing arguments which don't get decoded, they are simply ignored.  For example, the `pair` parser from the [`argument`](#argument) documentation will parse `tuple 1 hi`, but also `tuple 1 hi #nan etc etc`.  This behavior isn't always optimal, since it can lead to users not realizing they're misusing something.  Applying this function causes your parser to error if there are any trailing arguments.\n\nAlso notice that `noOtherArguments` and [`arguments`][] mutually make the other redundant.  When `noOtherArguments` comes first, [`arguments`][] is guaranteed to decode nothing (and produce the empty list).  Meanwhile, if [`arguments`][] comes first, `noOtherArguments` is guaranteed to succeed, as [`arguments`][] is guaranteed to decode all the arguments if it succeeds.\n\nThis mirrors the behavior of [`noOtherProperties`](#noOtherProperties) but for arguments rather than properties.\n\nProduces a `TooManyArguments` error if additional arguments are present\n\n[`arguments`]: #arguments\n","type":"Kdl.Decode.NodeDecoder e ()"},{"name":"noOtherEntries","comment":" Only succeed when a document has no nodes left\n\nAny nodes proccessed by [`entry`](#entry), [`optionalEntry`](#optionalEntry), and [`entries`](#entries) are omitted from the count.\n\nIf no nodes are present (or remain) at all, then a `TooManyNodes` error is produced.\n\nThis can also be used to decode an empty document.\n","type":"Kdl.Decode.DocumentDecoder e ()"},{"name":"noOtherProperties","comment":" Automatically fail if any properties have yet to be decoded\n\nBy default, if there are properties which don't get decoded, they are simply ignored.  This behavior isn't always optimal, since it can lead to users not realizing they're misusing something.  Applying this function causes your parser to error if there are any arguments that are unaccounted for.\n\nThis mirrors the behavior of [`noOtherArguments`](#noOtherArguments) but for properties rather than arguments.\n","type":"Kdl.Decode.NodeDecoder e ()"},{"name":"nodeName","comment":" Decode a node, yeilding its name\n\nIt's still possible to decode other parts of the node using other node decoders.  It's often helpful to use a pattern like the one demonstrated in the example of [`andApply`](#andApply).  If you just need to check that the name is equal to a certain value, you might prefer [`assertNodeName`](#assertNodeName).\n","type":"Kdl.Decode.NodeDecoder e String.String"},{"name":"null","comment":" Require a value to be `#null`\n\nThis decoder only succeeds when applied to the KDL value `#null`.  Its return value is always `unit`, aka the empty tuple, aka `()`.\n\nThis will return a `WrongType` error if anything other than null is decoded.\n","type":"Kdl.Decode.ValueDecoder e ()"},{"name":"oneOfV","comment":" Try several different decoders to see if any work\n\nSometimes, you'll need to decode a value which could have one of several\npossible types.  For example, say you have a `date` node which can be followed\nby either an integer (which should be interpretted as a UNIX timestamp) or\na string (which should be interpretted as a string).  For example, say you have\na `date` node which can be followed by either an integer (which should be\ninterpretted as a UNIX timestamp) or a string (which should be interpretted\nas a string).  In this case, you can't just decode that value using\n[`string`](#string) or [`int`](#int) — you'll need to try both to see which one\nworks. Here's how you can do that with `oneOfV`:\n\n    type MyDate\n        = Datestring String\n        | UnixTime Int\n\n    decodeDate : DocumentDecoder String MyDate\n    decodeDate =\n        argument\n            (\n                oneOfV\n                    [ string |> map Datestring\n                    , int |> map UnixTime\n                    ]\n            )\n        |> andRequire noOtherArguments\n        |> singleNodeDocument \"date\"\n\n    (parse \"date 1733882937\" |> Result.map (decode decodeDate)) == Ok (Ok (UnixTime 1733882937))\n\n`oneOfV` takes a list of decoders that should be tried.\n\nIf all provided decoders fail, a `PossibilitiesExhausted` error is produced\n","type":"List.List (Kdl.Decode.ValueDecoder e t) -> Kdl.Decode.ValueDecoder e t"},{"name":"optionalArgument","comment":" Add an optional argument to a node\n\nIf any (not-yet-decoded) argument is present, this decodes it with the provided decoder.  Notice that the returned parser decodes to `Maybe t` rather than just `t`.  This is because `Nothing` will be the result when the argument is absent.\n\nPlease read the documentation for [`argument`](#argument) for important details regarding ordering.\n\nThis mirrors the behavior of [`optionalProperty`](#optionalProperty) for arguments rather than properties.\n","type":"Kdl.Decode.ValueDecoder e t -> Kdl.Decode.NodeDecoder e (Maybe.Maybe t)"},{"name":"optionalEntry","comment":" Decode an entry which can occur zero or one times\n\nProduces a `DuplicateNode` error if the entry occurs more than once\n\nTakes two arguments:\n - The name of the entry (aka the name of the node to look for)\n - A decoder for the node once it's found\n","type":"String.String -> Kdl.Decode.NodeDecoder e t -> Kdl.Decode.DocumentDecoder e (Maybe.Maybe t)"},{"name":"optionalProperty","comment":" Optionally decode a property\n\nThe resulting node decoder will produce `Nothing` when the property is absent, or `Just` when the property is present and can be decoded by the provided decoder.\n\nSee [`property`](#property) for important notes regarding ordering\n\nAs with other node decoders, you'll probably want to chain this with other decoders using [`andThen`](#andThen) and [`succeed`](#succeed).\n\nThis mirrors the behavior of [`optionalArgument`](#optionalArgument) for properties rather than arguments.\n","type":"String.String -> Kdl.Decode.ValueDecoder e t -> Kdl.Decode.NodeDecoder e (Maybe.Maybe t)"},{"name":"properties","comment":" Decodes an arbitrary number of properties agnostic regardless of key\n\nYou provide a decoder for the value attached to each key, and the decoder decodes each value, and produces a `Dict` mapping each property name to the resulting value.\n\nPay attention to the ordering between this and [`property`][]/[`optionalProperty`][].  Putting either [`property`][] or [`optionalProperty`][] will exclude that property from the set of properties decoded by this function.\n\nThis is, in effect, mutually exclusive with [`noOtherProperties`](#noOtherProperties)\n\nThis mirrors the behavior of [`arguments`](#arguments) but for properties rather than arguments.\n\n[`property`]: #property\n[`optionalProperty`]: #optionalProperty\n","type":"Kdl.Decode.ValueDecoder e t -> Kdl.Decode.NodeDecoder e (Dict.Dict String.String t)"},{"name":"property","comment":" Require that a node have a certain property\n\nThis adds a requirement of a certain property to a node, which must be present on the node for the parse to succeed.  If the property is missing from the node, a `PropertyAbsent` error will be returned.  Otherwise, it's decoded using the `decodePropertyValue` node.  `propertyKey` is the name of the property.\n\nNote that this is *order sensitive*.  When building a decoder, if you first decode a property, then use [`properties`](#properties) or [`noOtherProperties`][], this property will be \"accounted for\", and not count towards the properties decoded by either of those two functions.  Inversely, if you run [`noOtherProperties`][] before running [`property`](#property), the resulting decoder will *always* fail, either because the property was present, but got passed to `noOtherProperties` first, or because it was absent.\n\nThis function mirrors the behavior of [`argument`](#argument) but for properties rather than arguments.\n\n[`noOtherProperties`]: #noOtherProperties\n","type":"String.String -> Kdl.Decode.ValueDecoder e t -> Kdl.Decode.NodeDecoder e t"},{"name":"rational","comment":" Decode any rational number\n\nThis will handle integers, numbers with decimals, and even numbers with exponents, like `120.9312e100`, however, it can't decode special \"numbers\" like NaN (`#nan`) or infinity (`#inf`), and will return its first argument as an error if applied to any of these.\n\nOf course, this will also produced a `WrongType` error when applied to non-numeric data, like strings or booleans.\n","type":"Kdl.Decode.ValueDecoder e BigRational.BigRational"},{"name":"showDecodeError","comment":" Renders a `DecodeError` to a string\n\nTakes as an argument the renderer to use for custom errors.  If your custom\nerror type is `Never`, you can pass the `Basics.never` function here. Custom\nerrors are rendered directly using this function, and the result is returned\nunmodifier.\n\nNote that while this function will try its best to provide friendly error\nmessages, it may be better in some cases to disect the error yourself and\nproduce error messages tailored to the datastructure that you're decoding.\n\nIn particular, the error messages for `PossibilitiesExhausted` will likely be\npoor quality.\n","type":"(e -> String.String) -> Kdl.Decode.Error e -> String.String"},{"name":"singleNodeDocument","comment":" Decode a document with exactly one node with a fixed name\n\nBest used when your document only has one node, and that node should always have the same name.  If you have multiple types of nodes that could appear, you might prefer to use [`singleNodeDocumentF`](#singleNodeDocumentF).\n\nThe first three arguments are error values to return if the document is empty (contains no nodes), if there is an extra node that's unaccounted for, and if the name of the node in the document isn't the expected one.\n\nIf more than one node is present, then a `TooManyNodes` error will be produced.\nIf No nodes are present, a `MissingNode` error will be produced.  If the node\nhas the incorrect name, than an `UnexpectedNode` error will be produced.\n\nThe next two arguments specify the expected name of the node and the [`NodeDecoder`](#NodeDecoder) that should be used for it.\n","type":"String.String -> Kdl.Decode.NodeDecoder e t -> Kdl.Decode.DocumentDecoder e t"},{"name":"singleNodeDocumentF","comment":" Decode a document with exactly one node, but where there might be several possible types of nodes.\n\nRather than only parse a single type of node (with a fixed name), this function lets you conditionally accept or deny multiple types of nodes based on their name.\n\nThe argument is expected to be a function which decides what\n[`NodeDecoder`](#NodeDecoder) to use for a given node name.  If a node\nname is unrecognized/unsupported, then returning `Nothing` will produce a\n`UnexpectedNode` error.\n\nIf the document being parsed is empty, a `NoNodes` error is produced.  If there is more than one node, an `UnexpectedNode` error is produced.\n\nKeep in mind that you can return [`failN`](#failN) to reject a node that has a name you don't support.\n\nSee also:\n- [`singleNodeDocument`](#singleNodeDocument), a version of this function for a fixed node name\n- [`documentF`](#documentF), a version of this which can accept multiple nodes, not just one.\n","type":"(String.String -> Maybe.Maybe (Kdl.Decode.NodeDecoder e t)) -> Kdl.Decode.DocumentDecoder e t"},{"name":"string","comment":" Decode a string\n\nThis will decode any quoted string, bare string, raw string, or multiline string of any variety into an Elm `String`\n\nThis will produced a `WrongType` error when applied to non-string data, like numbers or booleans.\n","type":"Kdl.Decode.ValueDecoder e String.String"},{"name":"succeed","comment":" A decoder that always succeeds and produces a value of your choice\n\n**Note:**  This combinator is generic, and can be used with any of the three decoders in this module.\n","type":"t -> Kdl.Decode.Decoder f e t"}],"binops":[]},{"name":"Kdl.Encode","comment":" Tools for turning Elm values into KDL values\n\n# Encoding Values\n\n@docs Value\n@docs string\n@docs int\n@docs float\n@docs rational\n@docs bool\n@docs null\n\n# Encoding Nodes\n\n@docs Node\n@docs emptyNode\n@docs nodeWithProps\n@docs nodeWithArgs\n@docs node\n\n# Encoding Documents\n\n@docs emptyDocument\n@docs document\n@docs documentFromDict\n","unions":[],"aliases":[{"name":"Node","comment":" A KDL Node, containing arguments, properties, and children\n\nNotably, this representation of nodes does not contain their name, only their\narguments, properties, and children.  The name of the node will be encoded as\npart of the document.  If you wish to track a node's name as well, use the type\n`(String, Node)`.\n","args":[],"type":"String.String -> Kdl.Types.Node"},{"name":"Value","comment":" A KDL Value\n\nThese are the specific values used in argument and properties, like numbers and strings\n","args":[],"type":"Kdl.Types.Value"}],"values":[{"name":"bool","comment":" Encode a boolean into a value\n","type":"Basics.Bool -> Kdl.Encode.Value"},{"name":"document","comment":" Encode a document full of order-signifigant nodes\n","type":"List.List ( String.String, Kdl.Encode.Node ) -> Kdl.Document"},{"name":"documentFromDict","comment":" A document full of unique, order-insignifigant nodes\n","type":"(nodeType -> Kdl.Encode.Node) -> Dict.Dict String.String nodeType -> Kdl.Document"},{"name":"emptyDocument","comment":" A document with no nodes\n","type":"Kdl.Document"},{"name":"emptyNode","comment":" A node without arguments, children, or properties\n","type":"Kdl.Encode.Node"},{"name":"float","comment":" Encode a float into a value\n","type":"Basics.Float -> Kdl.Encode.Value"},{"name":"int","comment":" Encode a integer into a value\n","type":"Basics.Int -> Kdl.Encode.Value"},{"name":"node","comment":" A fallback method for creating your own node encoders when you need a little more power.\n","type":"List.List Kdl.Encode.Value -> Dict.Dict String.String Kdl.Encode.Value -> Kdl.Document -> String.String -> Kdl.Types.Node"},{"name":"nodeWithArgs","comment":" Encode a node with arguments, but no children or properties\n","type":"(argType -> Kdl.Encode.Value) -> Dict.Dict String.String argType -> Kdl.Encode.Node"},{"name":"nodeWithProps","comment":" Encode a node with properties, but no children or arguments\n","type":"(propType -> Kdl.Encode.Value) -> List.List propType -> Kdl.Encode.Node"},{"name":"null","comment":" The value `#null`\n","type":"Kdl.Encode.Value"},{"name":"rational","comment":" Encode a [`BigRational`](https://package.elm-lang.org/packages/nunntom/elm-bigrational/latest/BigRational#BigRational) into a value\n","type":"BigRational.BigRational -> Kdl.Encode.Value"},{"name":"string","comment":" Encode a String into a value\n","type":"String.String -> Kdl.Encode.Value"}],"binops":[]},{"name":"Kdl.Parse","comment":" Everything you need to turn raw text into KDL values\n\n# Core Functions\n@docs parse\n@docs Problem\n\n# Error Message Tooling\n@docs getErrorMessage\n@docs Message\n@docs MessageComponent\n@docs messageToString\n\n## Misc Types\n@docs StringType\n@docs TypeableThing\n","unions":[{"name":"MessageComponent","comment":" One formatting node within a [`Message`][].\n","args":[],"cases":[["PlainText",["String.String"]],["Emphasized",["String.String"]],["LineExerpt",["{ lineNo : Basics.Int, highlightStart : Basics.Int, highlightEnd : Basics.Int, exerpt : String.String }"]],["Link",["String.String"]]]},{"name":"Problem","comment":" Anything that can possibly go wrong while parsing a KDL document\n\nThis type exposes its variants in case you want to write your own error messages for each of these cases, but it's much more likely that you'll want to pass this to [`getErrorMessage()`][], which will generate a pleasant, user-friendly error message for you to show your user.\n\nIn case you are interested in what each variant means, here's the full breakdown: \n- **Unexpected**: This variant should never appear, but if it does, something has gone wrong, and you should file a bug report with this library.\n- **UnrecognizedEscapeCode**: The user has used an escape code which doesn't have a mapping, e.g. `\\p`.  Describes the location of the string (`strLoc`), the location of the escape sequence (`escLoc`), and the character used (`char`).\n- **UnicodeEscapeNotOpened**: The parser encountered a unicode escape (`\\u`), but there wasn't a character following it.  Describes the location of the string it appeared in (`strLoc`) nad the position of the unicode escape (`escLoc`).\n- **UnicodeEscapeEmpty**: The parser encountered an empty unicode escape (`\\u{}`).  Describes the location of the string it appeared in (`strLoc`) and the location of the full escape sequence (`escLoc`).\n- **UnicodeEscapeInvalidCharacters**: A unicode escape contained characters outside of the hexadecimal set.  Describes the location of the string containing it (`strLoc`) and the full escape sequence (`escLoc`).\n- **UnicodeEscapeTooLong**: A unicode escape contained more than six characters.  Describes the location of the string containing it (`strLoc`) and the full escape sequence (`escLoc`).\n- **UnicodeEscapeNotClosed**: A unicode escape was opened, but never closed.  Describes the location of the string containing it (`strLoc`) and the position that the escape sequence starts (`escLoc`).\n- **UnicodeEscapeBadCodepoint**: The user tried to encode a unicode codepoint that wasn't a valid unicode character.  Describes the location of the string containing it (`strLoc`) and the location of the full escape sequence (`escLoc`).\n- **UnclosedString**: A string was opened, but the end of the input was reached and an end was never found.  Describes the start of the string (`strStart`) and what kind of string it was (`strType`).\n- **UnclosedType**: A type was opened, but never closed.  Describes the what kind of thing the type was accompanying (`typeOf`), the location of the opening parenthesis of the type (`typeStart`), and the position in the source where the parser gave up trying to parse the type (`gaveUpAt`).\n- **MalformedRawStringOpening**: A raw string was started, but no double-quote followed the pound signs.  Describes the start of the string (`stringStart`) and the character where the double quote would have gone (`nonQuotationCharacter`).\n- **MalformedNumber**: A number was malformed.  Describes the first character of the number (`numberStart`) and the first malformed character (`malformedAt`).\n- **UnclosedMultilineComment**: A multiline comment was opened and never closed.  Describes the start of the comment (`commentStart`).\n- **UnclosedChildBlock**: A child block was opened and never closed.  Describes the start of the block (`blockStart`).\n- **MissingValue**: A property was defined (`myprop=`), but wasn't followed by anything that looked like a value.  Describes the location of the property (`property`) and the place where the value ought to go (`absentValue`).\n- **InvalidIdentifier**: An identifier was malformed.  Describes the start of the identifier (`identifierStart`) and the position of the first bad character (`confusedAt`).\n- **UnfinishedEscline**: A backslash was seen, but wasn't followed by a newline.  Describes the position of the backslash (`backslashLoc`) and the place where a newline was expected (`nextChar`).\n- **MalformedNodeComponent**: A catchall for weird things in a node.  Describes the start of the node (`nodeStart`) and the position where the confusing thing was seen (`badElement`).\n- **ForbiddenCharacter**: A unicode character which must never appear unescaped in a KDL document appeared in the source.  Describes the location of the forbidden character (`charPos`).\n- **BareStringConfusableWithKeyword**: A bare string was used that looked like a keyword (e.g. `true`, `inf`).  Describes the location of the bare string (`strLoc`).\n- **BareStringConfusableWithNumber**: A bare string was used that looked like a number (e.g. `+.1name`, `-0lol`).  Describes the location of the bare string (`strLoc`).\n- **UnrecognizedKeyword**: A keyword (e.g. `#true`) was used that wasn't recognized.  Describes the location of the keyword (`keywordLoc`).\n- **NewlineInMonolineString**: A string contained an unescaped newline, but it wasn't a multiline string (i.e. the opening quote wasn't immediately followed by a newline).  Describes the location of the string (`strLoc`) and newline (`newlineLoc`).\n- **MultilineStringTrailingCharacters**: A multiline string had characters on the last line.  Describes the location of the string (`strLoc`) and trailing characters (`trailingChars`).\n- **MultilineStringLineLacksPrefix**: A multiline string contains a line that doesn't begin with the necessary whitespace.  Describes the location of the string (`strLoc`) and characters that protrude before the acceptable start of the line (`violatingChars`).\n- **MultilineStringMismatchedPrefixSpace**: A multiline string contains a line that begins with the wrong type (e.g. tab vs space) of whitespace.  Describes the location of the string (`strLoc`), offending whitespace (`offendingChar`), what was expected according to the prefix established by the last line (`expected`) and what character was actually seen (`got`).\n- **LonelyType**: A type was written, but not followed by anything.  Describes whether the type belonged to a value or a node (`ofValue`), the location of the type (`typeLoc`), the character which the parser got stuck on (`stuckAt`).\n- **TooManyChildBlocks**: A node has more than one child block.  Describes whether the location of the node (`nodeLoc`), and the locations of the first and second uncommented child blocks (`firstBlock`/`secondBlock`).\n- **OldStyleRawString**: The user tried to use an old style raw string (i.e. `r##\"` rather than `##\"`).  Describes whether the location of the opening prefix (`prefixLoc`).\n- **UnsupportedVersion**: The version comment at the top of the document claims that the document is written using a version of KDL that this parser doesn't support.  Contains the source location of the reported version (`documentVersion`).\n\n[`getErrorMessage()`]: #getErrorMessage\n","args":[],"cases":[["Unexpected",["Kdl.Types.Position","String.String"]],["UnrecognizedEscapeCode",["{ strLoc : Kdl.Types.Position, escLoc : Kdl.Types.SourceRange, char : Char.Char }"]],["UnicodeEscapeNotOpened",["{ strLoc : Kdl.Types.Position, escLoc : Kdl.Types.SourceRange }"]],["UnicodeEscapeEmpty",["{ strLoc : Kdl.Types.Position, escLoc : Kdl.Types.SourceRange }"]],["UnicodeEscapeInvalidCharacters",["{ strLoc : Kdl.Types.Position, escLoc : Kdl.Types.SourceRange }"]],["UnicodeEscapeTooLong",["{ strLoc : Kdl.Types.Position, escLoc : Kdl.Types.SourceRange }"]],["UnicodeEscapeNotClosed",["{ strLoc : Kdl.Types.SourceRange, escLoc : Kdl.Types.Position }"]],["UnicodeEscapeBadCodepoint",["{ strLoc : Kdl.Types.Position, escLoc : Kdl.Types.SourceRange }"]],["UnclosedString",["{ strType : Kdl.Parse.StringType, strStart : Kdl.Types.Position }"]],["UnclosedType",["{ typeOf : Kdl.Parse.TypeableThing, typeStart : Kdl.Types.Position, gaveUpAt : Kdl.Types.Position }"]],["MalformedRawStringOpening",["{ stringStart : Kdl.Types.SourceRange, nonQuotationCharacter : Kdl.Types.Position }"]],["MalformedNumber",["{ numberStart : Kdl.Types.Position, malformedAt : Kdl.Types.Position }"]],["UnclosedMultilineComment",["{ commentStart : Kdl.Types.Position }"]],["UnclosedChildBlock",["{ blockStart : Kdl.Types.Position }"]],["MissingValue",["{ property : Kdl.Types.SourceRange, absentValue : Kdl.Types.Position }"]],["InvalidIdentifier",["{ identifierStart : Kdl.Types.Position, confusedAt : Kdl.Types.Position }"]],["UnfinishedEscline",["{ backslashLoc : Kdl.Types.Position, nextChar : Kdl.Types.Position }"]],["MalformedNodeComponent",["{ nodeStart : Kdl.Types.Position, badElement : Kdl.Types.Position }"]],["ForbiddenCharacter",["{ charPos : Kdl.Types.Position }"]],["BareStringConfusableWithKeyword",["{ strLoc : Kdl.Types.SourceRange }"]],["BareStringConfusableWithNumber",["{ strLoc : Kdl.Types.SourceRange }"]],["UnrecognizedKeyword",["{ keywordLoc : Kdl.Types.SourceRange }"]],["NewlineInMonolineString",["{ strLoc : Kdl.Types.SourceRange, newlineLoc : Kdl.Types.Position }"]],["MultilineStringTrailingCharacters",["{ strLoc : Kdl.Types.SourceRange, trailingChars : Kdl.Types.SourceRange }"]],["MultilineStringLineLacksPrefix",["{ strLoc : Kdl.Types.SourceRange, violatingChars : Kdl.Types.SourceRange }"]],["MultilineStringMismatchedPrefixSpace",["{ strLoc : Kdl.Types.SourceRange, offendingChar : Kdl.Types.Position, expected : Char.Char, got : Char.Char }"]],["MultilineStringWithOneLine",["{ strLoc : Kdl.Types.SourceRange }"]],["SingleLineStringWithMultipleLines",["{ strLoc : Kdl.Types.SourceRange }"]],["LonelyType",["{ ofValue : Basics.Bool, typeLoc : Kdl.Types.SourceRange, stuckAt : Kdl.Types.Position }"]],["TooManyChildBlocks",["{ nodeLoc : Kdl.Types.SourceRange, firstBlock : Kdl.Types.SourceRange, secondBlock : Kdl.Types.SourceRange }"]],["OldStyleRawString",["{ prefixLoc : Kdl.Types.SourceRange }"]],["UnsupportedVersion",["{ documentVersion : Kdl.Types.SourceRange }"]]]},{"name":"StringType","comment":" The possible types of strings in KDL\n","args":[],"cases":[]},{"name":"TypeableThing","comment":" Things in KDL which may have a type applied to them.\n\nNote:  The `TProperty` variant represents a property whose value is typed.  The associated [`SourceRange`](Kdl#SourceRange) is the location of the property's key.\n","args":[],"cases":[]}],"aliases":[{"name":"Message","comment":" Text with some very simple non-recursive markup\n","args":[],"type":"List.List Kdl.Parse.MessageComponent"}],"values":[{"name":"getErrorMessage","comment":" Converts a [`Problem`](Kdl.Parse#Problem) into a user-friendly message.\n\nTakes as arguments the full text of the source (for giving explanatory exerpts) and the problem to serialize.  The result is returned as a [`Message`](Kdl.Parse#Message), which represents some basic text with very simple code formatting applied.  I recommend using the `Message` to construct rich text in whatever format you can give to the reader, and take full advantage of the markup, but you can also use [`messageToString()`](Kdl.Parse#messageToString) to strip most formatting and return raw text.\n","type":"String.String -> Kdl.Parse.Problem -> Kdl.Parse.Message"},{"name":"messageToString","comment":" Strip most formatting from a [`Message`][] and render it to a string\n\nIf possible, it's nice to write a bespoke translator from [`Message`][] into whatever rich text formatting you're using to display to the user (most likely HTML), but this method provides a simple alternative if you're so inclined.\n\n[`Message`]: Kdl.Parse#Message\n","type":"Basics.Int -> Kdl.Parse.Message -> String.String"},{"name":"parse","comment":" Take a string and try to parse the KDL out of it\n\nThis always tries to parse a whole document, meaning it returns a list of nodes.  If it fails, it'll return a [`Problem`][] to give a very specific reason why it failed that you can use to give the user a description of what went wrong and potentially how to fix with it.\n","type":"String.String -> Result.Result Kdl.Parse.Problem Kdl.Types.Document"}],"binops":[]},{"name":"Kdl.Serialize","comment":" Turn KDL documents into `String`s\n\n@docs document\n","unions":[],"aliases":[],"values":[{"name":"document","comment":" Convert a KDL document into a `String`\n","type":"Kdl.Types.Document -> String.String"}],"binops":[]}]