[{"name":"Json.Decode.Safe","comment":"\n\n@docs record, field, endRecord\n@docs Builder, Zero, OnePlus\n\n","unions":[{"name":"Builder","comment":" An intermediate data structure used to check that the decoders we are \ncreating have their fields in the correct order. A `Builder` is created by the \n`record` function, updated by the `field` function, and finally converted into a \n`Json.Decode.Decoder` by the `endRecord` function.\n","args":["safety","a"],"cases":[]},{"name":"OnePlus","comment":" Used for type safety.\n","args":["a"],"cases":[]},{"name":"Zero","comment":" Used for type safety. \n","args":[],"cases":[]}],"aliases":[],"values":[{"name":"endRecord","comment":" Finalise the creation of a record decoder.\n\n    import Json.Decode\n    import Json.Decode.Safe exposing (endRecord, field, record)\n\n    userDecoder =\n        record userConstructor userConstructor\n            |> field \"firstName\" .firstName Json.Decode.string\n            |> field \"lastName\" .lastName Json.Decode.string\n            |> field \"pets\" .pets Json.Decode.int\n            |> endRecord\n\n","type":"Json.Decode.Safe.Builder { safety | expectedFieldOrder : expectedFieldOrder, gotFieldOrder : expectedFieldOrder } recordType -> Json.Decode.Decoder recordType"},{"name":"field","comment":" Add a field to a record decoder.\n\n    import Json.Decode\n    import Json.Decode.Safe exposing (record, field)\n\n    userDecoder =\n        record userConstructor userConstructor\n            |> field \"firstName\" .firstName Json.Decode.string\n            |> field \"lastName\" .lastName Json.Decode.string\n            |> field \"pets\" .pets Json.Decode.int\n            |> ...\n\n","type":"String.String -> (expectedFieldOrder -> totalFieldCount) -> Json.Decode.Decoder fieldValue -> Json.Decode.Safe.Builder { expectedFieldOrder : totalFieldCount -> nextValidator, gotFieldOrder : expectedFieldOrder, totalFieldCount : totalFieldCount } (fieldValue -> nextConstructor) -> Json.Decode.Safe.Builder { expectedFieldOrder : nextValidator, gotFieldOrder : expectedFieldOrder, totalFieldCount : Json.Decode.Safe.OnePlus totalFieldCount } nextConstructor"},{"name":"record","comment":" Start constructing a record decoder.\n\n**⚠️ You will need to supply a polymorphic record constructor function as both \narguments to this function. ⚠️**\n\nFor example, if you want to decode a record like this:\n\n    type alias User =\n        { firstName : String\n        , lastName : String\n        , pets : Int\n        }\n\nYou must **not** use the `User` constructor. Instead, you will need to write a \nconstructor function as follows:\n\n    userConstructor : a -> b -> c -> { firstName : a, lastName : b, pets : c }\n    userConstructor firstName lastName pets =\n        { firstName = firstName\n        , lastName = lastName\n        , pets = pets\n        }\n\n**Note:** it is _important_ that the type annotation does not constrain the \ntypes of the arguments passed into this constructor function. That is part of \nthe secret of how this package works its magic!\n\nNow, pass the polymorphic constructor function into `record` _twice_, like this:\n\n    import Json.Decode.Safe exposing (record, field)\n\n    userDecoder =\n        record userConstructor userConstructor\n            |> ...\n\n","type":"constructor -> validator -> Json.Decode.Safe.Builder { expectedFieldOrder : validator, gotFieldOrder : a, totalFieldCount : Json.Decode.Safe.Zero } constructor"}],"binops":[]}]