[{"name":"Edn","comment":" The main union type representing an Extensible Data Notation document.\n\n\n# Definition\n\n@docs Edn\n\n","unions":[{"name":"Edn","comment":" Union type representing different EDN values. There are a few noteworthy cases\nwhere data structures differ slightly from their EDN counterparts. There are no\nequivalent \"Maps\" in Elm, so `EdnMap` is represented as `(List (Edn, Edn))`.\n\nSimilarly, a set is just a `List Edn` type because sets in Elm must be made from\ncomparables.\n\nKeywords are a tuple with the first item being an optional namespace.\n\nTags start with a tuple that contain the _required_ namespace and tag name consecutively,\nbefore the EDN value that they annotate.\n\n","args":[],"cases":[["EdnString",["String.String"]],["EdnVariable",["String.String"]],["EdnKeyword",["Maybe.Maybe String.String","String.String"]],["EdnList",["List.List Edn.Edn"]],["EdnVector",["Array.Array Edn.Edn"]],["EdnMap",["List.List ( Edn.Edn, Edn.Edn )"]],["EdnSet",["List.List Edn.Edn"]],["EdnNil",[]],["EdnBool",["Basics.Bool"]],["EdnInt",["Basics.Int"]],["EdnFloat",["Basics.Float"]],["EdnChar",["Char.Char"]],["EdnTag",["String.String","String.String","Edn.Edn"]],["EdnSymbol",["String.String"]]]}],"aliases":[],"values":[],"binops":[]},{"name":"Edn.Parser","comment":" A parser for the `Edn` union type, for use with [elm/parser](https://package.elm-lang.org/packages/elm/parser/latest/).\nSupports full extensibility through custom data readers.\n\n\n# Main Functionality\n\n@docs edn, run, Error\n\n\n# Extensibility\n\n@docs Definitions, applyDataReaders\n\n","unions":[],"aliases":[{"name":"Definitions","comment":" Just as Clojure supports Edn extensibility through data\\_readers.clj maps, this parser supports\nsupplying definitions to apply transformations to tagged values under a certain namespace. The\nDefinitions type is a tuple of the namespace to interpret, and a dictionary of transforms for\ntags under that namespace.\n\nHere is a short example of a \"sum\" tag under our application namespace that will sum up Edn integers\nin a list following it\n\n","args":["error"],"type":"( String.String, Dict.Dict String.String (Edn.Edn -> Result.Result error Edn.Edn) )"},{"name":"Error","comment":" Convenience type alias for `elm/parser`'s `List DeadEnd` type\n","args":[],"type":"List.List Parser.DeadEnd"}],"values":[{"name":"applyDataReaders","comment":" Apply a set of Defintions to an Edn value.\nHere is a full example of how we might add extensibility to Edn data consumed by our application\n\n    ednWithTags : String\n    ednWithTags =\n        \"\"\"{:sum #test-app/int-add (6 3)}\"\"\"\n\n    type TestAppError\n        = InvalidIntSumArg Edn\n        | ParserError Edn.Parser.Error\n\n    testAppDefinitions : Definitions TestAppError\n    testAppDefinitions =\n        ( \"test-app\"\n        , Dict.fromList\n            [ ( \"int-add\"\n              , \\args ->\n                    case args of\n                        EdnList ((EdnInt a) :: (EdnInt b) :: []) ->\n                            Ok (EdnInt (a + b))\n\n                        _ ->\n                            Err (InvalidIntSumArg args)\n              )\n            ]\n        )\n\n    result =\n        ednWithTags\n            |> (Edn.Parser.run >> Result.mapError ParserError)\n            |> Result.map (Edn.Parser.applyDataReaders testAppDefinitions)\n\n","type":"Edn.Parser.Definitions error -> Edn.Edn -> Result.Result error Edn.Edn"},{"name":"edn","comment":" Parser for the Edn datatype\n","type":"Parser.Parser Edn.Edn"},{"name":"run","comment":" Convenience function for using `elm/parser` to run the `edn` parser in this module against\na given string\n","type":"String.String -> Result.Result (List.List Parser.DeadEnd) Edn.Edn"}],"binops":[]}]