[{"name":"Exhaustive","comment":"\n\n\n# Generators and testing\n\n@docs Generator, test\n\n\n# Generators for primitive types\n\n@docs unit, bool, int, float, char, string\n\n\n# Generators for complex types\n\n\n## Built-in combinators\n\n@docs pair, triple, maybe, result, list, dict, array\n\n\n## Records\n\n@docs record, field\n\n\n## Custom types\n\n@docs customType, variant0, variant1, variant2, variant3, variant4, variant5\n\n\n# Defining custom generators\n\n@docs empty, constant, values, new\n\n\n# Transforming, chaining and combining generators\n\n@docs map, andThen, append\n\n","unions":[],"aliases":[{"name":"Generator","comment":" A `Generator` provides a set of functions that are useful when generating\nvalues of a given type.\n\nThe functions are:\n\n\n### `count : Int`\n\nThe total number of values that will be produced by the generator\n\n    import Exhaustive exposing (bool)\n\n    bool.count\n\n    --> 2\n\n\n### `nth : Int -> Maybe value`\n\nGenerate the nth value in the sequence. Sequences begin at n = 0. This function\nreturns `Nothing` if you pass an integer that is greater than `count`.\n\n    import Exhaustive exposing (bool)\n\n    bool.nth 0\n\n    --> Just False\n\n\n### `all : () -> List value`\n\nGenerate a list of all the values that the generator\ncan produce, starting with n = 0 and ending with n = count. To avoid creating\nhuge lists unnecessarily, you need to pass a `()` to this function to generate\nthe list.\n\n    import Exhaustive exposing (bool)\n\n    bool.all ()\n\n    --> [ False, True ]\n\n\n### `every : Int -> List value`\n\nGenerate a list of a subset of values, starting\nwith the value at n = 0 and then taking values at a specified interval.\n\n    import Exhaustive exposing (values)\n\n    zeroToNine =\n        values (List.range 0 9)\n\n    zeroToNine.every 2\n\n    --> [ 0, 2, 4, 6, 8 ]\n\n\n### `sample : Float -> List value`\n\nGenerate a list of an evenly distributed\npercentage of the values that the generator can produce, starting with the value\nat n = 0. The percentage should be specified as a `Float` between 0.0 and 1.0.\n\n    import Exhaustive exposing (values)\n\n    zeroToNine =\n        values (List.range 0 9)\n\n    zeroToNine.sample 0.25\n\n    --> [ 0, 4, 8 ]\n\n","args":["value"],"type":"{ count : Basics.Int, nth : Basics.Int -> Maybe.Maybe value, all : () -> List.List value, every : Basics.Int -> List.List value, sample : Basics.Float -> List.List value }"}],"values":[{"name":"andThen","comment":" Create a `Generator` for values of one type based on the values produced by\na generator of another type.\n\n    import Exhaustive exposing (andThen, bool, constant, values)\n\n    oneTwoThree =\n        bool\n            |> andThen\n                (\\b ->\n                    case b of\n                        False ->\n                            values [ 1, 2 ]\n\n                        True ->\n                            constant 3\n                )\n\n    oneTwoThree.all ()\n\n    --> [ 1, 2, 3 ]\n\n","type":"(value1 -> Exhaustive.Generator value2) -> Exhaustive.Generator value1 -> Exhaustive.Generator value2"},{"name":"append","comment":" Combine two `Generator`s of the same type. This will first generate all the\nvalues from the first generator, and then all the values from the second\ngenerator.\n\n    import Exhaustive exposing (append, values)\n\n    oneTwoThreeFour =\n        append (values [ 1, 2 ]) (values [ 3, 4 ])\n\n    oneTwoThreeFour.all ()\n\n    --> [ 1, 2, 3, 4 ]\n\n","type":"Exhaustive.Generator value -> Exhaustive.Generator value -> Exhaustive.Generator value"},{"name":"array","comment":" Generate all `Array`s of a given type, starting with an empty `Array` and\ncontinuing up to `Array`s of a specified length.\n\n    import Exhaustive exposing (array, bool)\n    import Array\n\n    arrayBool =\n        array 1 bool\n\n    arrayBool.all ()\n\n    --> [ Array.fromList [], Array.fromList [ False ], Array.fromList [ True ] ]\n\n","type":"Basics.Int -> Exhaustive.Generator value -> Exhaustive.Generator (Array.Array value)"},{"name":"bool","comment":" Generate all boolean values. The 0th term is `False`, the 1st term is `True`.\n\n    import Exhaustive exposing (bool)\n\n    bool.all ()\n\n    --> [ False, True ]\n\n","type":"Exhaustive.Generator Basics.Bool"},{"name":"char","comment":" Generate `Char` values.\n\nSince the set of all `Char`s is infinite, we don't\nattempt to generate all of them. Instead, we try a small set of potentially\ninteresting `Char`s, which may be useful in tests:\n\n    import Exhaustive exposing (char)\n\n    char.nth 0\n\n    --> Just ' '\n\n(I am open to suggestions for more interesting `Char`s than these!)\n\nIf you want to generate a specific list of `Char`s, see the docs for `values`\ninstead.\n\n","type":"Exhaustive.Generator Char.Char"},{"name":"constant","comment":" A `Generator` that produces exactly one value.\n\n    import Exhaustive exposing (constant)\n\n    one =\n        constant 1\n\n    one.nth 0\n\n    --> Just 1\n\n    one.nth 1\n\n    --> Nothing\n\n","type":"value -> Exhaustive.Generator value"},{"name":"customType","comment":" Generate all values of a custom type . Use with `variant0`, `variant1`, etc.\n\n    import Exhaustive exposing (customType, variant0, variant1, variant2, bool, unit)\n\n    type Foo\n        = Foo Bool\n        | Bar () Bool\n        | Baz\n\n    foo =\n        customType\n            |> variant1 Foo bool\n            |> variant2 Bar unit bool\n            |> variant0 Baz\n\n    foo.all ()\n\n    --> [ Foo False, Foo True, Bar () False, Bar () True, Baz ]\n\n","type":"Exhaustive.Generator value"},{"name":"dict","comment":" Generate all `Dict`s of a given key and value type, starting with an empty\n`Dict` and continuing up to `Dict`s of a specified length.\n\n    import Exhaustive exposing (dict, values, unit)\n    import Dict\n\n    myDict =\n        dict 1\n            (values [ \"a\", \"b\" ])\n            unit\n\n    myDict.all ()\n\n    --> [ Dict.fromList [], Dict.fromList [ ( \"a\", () ) ], Dict.fromList [ ( \"b\", () ) ] ]\n\n","type":"Basics.Int -> Exhaustive.Generator comparable -> Exhaustive.Generator value -> Exhaustive.Generator (Dict.Dict comparable value)"},{"name":"empty","comment":" A `Generator` that never produces any values.\n\n    import Exhaustive exposing (empty)\n\n    empty.nth 0\n\n    --> Nothing\n\n","type":"Exhaustive.Generator value"},{"name":"field","comment":" Specify the contents of a field for a record type. Use with `record`.\n","type":"Exhaustive.Generator field -> Exhaustive.Generator (field -> record) -> Exhaustive.Generator record"},{"name":"float","comment":" Generate `Float` values.\n\nSince the set of all floats is infinite, we don't\nattempt to generate all of them. Instead, we try a small set of potentially\ninteresting floats, which may be useful in tests:\n\n    import Exhaustive exposing (float)\n\n    float.nth 0\n\n    --> Just 0.0\n\n(I am open to suggestions for more interesting floats than these!)\n\nIf you want to generate a specific list of floats, see the docs for `values`\ninstead.\n\n","type":"Exhaustive.Generator Basics.Float"},{"name":"int","comment":" Generate integer values.\n\nSince the set of all integers is infinite, we don't\nattempt to generate all of them. Instead, we try a small set of potentially\ninteresting integers, which may be useful in tests:\n\n    import Exhaustive exposing (int)\n\n    int.all ()\n\n    --> [ 0, -1, 1, 2, 3, -10, 10, -100, 100 ]\n\n(I am open to suggestions for more interesting integers than these!)\n\nIf you want to generate a specific list of integers, see the docs for `values`\ninstead.\n\n","type":"Exhaustive.Generator Basics.Int"},{"name":"list","comment":" Generate all lists of values of a given type, starting with the empty list\n`[]`, and continuing up to lists of a specified length.\n\n    import Exhaustive exposing (list, bool)\n\n    listBool =\n        list 1 bool\n\n    listBool.all ()\n\n    --> [ [], [ False ], [ True ] ]\n\n","type":"Basics.Int -> Exhaustive.Generator value -> Exhaustive.Generator (List.List value)"},{"name":"map","comment":" Convert a `Generator` of one type of value into a `Generator` of another\ntype of value.\n\n    import Exhaustive exposing (map, int)\n\n    type Id\n        = Id Int\n\n    id =\n        map Id int\n\n    id.nth 0\n\n    --> Just (Id 0)\n\n","type":"(value1 -> value2) -> Exhaustive.Generator value1 -> Exhaustive.Generator value2"},{"name":"maybe","comment":" Generate all `Maybe` values of a given type.\n\n    import Exhaustive exposing (maybe, bool)\n\n    maybeBool =\n        maybe bool\n\n    maybeBool.all ()\n\n    --> [ Nothing, Just False, Just True ]\n\n","type":"Exhaustive.Generator value -> Exhaustive.Generator (Maybe.Maybe value)"},{"name":"new","comment":" Define a new generator by providing an implementation for generating the nth\nterm.\n\n    import Exhaustive exposing (new)\n\n    type Colour\n        = Red\n        | Green\n        | Blue\n\n    colour =\n        new\n            (\\n ->\n                case n of\n                    0 -> Just Red\n                    1 -> Just Green\n                    2 -> Just Blue\n                    _ -> Nothing\n            )\n\n    colour.all ()\n\n    --> [ Red, Green, Blue ]\n\n(This is a silly example. If you really had a `Colour` type like this, it would\nbe better to use the `customType` and `variant0` functions.)\n\n","type":"(Basics.Int -> Maybe.Maybe value) -> Exhaustive.Generator value"},{"name":"pair","comment":" Generate all pairs of values of given types.\n\n    import Exhaustive exposing (pair, bool)\n\n    pairBool =\n        pair bool bool\n\n    pairBool.all ()\n\n    --> [ ( False, False ), ( True, False ), ( False, True ), ( True, True ) ]\n\n","type":"Exhaustive.Generator value1 -> Exhaustive.Generator value2 -> Exhaustive.Generator ( value1, value2 )"},{"name":"record","comment":" Generate all values of a record type. Use with `field`.\n\n    import Exhaustive exposing (record, field, bool, unit)\n\n    rec =\n        record (\\foo bar -> { foo = foo, bar = bar })\n            |> field bool\n            |> field unit\n\n    rec.all ()\n\n    --> [ { foo = False, bar = () }, { foo = True, bar = () } ]\n\n","type":"value -> Exhaustive.Generator value"},{"name":"result","comment":" Generate all `Result` values of given error and ok types.\n\n    import Exhaustive exposing (result, unit, bool)\n\n    resultUnitBool =\n        result unit bool\n\n    resultUnitBool.all ()\n\n    --> [ Err (), Ok False, Ok True ]\n\n","type":"Exhaustive.Generator error -> Exhaustive.Generator value -> Exhaustive.Generator (Result.Result error value)"},{"name":"string","comment":" Generate `String` values.\n\nSince the set of all `String`s is infinite, we don't\nattempt to generate all of them. Instead, we try a small set of potentially\ninteresting `String`s, which may be useful in tests:\n\n    import Exhaustive exposing (string)\n\n    string.nth 0\n\n    --> Just \"\"\n\n(I am open to suggestions for more interesting `String`s than these!)\n\nIf you want to generate a specific list of `String`s, see the docs for `values`\ninstead.\n\n","type":"Exhaustive.Generator String.String"},{"name":"test","comment":" Turn a `Generator` into a `Test`, for use with `elm-test`.\n\nThe API is similar to `elm-test`'s `Test.fuzz`, except that instead of supplying\na fuzzer, you supply a `Generator` from this package.\n\nWhen the test is executed, `elm-test` will check the expectation against every\nterm in the sequence, starting from the 0th term and continuing until either an\nexpectation fails, or the generator is exhausted.\n\n    import Exhaustive exposing (test, int)\n    import Test\n    import Expect\n\n\n    test int \"This integer is never zero\" <|\n        \\n -> n |> Expect.notEqual 0\n\n    --: Test.Test\n\n","type":"Exhaustive.Generator value -> String.String -> (value -> Expect.Expectation) -> Test.Test"},{"name":"triple","comment":" Generate all triples of values of given types.\n\n    import Exhaustive exposing (triple, bool, unit)\n\n    tripleBoolUnitUnit =\n        triple bool unit unit\n\n    tripleBoolUnitUnit.all ()\n\n    --> [ ( False, (), () ), ( True, (), () ) ]\n\n","type":"Exhaustive.Generator value1 -> Exhaustive.Generator value2 -> Exhaustive.Generator value3 -> Exhaustive.Generator ( value1, value2, value3 )"},{"name":"unit","comment":" Generate all values of the unit type, `()`. There's only one!\n\n    import Exhaustive exposing (unit)\n\n    unit.nth 0\n\n    --> Just ()\n\n    unit.nth 1\n\n    --> Nothing\n\n","type":"Exhaustive.Generator ()"},{"name":"values","comment":" A `Generator` that produces a specific sequence of values.\n\n    import Exhaustive exposing (values)\n\n    abc =\n        values [ \"a\", \"b\", \"c\" ]\n\n    abc.nth 2\n\n    --> Just \"c\"\n\n    abc.nth 3\n\n    --> Nothing\n\n","type":"List.List value -> Exhaustive.Generator value"},{"name":"variant0","comment":" Specify a custom type variant with no arguments. Use with `customType`.\n","type":"variant -> Exhaustive.Generator variant -> Exhaustive.Generator variant"},{"name":"variant1","comment":" Specify a custom type variant with one argument. Use with `customType`.\n","type":"(arg -> variant) -> Exhaustive.Generator arg -> Exhaustive.Generator variant -> Exhaustive.Generator variant"},{"name":"variant2","comment":" Specify a custom type variant with two arguments. Use with `customType`.\n","type":"(arg1 -> arg2 -> variant) -> Exhaustive.Generator arg1 -> Exhaustive.Generator arg2 -> Exhaustive.Generator variant -> Exhaustive.Generator variant"},{"name":"variant3","comment":" Specify a custom type variant with three arguments. Use with `customType`.\n","type":"(arg1 -> arg2 -> arg3 -> variant) -> Exhaustive.Generator arg1 -> Exhaustive.Generator arg2 -> Exhaustive.Generator arg3 -> Exhaustive.Generator variant -> Exhaustive.Generator variant"},{"name":"variant4","comment":" Specify a custom type variant with four arguments. Use with `customType`.\n","type":"(arg1 -> arg2 -> arg3 -> arg4 -> variant) -> Exhaustive.Generator arg1 -> Exhaustive.Generator arg2 -> Exhaustive.Generator arg3 -> Exhaustive.Generator arg4 -> Exhaustive.Generator variant -> Exhaustive.Generator variant"},{"name":"variant5","comment":" Specify a custom type variant with five arguments. Use with `customType`.\n","type":"(arg1 -> arg2 -> arg3 -> arg4 -> arg5 -> variant) -> Exhaustive.Generator arg1 -> Exhaustive.Generator arg2 -> Exhaustive.Generator arg3 -> Exhaustive.Generator arg4 -> Exhaustive.Generator arg5 -> Exhaustive.Generator variant -> Exhaustive.Generator variant"}],"binops":[]}]