[
    {
        "name": "Json.Decode.Pipeline",
        "comment": " # Json.Decode.Pipeline\n\nUse the `(|>)` operator to build JSON decoders.\n\n## Decoding fields\n\n@docs required, requiredAt, optional, optionalAt, hardcoded, custom\n\n## Beginning and ending pipelines\n\n@docs decode, resolve\n\n",
        "unions": [],
        "aliases": [],
        "values": [
            {
                "name": "custom",
                "comment": " Run the given decoder and feed its result into the pipeline at this point.\n\nConsider this example.\n\n    import Json.Decode exposing (int, string, at, Decoder)\n    import Decode.Pipeline exposing (decode, required, custom)\n\n\n    type alias User =\n      { id : Int\n      , name : String\n      , email : String\n      }\n\n\n    userDecoder : Decoder User\n    userDecoder =\n      decode User\n        |> required \"id\" int\n        |> custom (at [ \"profile\", \"name\" ] string)\n        |> required \"email\" string\n\n\n    result : Result String User\n    result =\n      Decode.decodeString\n        userDecoder\n        \"\"\"\n          {\n            \"id\": 123,\n            \"email\": \"sam@example.com\",\n            \"profile\": {\"name\": \"Sam\"}\n          }\n        \"\"\"\n    -- Ok { id = 123, name = \"Sam\", email = \"sam@example.com\" }\n",
                "type": "Decoder a -> Decoder (a -> b) -> Decoder b"
            },
            {
                "name": "decode",
                "comment": " Begin a decoding pipeline. This is a synonym for [Json.Decode.succeed](http://package.elm-lang.org/packages/elm-lang/core/latest/Json-Decode#succeed),\nintended to make things read more clearly.\n\n    import Json.Decode exposing (int, string, float, Decoder)\n    import Json.Decode.Pipeline exposing (decode, required, optional)\n\n\n    type alias User =\n      { id : Int\n      , email : String\n      , name : String\n      }\n\n\n    userDecoder : Decoder User\n    userDecoder =\n      decode User\n        |> required \"id\" int\n        |> required \"email\" string\n        |> optional \"name\" string \"\"\n",
                "type": "a -> Decoder a"
            },
            {
                "name": "hardcoded",
                "comment": " Rather than decoding anything, use a fixed value for the next step in the\npipeline. `harcoded` does not look at the JSON at all.\n\n    import Json.Decode exposing (int, string, Decoder)\n    import Decode.Pipeline exposing (decode, required)\n\n\n    type alias User =\n      { id : Int\n      , email : String\n      , followers : Int\n      }\n\n\n    userDecoder : Decoder User\n    userDecoder =\n      decode User\n        |> required \"id\" int\n        |> required \"email\" string\n        |> hardcoded 0\n\n\n    result : Result String User\n    result =\n      Decode.decodeString\n        userDecoder\n        \"\"\"\n          {\"id\": 123, \"email\": \"sam@example.com\"}\n        \"\"\"\n    -- Ok { id = 123, email = \"sam@example.com\", followers = 0 }\n",
                "type": "a -> Decoder (a -> b) -> Decoder b"
            },
            {
                "name": "optional",
                "comment": " Decode a field that may be missing or have a null value. If the field is\nmissing, then it decodes as the `fallback` value. If the field is present,\nthen `valDecoder` is used to decode its value. If `valDecoder` fails on a\n`null` value, then the `fallback` is used as if the field were missing\nentirely.\n\n    import Json.Decode exposing (int, string, null, oneOf, Decoder)\n    import Decode.Pipeline exposing (decode, required, optional)\n\n\n    type alias User =\n      { id : Int\n      , name : String\n      , email : String\n      }\n\n\n    userDecoder : Decoder User\n    userDecoder =\n      decode User\n        |> required \"id\" int\n        |> optional \"name\" string \"blah\"\n        |> required \"email\" string\n\n\n    result : Result String User\n    result =\n      Decode.decodeString\n        userDecoder\n        \"\"\"\n          {\"id\": 123, \"email\": \"sam@example.com\" }\n        \"\"\"\n    -- Ok { id = 123, name = \"blah\", email = \"sam@example.com\" }\n\nBecause `valDecoder` is given an opportunity to decode `null` values before\nresorting to the `fallback`, you can distinguish between missing and `null`\nvalues if you need to:\n\n    userDecoder2 =\n        decode User\n            |> required \"id\" int\n            |> optional \"name\" (oneOf [ string, null \"NULL\" ]) \"MISSING\"\n            |> required \"email\" string\n\n",
                "type": "String -> Decoder a -> a -> Decoder (a -> b) -> Decoder b"
            },
            {
                "name": "optionalAt",
                "comment": " Decode an optional nested field.\n",
                "type": "List String -> Decoder a -> a -> Decoder (a -> b) -> Decoder b"
            },
            {
                "name": "required",
                "comment": " Decode a required field.\n\n    import Json.Decode exposing (int, string, Decoder)\n    import Decode.Pipeline exposing (decode, required)\n\n\n    type alias User =\n      { id : Int\n      , name : String\n      , email : String\n      }\n\n\n    userDecoder : Decoder User\n    userDecoder =\n      decode User\n        |> required \"id\" int\n        |> required \"name\" string\n        |> required \"email\" string\n\n\n    result : Result String User\n    result =\n      Decode.decodeString\n        userDecoder\n        \"\"\"\n          {\"id\": 123, \"email\": \"sam@example.com\", \"name\": \"Sam\"}\n        \"\"\"\n    -- Ok { id = 123, name = \"Sam\", email = \"sam@example.com\" }\n",
                "type": "String -> Decoder a -> Decoder (a -> b) -> Decoder b"
            },
            {
                "name": "requiredAt",
                "comment": " Decode a required nested field.\n",
                "type": "List String -> Decoder a -> Decoder (a -> b) -> Decoder b"
            },
            {
                "name": "resolve",
                "comment": " Convert a `Decoder (Result x a)` into a `Decoder a`. Useful when you want\nto perform some custom processing just before completing the decoding operation.\n\n    import Json.Decode exposing (int, string, float, Decoder)\n    import Decode.Pipeline exposing\n      (decode, required, resolve)\n\n\n    type alias User =\n      { id : Int\n      , email : String\n      }\n\n\n    userDecoder : Decoder User\n    userDecoder =\n      let\n        -- toDecoder gets run *after* all the\n        -- (|> required ...) steps are done.\n        toDecoder : Int -> String -> Int -> Decoder User\n        toDecoder id email version =\n          if version > 2 then\n            succeed (User id email)\n          else\n            fail \"This JSON is from a deprecated source. Please upgrade!\"\n      in\n        decode toDecoder\n          |> required \"id\" int\n          |> required \"email\" string\n          |> required \"version\" int -- version is part of toDecoder,\n          |> resolve                -- but it is not a part of User\n\n\n    result : Result String User\n    result =\n      Decode.decodeString\n        userDecoder\n        \"\"\"\n          {\"id\": 123, \"email\": \"sam@example.com\", \"version\": 1}\n        \"\"\"\n    -- Err \"This JSON is from a deprecated source. Please upgrade!\"\n",
                "type": "Decoder (Decoder a) -> Decoder a"
            }
        ],
        "binops": []
    }
]