[
    {
        "name": "Json.Decode.Pipeline",
        "comment": " ## Design Principles\n\n* Introduce functions that work well with the [`(|>)`](http://package.elm-lang.org/packages/elm-lang/core/3.0.0/Basics#|>) operator\n* Don't introduce any custom infix operators\n* Don't introduce any functions that are intended to be called using backticks\n\n@docs required, optional, hardcoded, custom, resolveResult, decode\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 Json.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\" ])\n        |> required \"email\" string\n\n\n    result : Result String User\n    result =\n      Json.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/3.0.0/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 Json.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      Json.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 or may not be present. If the field is present,\nuse the specified decoder on it. If the field is not present, successfully\ndecode to the given fallback value.\n\n    import Json.Decode exposing (int, string, Decoder)\n    import Json.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      Json.Decode.decodeString\n        userDecoder\n        \"\"\"\n          {\"id\": 123, \"email\": \"sam@example.com\" }\n        \"\"\"\n    -- Ok { id = 123, name = \"blah\", email = \"sam@example.com\" }\n\n",
                "type": "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 Json.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      Json.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": "resolveResult",
                "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 Json.Decode.Pipeline exposing\n      (decode, required, resolveResult)\n\n\n    type alias User =\n      { id : Int\n      , email : String\n      }\n\n\n    userDecoder : Decoder User\n    userDecoder =\n      let\n        -- asResult gets run *after* all the\n        -- (|> required ...) steps are done.\n        asResult Int -> String -> Int -> Result String User\n        asResult id email version =\n          if version > 2 then\n            Ok (User id email)\n          else\n            Err \"This JSON is from a deprecated source. Please upgrade!\"\n      in\n        decode asResult\n          |> required \"id\" int\n          |> required \"email\" string\n          |> required \"version\" int -- version is part of asResult,\n          |> resolveResult          -- but it is not a part of User\n\n\n    result : Result String User\n    result =\n      Json.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 (Result String a) -> Decoder a"
            }
        ],
        "binops": []
    }
]