[
    {
        "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, nullable\n\n## Beginning and ending pipelines\n\n@docs decode, resolveResult\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 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\" ] string)\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": "nullable",
                "comment": " Extract a value that might be `null`.\n\nIf the value is `null`, decodes to `Nothing`.\nIf the value is not `null`, runs the given decoder on it and...\n\n* ...If that decoder succeeds, wraps its success value in a `Just`.\n* ...If it fails, the entire decoding operation fails.\n\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 : Maybe String\n      }\n\n\n    userDecoder : Decoder User\n    userDecoder =\n      decode User\n        |> required \"id\" int\n        |> required \"email\" string\n        |> required \"name\" (nullable string)\n\nIn the above example,\n\n* If `name` is `null`, it will successfully decode to `Nothing`\n* If `name` is `\"Lee\"` it will successfully decode to `Just \"Lee\"`\n* If `name` is not present, the whole decoder will fail.\n",
                "type": "Decoder a -> Decoder (Maybe a)"
            },
            {
                "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 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\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 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": "requiredAt",
                "comment": " Decode a required nested field.\n",
                "type": "List 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": []
    }
]