[{"name":"Edn.Decode","comment":" Decode Edn values into Elm values. It mimics the API design of `elm/json` fairly closely.\n\n\n# Types\n\n@docs Decoder\n\n\n# Running Decoders\n\n@docs decodeString, decodeEdn\n\n\n# Decoders\n\n@docs int, float, string, bool, char, keyword, symbol, nil, list, vector, set, setBy, ednMap, ednMapBy, tag, tagWith, tagTransform, raw, fail, succeed\n\n\n# Combinators\n\n@docs andMap, andThen, atIndex, atKey, map, map2, map3, map4, map5, map6, map7, map8, oneOf, optional, try\n\n","unions":[],"aliases":[{"name":"Decoder","comment":" Type alias over the function that decodes an edn value into an elm value\n","args":["a"],"type":"Edn.Decode.Context -> Edn.Edn -> Result.Result String.String a"}],"values":[{"name":"andMap","comment":" Chain decoders to apply all their results to a constructor one after the other.\nOften used in conjection with \"succeed\" to start the chain. It is\nadvisable to use `map2`, `map3`, `map4`, etc for better positional error messaging.\n\n    import Edn exposing (Edn(..))\n    import Edn.Decode exposing (succeed, int, bool, decodeString)\n\n    type alias MyRecord =\n        { foo : Int\n        , bar : Int\n        , baz : Bool\n        }\n\n    Expect.equal\n        (decodeString\n            (succeed MyRecord\n                |> andMap (atKey (EdnString \"foo\") int)\n                |> andMap (atKey (EdnString \"bar\") int)\n                |> andMap (atKey (EdnString \"baz\") bool)\n            )\n            \"\"\"{\"foo\" 1, \"bar\" 2, \"baz\" true\"}\"\"\"\n        )\n        (Ok ( 1, 2, True ))\n\n","type":"Edn.Decode.Decoder a -> Edn.Decode.Decoder (a -> b) -> Edn.Decode.Context -> Edn.Edn -> Result.Result String.String b"},{"name":"andThen","comment":" Compose a decoder with another decoder that acts on the previous result\n","type":"(a -> Edn.Decode.Decoder b) -> Edn.Decode.Decoder a -> Edn.Decode.Context -> Edn.Edn -> Result.Result String.String b"},{"name":"atIndex","comment":" Combinator to decode a certain index in an edn vector.\nNote that unlike vectors, lists in edn are not indexed, so this combinator will not work on lists.\n\n    import Edn exposing (Edn(..))\n    import Edn.Decode exposing (atIndex, bool, decodeString)\n\n    Expect.equal\n        (decodeString\n            (list (atIndex 1 bool))\n            \"[8 true nil]\"\n        )\n        (Ok [ True ])\n\nThese can be nested to get values in vectors of vectors of vectors...\n\n    import Edn exposing (Edn(..))\n    import Edn.Decode exposing (atIndex, int, decodeString)\n\n    Expect.equal\n        (decodeString\n            (atIndex 0 <|\n                atIndex 0 <|\n                    atIndex 0 <|\n                        int\n            )\n            \"\"\"[[[1]]]\"\"\"\n        )\n        (Ok 1)\n\n","type":"Basics.Int -> Edn.Decode.Decoder a -> Edn.Decode.Decoder a"},{"name":"atKey","comment":" Combinator to decode a certain key in an edn map\n\n    import Edn exposing (Edn(..))\n    import Edn.Decode exposing (atKey, int, decodeString)\n\n    Expect.equal\n        (decodeString\n            (atKey (EdnKeyword (Just \"foo\") \"bar\") int)\n            \"{:foo/bar 1}\"\n        )\n        (Ok 1)\n\nThese can be nested to get values in maps of maps of maps...\n\n    import Edn exposing (Edn(..))\n    import Edn.Decode exposing (atKey, int, decodeString)\n\n    Expect.equal\n        (decodeString\n            (atKey (EdnString \"foo\") <|\n                atKey (EdnString \"bar\") <|\n                    atKey (EdnString \"baz\") <|\n                        int\n            )\n            \"\"\"{\"foo\" {\"bar\" {\"baz\" 1}}}\"\"\"\n        )\n        (Ok 1)\n\n","type":"Edn.Edn -> Edn.Decode.Decoder a -> Edn.Decode.Decoder a"},{"name":"bool","comment":" Decode an edn bool into an elm `Bool`\n","type":"Edn.Decode.Context -> Edn.Edn -> Result.Result String.String Basics.Bool"},{"name":"char","comment":" Decode an edn char into an elm `Char`.\n\nKeep in mind the way edn strings escape unicode is different than in Elm strings.\n\n","type":"Edn.Decode.Context -> Edn.Edn -> Result.Result String.String Char.Char"},{"name":"decodeEdn","comment":" apply a decoder to a raw `Edn` value to get a result.\n\nThe `Edn` type is described in [edn-parser](https://package.elm-lang.org/packages/abradley2/edn-parser/latest/Edn)\n\n","type":"Edn.Decode.Decoder a -> Edn.Edn -> Result.Result String.String a"},{"name":"decodeString","comment":" apply a decoder to a string value to get a result\n","type":"Edn.Decode.Decoder a -> String.String -> Result.Result String.String a"},{"name":"ednMap","comment":" Decode an edn map and apply two decoders to each key and value of the map\nrespectively. Edn maps can have keys of any type so this decodes into a list\nof key/value tuples.\n\nTo decode into an Elm `Dict`, use `ednMapBy` instead.\n\n","type":"Edn.Decode.Decoder key -> Edn.Decode.Decoder value -> Edn.Decode.Context -> Edn.Edn -> Result.Result String.String (List.List ( key, value ))"},{"name":"ednMapBy","comment":" Decode an edn map and apply two decoders to each key and value of the map\nrespectively.\n\nAccepts an additional argument that maps the keys to `comparable` types in order to return\nan Elm `Dict`.\n\n","type":"Edn.Decode.Decoder key -> Edn.Decode.Decoder value -> (key -> comparable) -> Edn.Decode.Decoder (Dict.Dict comparable value)"},{"name":"fail","comment":" Lift a failure into a decoder\n","type":"String.String -> Edn.Decode.Context -> Edn.Edn -> Result.Result String.String a"},{"name":"float","comment":" Decode an edn float into an elm `Float`\n","type":"Edn.Decode.Context -> Edn.Edn -> Result.Result String.String Basics.Float"},{"name":"int","comment":" Decode an edn int into an elm `Int`\n","type":"Edn.Decode.Context -> Edn.Edn -> Result.Result String.String Basics.Int"},{"name":"keyword","comment":" Decode an edn keyword into an elm `Tuple` consisting of an optional namespace and then\nthe keyword\n","type":"Edn.Decode.Context -> Edn.Edn -> Result.Result String.String ( Maybe.Maybe String.String, String.String )"},{"name":"list","comment":" Decode an edn list and apply a decoder to each element of the list.\n","type":"Edn.Decode.Decoder a -> Edn.Decode.Context -> Edn.Edn -> Result.Result String.String (List.List a)"},{"name":"map","comment":" Transform a value from a decoder\n","type":"(a -> b) -> Edn.Decode.Decoder a -> Edn.Decode.Context -> Edn.Edn -> Result.Result String.String b"},{"name":"map2","comment":" The equivalent of chaining `andMap` twice following `succeed`\n\n    map2 MyRecord\n        (atKey (EdnString \"foo\") int)\n        (atKey (EdnString \"bar\") int)\n\nis equivalent to\n\n    succeed MyRecord\n        |> andMap (atKey (EdnString \"foo\") int)\n        |> andMap (atKey (EdnString \"bar\") int)\n\n","type":"(a -> b -> c) -> Edn.Decode.Decoder a -> Edn.Decode.Decoder b -> Edn.Decode.Decoder c"},{"name":"map3","comment":" The equivalent of chaining `andMap` three times following `succeed`\n\n    map3 MyRecord\n        (atKey (EdnString \"foo\") int)\n        (atKey (EdnString \"bar\") int)\n        (atKey (EdnString \"baz\") bool)\n\nis equivalent to\n\n    succeed MyRecord\n        |> andMap (atKey (EdnString \"foo\") int)\n        |> andMap (atKey (EdnString \"bar\") int)\n        |> andMap (atKey (EdnString \"baz\") bool)\n\n","type":"(a -> b -> c -> d) -> Edn.Decode.Decoder a -> Edn.Decode.Decoder b -> Edn.Decode.Decoder c -> Edn.Decode.Decoder d"},{"name":"map4","comment":" The equivalent of chaining `andMap` four times following `succeed`.\nSee the documentation of `map2` and `map3` for examples.\n","type":"(a -> b -> c -> d -> e) -> Edn.Decode.Decoder a -> Edn.Decode.Decoder b -> Edn.Decode.Decoder c -> Edn.Decode.Decoder d -> Edn.Decode.Decoder e"},{"name":"map5","comment":" The equivalent of chaining `andMap` five times following `succeed`.\nSee the documentation of `map2` and `map3` for examples.\n","type":"(a -> b -> c -> d -> e -> f) -> Edn.Decode.Decoder a -> Edn.Decode.Decoder b -> Edn.Decode.Decoder c -> Edn.Decode.Decoder d -> Edn.Decode.Decoder e -> Edn.Decode.Decoder f"},{"name":"map6","comment":" The equivalent of chaining `andMap` six times following `succeed`.\nSee the documentation of `map2` and `map3` for examples.\n","type":"(a -> b -> c -> d -> e -> f -> g) -> Edn.Decode.Decoder a -> Edn.Decode.Decoder b -> Edn.Decode.Decoder c -> Edn.Decode.Decoder d -> Edn.Decode.Decoder e -> Edn.Decode.Decoder f -> Edn.Decode.Decoder g"},{"name":"map7","comment":" The equivalent of chaining `andMap` seven times following `succeed`.\nSee the documentation of `map2` and `map3` for examples.\n","type":"(a -> b -> c -> d -> e -> f -> g -> h) -> Edn.Decode.Decoder a -> Edn.Decode.Decoder b -> Edn.Decode.Decoder c -> Edn.Decode.Decoder d -> Edn.Decode.Decoder e -> Edn.Decode.Decoder f -> Edn.Decode.Decoder g -> Edn.Decode.Decoder h"},{"name":"map8","comment":" The equivalent of chaining `andMap` eight times following `succeed`.\nSee the documentation of `map2` and `map3` for examples.\n","type":"(a -> b -> c -> d -> e -> f -> g -> h -> i) -> Edn.Decode.Decoder a -> Edn.Decode.Decoder b -> Edn.Decode.Decoder c -> Edn.Decode.Decoder d -> Edn.Decode.Decoder e -> Edn.Decode.Decoder f -> Edn.Decode.Decoder g -> Edn.Decode.Decoder h -> Edn.Decode.Decoder i"},{"name":"nil","comment":" Decode an edn nil into `()`. This isn't super useful except for handling optional values\nin combination with `oneOf`, but you likely just want to use the `optional` combinator instead.\n","type":"Edn.Decode.Context -> Edn.Edn -> Result.Result String.String ()"},{"name":"oneOf","comment":" Try a list of decoders and take the first successful value or\nreturn the first error\n","type":"List.List (Edn.Decode.Decoder a) -> Edn.Decode.Decoder a"},{"name":"optional","comment":" Decode a value that may also be an edn nil into an elm `Maybe`.\nThis is not for decoders that may fail in any other. Use `try` for that.\n","type":"Edn.Decode.Decoder a -> Edn.Decode.Decoder (Maybe.Maybe a)"},{"name":"raw","comment":" A decoder that doesn't do anything, and just returns a raw `Edn` value.\n\nThe `Edn` type is described in [edn-parser](https://package.elm-lang.org/packages/abradley2/edn-parser/latest/Edn)\n\n","type":"Edn.Decode.Context -> Edn.Edn -> Result.Result String.String Edn.Edn"},{"name":"set","comment":" Decode an edn set and apply a decoder to each element of the set.\n\nThis decoder will return a list of the decoded values, not a set. To get\nan Elm set, use `setBy` instead, which requires you to convert the set values\ninto `comparable` values.\n\n","type":"Edn.Decode.Decoder a -> Edn.Decode.Context -> Edn.Edn -> Result.Result String.String (List.List a)"},{"name":"setBy","comment":" Decode an edn set and apply a decoder to each element of the set.\n\nThe second argument is a function which takes each decoded item\nand returns it as a `comparable` so that it may properly populate\nan Elm `Set`\n\n","type":"Edn.Decode.Decoder a -> (a -> comparable) -> Edn.Decode.Decoder (Set.Set comparable)"},{"name":"string","comment":" Decode an edn string into an elm `String`\n","type":"Edn.Decode.Context -> Edn.Edn -> Result.Result String.String String.String"},{"name":"succeed","comment":" Lift a value into a decoder\n","type":"a -> Edn.Decode.Context -> Edn.Edn -> Result.Result String.String a"},{"name":"symbol","comment":" Symbols in edn can represent special names and operations\nthat are neither keywords or strings. They're generally only needed for complex situations\nlike DSL's\n\n    type Operator\n        = Sum\n        | Prod\n        | Div\n\n    opDecoder : Decoder Operator\n    opDecoder =\n        oneOf\n            [ symbol \"+\" |> map (\\_ -> Sum)\n            , symbol \"*\" |> map (\\_ -> Prod)\n            , symbol \"/\" |> map (\\_ -> Div)\n            ]\n\n","type":"String.String -> Edn.Decode.Context -> Edn.Edn -> Result.Result String.String String.String"},{"name":"tag","comment":" Decode an edn tag into an elm `Tuple` consisting of a required namespace, a tag name,\nand then a nested edn value for the decoder argument. Only really useful if you are unaware\nof the tag being received. You will usually want to use `tagTransform` or `tagWith` instead.\n","type":"Edn.Decode.Decoder a -> Edn.Decode.Context -> Edn.Edn -> Result.Result String.String ( String.String, String.String, a )"},{"name":"tagTransform","comment":" Decode a specific tag with a given namespace and tagname, and apply a transform that may\nfail\n","type":"Edn.Decode.Decoder a -> ( String.String, String.String ) -> (a -> Result.Result String.String b) -> Edn.Decode.Context -> Edn.Edn -> Result.Result String.String b"},{"name":"tagWith","comment":" Decode a specific tag with a given namespace and a tagname\n","type":"Edn.Decode.Decoder a -> ( String.String, String.String ) -> Edn.Decode.Context -> Edn.Edn -> Result.Result String.String a"},{"name":"try","comment":" Force a decoder to succeed by nesting the `Result` returned in an `Ok` value.\nUseful for ignoring errors for particularly troublesome data without losing the\nerror details.\n","type":"Edn.Decode.Decoder a -> Edn.Decode.Context -> Edn.Edn -> Result.Result String.String (Result.Result String.String a)"},{"name":"vector","comment":" Decode an edn vector into an Elm `Array`, applying the decoder to each item\n","type":"Edn.Decode.Decoder a -> Edn.Decode.Context -> Edn.Edn -> Result.Result String.String (Array.Array a)"}],"binops":[]}]