[{"name":"Bench","comment":" A benchmarking library designed for the `elm-bench` CLI runner.\n\nProvides a richer API than `elm-explorations/benchmark` with:\n\n  - **Automatic correctness checks** — `compare`, `rank`, and `scale` verify\n    that all implementations produce the same result before benchmarking.\n  - **Fuzzer-based inputs** — generate random test data using `elm-explorations/test` fuzzers.\n  - **Scaling analysis** — measure how algorithms perform at different input sizes.\n  - **Filtering** — the CLI can run a subset of benchmarks by name.\n\n\n# Creating Benchmarks\n\n@docs Benchmark, benchmark, compare, rank, describe, scale, series\n\n\n# Fuzzer Variants\n\nThese use fuzzers from `elm-explorations/test` to generate random input data.\nThe fuzzer is sampled once per benchmark run (seeded deterministically) and all\nfuzzers receive the same seed for the run (this makes debugging possible),\nhowever input will vary across runs (unless you run with the same `--seed`\nargument).\n\n@docs compareFuzz, rankFuzz, scaleFuzz\n\n@docs sampleFuzzer\n\n\n# Correctness Verification\n\n`compare`, `rank`, and `scale` automatically verify that all implementations\nproduce the same result. Use `skipEqualityCheck` to opt out.\n\n@docs skipEqualityCheck\n\n\n# Filtering\n\n@docs filter\n\n\n# For Runners\n\nThese are used internally by the CLI runner. You shouldn't need them directly.\n\n@docs toInternalBenchmark, toInternalTest, encode\n\n","unions":[{"name":"Benchmark","comment":" A benchmark definition. Can be a single measurement, a comparison of\nmultiple implementations, a scaling analysis, or a named group.\n","args":[],"cases":[]}],"aliases":[],"values":[{"name":"benchmark","comment":" Benchmark a single function.\n\n    benchmark \"List.map\" <|\n        \\_ -> List.map ((+) 1) (List.range 1 100)\n\n","type":"String.String -> (() -> a) -> Bench.Benchmark"},{"name":"compare","comment":" Compare two implementations. Automatically verifies they produce the\nsame result before benchmarking.\n\n    compare \"reversing\"\n        ( \"List.reverse\", \\_ -> List.reverse data )\n        ( \"List.foldl (::)\", \\_ -> List.foldl (::) [] data )\n\n","type":"String.String -> ( String.String, () -> a ) -> ( String.String, () -> a ) -> Bench.Benchmark"},{"name":"compareFuzz","comment":" Like `compare`, but generates input from a fuzzer. The fuzzer is also\nused for the correctness check (fuzz test).\n\n    compareFuzz \"reversing\"\n        (Fuzz.list Fuzz.int)\n        ( \"List.reverse\", List.reverse )\n        ( \"List.foldl (::)\", List.foldl (::) [] )\n\n","type":"String.String -> Fuzz.Fuzzer input -> ( String.String, input -> a ) -> ( String.String, input -> a ) -> Bench.Benchmark"},{"name":"describe","comment":" Organize benchmarks into a named group.\n\n    describe \"Array.Extra\"\n        [ rank \"mapToList\" ...\n        , rank \"filterMap\" ...\n        ]\n\n","type":"String.String -> List.List Bench.Benchmark -> Bench.Benchmark"},{"name":"encode","comment":" Encode the benchmark tree structure as JSON. Used by the CLI to\nunderstand the tree shape for filtering and display.\n","type":"Bench.Benchmark -> Json.Encode.Value"},{"name":"filter","comment":" Filter benchmarks by name (case-insensitive substring match).\nGroups are kept if any child matches. Returns `Nothing` if nothing matches.\n","type":"String.String -> Bench.Benchmark -> Maybe.Maybe Bench.Benchmark"},{"name":"rank","comment":" Compare multiple implementations with a shared runner function.\nAutomatically verifies that all implementations produce the same result.\n\n    rank \"mapToList\"\n        (\\mapToList -> mapToList negate ints1To100)\n        [ ( \"with foldr\", Array.Extra.MapToList.withFoldr )\n        , ( \"with toIndexedList\", Array.Extra.MapToList.withListMap )\n        ]\n\n","type":"String.String -> (f -> a) -> List.List ( String.String, f ) -> Bench.Benchmark"},{"name":"rankFuzz","comment":" Like `rank`, but generates input from a fuzzer.\n\n    rankFuzz \"mapToList\"\n        (Fuzz.array Fuzz.int)\n        (\\mapToList array -> mapToList negate array)\n        [ ( \"with foldr\", Array.Extra.MapToList.withFoldr )\n        , ( \"with toIndexedList\", Array.Extra.MapToList.withListMap )\n        ]\n\n","type":"String.String -> Fuzz.Fuzzer input -> (f -> input -> a) -> List.List ( String.String, f ) -> Bench.Benchmark"},{"name":"sampleFuzzer","comment":" Sample a fuzzer with a specific seed. Use this in `elm repl` to reproduce\nthe exact input that was used during a benchmark run.\n\nWhen you see unexpected results from a fuzz-based benchmark, copy the seed\nfrom the benchmark output and run in `elm repl`:\n\n    > import Bench\n    > import Fuzz\n    > Bench.sampleFuzzer 1234567 (Fuzz.list Fuzz.int)\n    [3, -7, 42, ...] : List Int\n\nThis gives you the exact value the fuzzer produced during that run.\n\n(We cannot print the value in the benchmark run, since unlike elm-test, elm-bench\nruns in `--optimize` mode and so doesn't have access to `Debug.log`.)\n\n","type":"Basics.Int -> Fuzz.Fuzzer a -> Maybe.Maybe a"},{"name":"scale","comment":" Run multiple implementations at different input sizes. Useful for\nunderstanding algorithmic complexity. Automatically verifies correctness\nat each size.\n\n    scale \"sorting\"\n        [ 10, 100, 1000 ]\n        (\\n -> List.range 1 n |> List.reverse)\n        [ ( \"List.sort\", List.sort )\n        , ( \"mergeSort\", mergeSort )\n        ]\n\n","type":"String.String -> List.List Basics.Int -> (Basics.Int -> input) -> List.List ( String.String, input -> a ) -> Bench.Benchmark"},{"name":"scaleFuzz","comment":" Like `scale`, but generates input from a size-dependent fuzzer.\n\n    scaleFuzz \"sorting\"\n        [ 10, 100, 1000 ]\n        (\\n -> Fuzz.listOfLength n Fuzz.int)\n        [ ( \"List.sort\", List.sort )\n        , ( \"mergeSort\", mergeSort )\n        ]\n\n","type":"String.String -> List.List Basics.Int -> (Basics.Int -> Fuzz.Fuzzer input) -> List.List ( String.String, input -> a ) -> Bench.Benchmark"},{"name":"series","comment":" A simple series of named benchmarks. Does not verify equality\n(use `rank` if you want correctness checks).\n\n    series \"approaches\"\n        [ ( \"List.sort\", \\_ -> List.sort data )\n        , ( \"List.sortBy identity\", \\_ -> List.sortBy identity data )\n        ]\n\n","type":"String.String -> List.List ( String.String, () -> a ) -> Bench.Benchmark"},{"name":"skipEqualityCheck","comment":" Disable the automatic equality check for a benchmark. Use this when\nimplementations intentionally produce different results (e.g. different\norderings that are both valid).\n\n    rank \"set operations\"\n        (\\toList -> toList mySet)\n        [ ( \"Set.toList\", Set.toList )\n        , ( \"custom\", customToList ) -- different order, both valid\n        ]\n        |> skipEqualityCheck\n\n","type":"Bench.Benchmark -> Bench.Benchmark"},{"name":"toInternalBenchmark","comment":" Convert to `elm-explorations/benchmark`'s Benchmark type for execution.\nThe seed is used to generate deterministic fuzzer-based input.\n","type":"Random.Seed -> Bench.Benchmark -> Benchmark.Benchmark"},{"name":"toInternalTest","comment":" Extract the correctness test from a benchmark tree. The CLI runner\nexecutes this before benchmarking to catch broken implementations early.\n","type":"Bench.Benchmark -> Maybe.Maybe Test.Test"}],"binops":[]}]