[
    {
        "name": "Json.Helpers",
        "comment": " This module exposes helper functions for encoding sum types and maps. It was designed\nwith an eye for compatibility with the `aeson` library from the Haskell world, which explains\nwhy the various functions have such peculiar names.\n\nIf you require Haskell interop, please take a look at the [elm-bridge](https://hackage.haskell.org/package/elm-bridge) package that\nwill make it easy to derive the Elm code alongside the Haskell one.\n\n# The ObjectEncoding type\n@docs ObjectEncoding, encodeObject, encodeValue\n\n# Encoding schemes\n\nThe following Elm type will be used as an example for the different encoding schemes.\n\n    type Foo = Bar Int\n             | Baz { a: Int , b: Int }\n             | Qux Int Int\n\n## ObjectWithSingleField\n\n    -- {\"Bar\":5}\n    -- {\"Baz\":{\"a\":4,\"b\":8}}\n    -- {\"Qux\":[98,42]}\n\n@docs decodeSumObjectWithSingleField, encodeSumObjectWithSingleField\n\n## TwoElemArray\n\n    -- [\"Bar\",5]\n    -- [\"Baz\",{\"a\":4,\"b\":8}]\n    -- [\"Qux\",[98,42]]\n\n@docs decodeSumTwoElemArray, encodeSumTwoElementArray\n\n## TaggedObject\n\n    -- {\"tag\":\"Bar\",\"content\":5}\n    -- {\"tag\":\"Baz\",\"a\":4,\"b\":8}\n    -- [\"tag\":\"Qux\",\"content\":[98,42]}\n\n@docs decodeSumTaggedObject, encodeSumTaggedObject\n\n# Map helpers\n\n@docs decodeMap, encodeMap\n\n",
        "unions": [
            {
                "name": "ObjectEncoding",
                "comment": " This is an opaque type that is to be used to give hints when using the `TaggedObject` encoding. ",
                "args": [],
                "cases": []
            }
        ],
        "aliases": [],
        "values": [
            {
                "name": "decodeMap",
                "comment": " Helper function for decoding map-like objects. It takes a decoder for the key type and a decoder for the value type. ",
                "type": "Decoder comparable -> Decoder v -> Decoder (Dict comparable v)"
            },
            {
                "name": "decodeSumObjectWithSingleField",
                "comment": " Decode objects encoded using the `ObjectWithSingleField` scheme.\nThe first argument is the human readable name of the type of data, and will be used in error messages.\nThe second argument is a `Dict` where the keys are the tags of each constructor of the sum type and the values\nare decoders for each case.\n",
                "type": "String -> Dict String (Decoder a) -> Decoder a"
            },
            {
                "name": "decodeSumTaggedObject",
                "comment": " Decode objects encoded using the `TaggedObject` scheme.\nThe first argument is the human readable name of the type of data, and will be used in error messages.\nThe second argument is a `Dict` where the keys are the tags of each constructor of the sum type and the values\nare decoders for each case.\n\nCompared to the other functions, it expects a set of `String`s. This sets lists all the constructor tags that have an object content,\nsuch as the `Baz` constructor in the example.\n",
                "type": "String -> String -> String -> Dict String (Decoder a) -> Set String -> Decoder a"
            },
            {
                "name": "decodeSumTwoElemArray",
                "comment": " Decode objects encoded using the `TwoElemArray` scheme.\nThe first argument is the human readable name of the type of data, and will be used in error messages.\nThe second argument is a `Dict` where the keys are the tags of each constructor of the sum type and the values\nare decoders for each case.\n",
                "type": "String -> Dict String (Decoder a) -> Decoder a"
            },
            {
                "name": "encodeMap",
                "comment": " Helper function for encoding map-like objects. It takes an encoder for the key type and an encoder for the value type ",
                "type": "(comparable -> Value) -> (v -> Value) -> Dict comparable v -> Value"
            },
            {
                "name": "encodeObject",
                "comment": " Creates an `ObjectEncoding`, just like the `Json.Encode.object` function. ",
                "type": "List ( String, Value ) -> ObjectEncoding"
            },
            {
                "name": "encodeSumObjectWithSingleField",
                "comment": " Encode objects using the `WithSingleField` scheme.\nThe first argument is a function that, for each possible value `a`, must return a `String` tag\ndescribing it along with an `ObjectEncoding`.\n",
                "type": "(a -> ( String, ObjectEncoding )) -> a -> Value"
            },
            {
                "name": "encodeSumTaggedObject",
                "comment": " Encode objects using the `TaggedObject` scheme.\nThe first argument is a function that, for each possible value `a`, must return a `String` tag\ndescribing it along with an `ObjectEncoding`.\n",
                "type": "String -> String -> (a -> ( String, ObjectEncoding )) -> a -> Value"
            },
            {
                "name": "encodeSumTwoElementArray",
                "comment": " Encode objects using the `TwoElementArray` scheme.\nThe first argument is a function that, for each possible value `a`, must return a `String` tag\ndescribing it along with an `ObjectEncoding`.\n",
                "type": "(a -> ( String, ObjectEncoding )) -> a -> Value"
            },
            {
                "name": "encodeValue",
                "comment": " Creates an `ObjectEncoding` from any type of `Value`. You should not use this for `Value`s that are actually objects. ",
                "type": "Value -> ObjectEncoding"
            }
        ],
        "binops": []
    }
]