From b2e014cea9271f84e05ac2132e3280e8f223e5ef Mon Sep 17 00:00:00 2001 From: Martin Janiczek Date: Tue, 11 Oct 2022 20:42:44 +0200 Subject: [PATCH] Fix examples in docs for Fuzz.andThen and Fuzz.filter --- src/Fuzz.elm | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/src/Fuzz.elm b/src/Fuzz.elm index bc1c7240..54ba8201 100644 --- a/src/Fuzz.elm +++ b/src/Fuzz.elm @@ -1311,8 +1311,8 @@ rejections in a row, in which case the test will fluke out and fail! It's always preferable to get to your wanted values using [`map`](#map), as you don't run the risk of rejecting too may values and slowing down your tests, for -example using `Fuzz.int 0 5 |> Fuzz.map (\x -> x * 2)` instead of -`Fuzz.int 0 9 |> Fuzz.filter (\x -> modBy 2 x == 0)`. +example using `Fuzz.intRange 0 5 |> Fuzz.map (\x -> x * 2)` instead of +`Fuzz.intRange 0 9 |> Fuzz.filter (\x -> modBy 2 x == 0)`. If you want to generate indefinitely until you find a satisfactory value (with a risk of infinite loop depending on the predicate), you can use this pattern: @@ -1357,7 +1357,7 @@ For example, let's say you want to generate a list of given length. One possible way to do that is first choosing how many elements will there be (generating a number), `andThen` generating a list with that many items: - Fuzz.int 1 10 + Fuzz.intRange 1 10 |> Fuzz.andThen (\length -> let