[
    {
        "name": "Json.Encode.Extra",
        "comment": " Convenience functions for turning Elm values into Json values.\n\n\n# Maybe\n\n@docs maybe\n\n",
        "unions": [],
        "aliases": [],
        "values": [
            {
                "name": "maybe",
                "comment": " Encode a Maybe value. If the value is `Nothing` it will be encoded as `null`\n\n    import Json.Encode exposing (int, null)\n\n    maybe int (Just 50)\n    --> int 50\n\n    maybe int Nothing\n    --> null\n\n",
                "type": "(a -> Value) -> Maybe a -> Value"
            }
        ],
        "binops": []
    },
    {
        "name": "Json.Decode.Extra",
        "comment": " Convenience functions for working with Json\n\nExamples assume the following imports:\n\n    import Json.Decode exposing (..)\n    import Date\n    import Set\n    import Dict\n\n\n# Date\n\n@docs date\n\n\n# Incremental Decoding\n\n@docs andMap, (|:)\n\n\n# List\n\n@docs sequence, indexedList\n\n\n# Set\n\n@docs set\n\n\n# Dict\n\n@docs dict2\n\n\n# Maybe\n\n@docs withDefault, optionalField\n\n\n# Result\n\n@docs fromResult\n\n\n# Encoded strings\n\n@docs parseInt, parseFloat, doubleEncoded\n\n",
        "unions": [],
        "aliases": [],
        "values": [
            {
                "name": "andMap",
                "comment": " Can be helpful when decoding large objects incrementally.\n\nSee [the `andMap` docs](https://github.com/elm-community/json-extra/blob/2.0.0/docs/andMap.md)\nfor an explanation of how `andMap` works and how to use it.\n\n",
                "type": "Decoder a -> Decoder (a -> b) -> Decoder b"
            },
            {
                "name": "date",
                "comment": " Extract a date using [`Date.fromString`](http://package.elm-lang.org/packages/elm-lang/core/latest/Date#fromString)\n\n    \"\"\" \"2012-04-23T18:25:43.511Z\" \"\"\"\n        |> decodeString date\n    --> Date.fromString \"2012-04-23T18:25:43.511Z\"\n\n    \"\"\" \"foo\" \"\"\"\n        |> decodeString date\n    --> Err \"I ran into a `fail` decoder: Unable to parse 'foo' as a date. Dates must be in the ISO 8601 format.\"\n\n",
                "type": "Decoder Date"
            },
            {
                "name": "dict2",
                "comment": " Extract a dict using separate decoders for keys and values.\n\n    \"\"\" { \"1\": \"foo\", \"2\": \"bar\" } \"\"\"\n        |> decodeString (dict2 int string)\n    --> Ok <| Dict.fromList [ ( 1, \"foo\" ), ( 2, \"bar\" ) ]\n\n",
                "type": "Decoder comparable -> Decoder v -> Decoder (Dict comparable v)"
            },
            {
                "name": "doubleEncoded",
                "comment": " Extract a JSON-encoded string field\n\n\"Yo dawg, I heard you like JSON...\"\n\nIf someone has put JSON in your JSON (perhaps a JSON log entry, encoded\nas a string) this is the function you're looking for. Give it a decoder\nand it will return a new decoder that applies your decoder to a string\nfield and yields the result (or fails if your decoder fails).\n\n    \"\"\" { \"logs\": \"[\\\\\"log1\\\\\", \\\\\"log2\\\\\"]\"} \"\"\"\n        |> decodeString\n            (field \"logs\" <| doubleEncoded (list string))\n    --> Ok [ \"log1\", \"log2\" ]\n\n",
                "type": "Decoder a -> Decoder a"
            },
            {
                "name": "fromResult",
                "comment": " Transform a result into a decoder\n\nSometimes it can be useful to use functions that primarily operate on\n`Result` in decoders. An example of this is `Json.Decode.Extra.date`. It\nuses the built-in `Date.fromString` to parse a `String` as a `Date`, and\nthen converts the `Result` from that conversion into a decoder which has\neither already succeeded or failed based on the outcome.\n\n    date : Decoder Date\n    date =\n        string |> andThen (Date.fromString >> fromResult)\n\n    \"\"\" \"4\" \"\"\"\n        |> decodeString (string |> andThen (\\s -> String.toInt s |> fromResult))\n    --> Ok 4\n\n",
                "type": "Result String a -> Decoder a"
            },
            {
                "name": "indexedList",
                "comment": " Get access to the current index while decoding a list element.\n\n    \"\"\" [ \"a\", \"b\", \"c\", \"d\" ] \"\"\"\n        |> decodeString (indexedList (\\idx -> map (String.repeat idx) string))\n    --> Ok [ \"\", \"b\", \"cc\", \"ddd\" ]\n\n",
                "type": "(Int -> Decoder a) -> Decoder (List a)"
            },
            {
                "name": "optionalField",
                "comment": " If a field is missing, succeed with `Nothing`. If it is present, decode it\nas normal and wrap successes in a `Just`.\n\nWhen decoding with\n[`maybe`](http://package.elm-lang.org/packages/elm-lang/core/latest/Json-Decode#maybe),\nif a field is present but malformed, you get a success and Nothing.\n`optionalField` gives you a failed decoding in that case, so you know\nyou received malformed data.\n\nExamples:\n\nIf the \"stuff\" field is missing, decode to Nothing.\n\n    \"\"\" { } \"\"\"\n        |> decodeString (optionalField \"stuff\" string)\n    --> Ok Nothing\n\nIf the \"stuff\" field is present but not a String, fail decoding.\n\n    \"\"\" { \"stuff\": [] } \"\"\"\n        |> decodeString (optionalField \"stuff\" string)\n    --> Err \"Expecting a String at _.stuff but instead got: []\"\n\nIf the \"stuff\" field is present and valid, decode to Just String.\n\n    \"\"\" { \"stuff\": \"yay!\" } \"\"\"\n        |> decodeString (optionalField \"stuff\" string)\n    --> Ok <| Just \"yay!\"\n\n",
                "type": "String -> Decoder a -> Decoder (Maybe a)"
            },
            {
                "name": "parseFloat",
                "comment": " Extract a float using [`String.toFloat`](http://package.elm-lang.org/packages/elm-lang/core/latest/String#toFloat)\n\n    \"\"\" { \"field\": \"50.5\" } \"\"\"\n        |> decodeString (field \"field\" parseFloat)\n    --> Ok 50.5\n\n",
                "type": "Decoder Float"
            },
            {
                "name": "parseInt",
                "comment": " Extract an int using [`String.toInt`](http://package.elm-lang.org/packages/elm-lang/core/latest/String#toInt)\n\n    \"\"\" { \"field\": \"123\" } \"\"\"\n        |> decodeString (field \"field\" parseInt)\n    --> Ok 123\n\n",
                "type": "Decoder Int"
            },
            {
                "name": "sequence",
                "comment": " This function turns a list of decoders into a decoder that returns a list.\n\nThe returned decoder will zip the list of decoders with a list of values,\nmatching each decoder with exactly one value at the same position. This is most\noften useful in cases when you find yourself needing to dynamically generate a\nlist of decoders based on some data, and decode some other data with this list\nof decoders.\n\nNote that this function, unlike `List.map2`'s behaviour, expects the list of\ndecoders to have the same length as the list of values in the JSON.\n\n    sequence\n        [ map Just string\n        , succeed Nothing\n        , map Just string\n        ]\n        |> flip decodeString \"\"\" [ \"pick me\", \"ignore me\", \"and pick me\" ] \"\"\"\n    --> Ok [ Just \"pick me\", Nothing, Just \"and pick me\" ]\n\n",
                "type": "List (Decoder a) -> Decoder (List a)"
            },
            {
                "name": "set",
                "comment": " Extract a set.\n\n    \"[ 1, 1, 5, 2 ]\"\n        |> decodeString (set int)\n    --> Ok <| Set.fromList [ 1, 2, 5 ]\n\n",
                "type": "Decoder comparable -> Decoder (Set comparable)"
            },
            {
                "name": "withDefault",
                "comment": " Try running the given decoder; if that fails, then succeed with the given\nfallback value.\n\n    \"\"\" { \"children\": \"oops\" } \"\"\"\n        |> decodeString (field \"children\" (list string) |> withDefault [])\n    --> Ok []\n\n    \"\"\" null \"\"\"\n        |> decodeString (field \"children\" (list string) |> withDefault [])\n    --> Ok []\n\n    \"\"\" 30 \"\"\"\n        |> decodeString (int |> withDefault 42)\n    --> Ok 30\n\n",
                "type": "a -> Decoder a -> Decoder a"
            }
        ],
        "binops": [
            {
                "name": "|:",
                "comment": " Infix version of `andMap` that makes for a nice DSL when decoding objects.\n\nSee [the `(|:)` docs](https://github.com/elm-community/json-extra/blob/2.0.0/docs/infixAndMap.md)\nfor an explanation of how `(|:)` works and how to use it.\n\n",
                "type": "Decoder (a -> b) -> Decoder a -> Decoder b",
                "associativity": "left",
                "precedence": 9
            }
        ]
    }
]