From fe4d81a245576839ab8210ffb79efcd5d7575b43 Mon Sep 17 00:00:00 2001 From: Luke Boswell Date: Mon, 20 Feb 2023 15:19:27 +1100 Subject: [PATCH] correct all uses of Bool.true --- www/generate_tutorial/src/input/tutorial.md | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/www/generate_tutorial/src/input/tutorial.md b/www/generate_tutorial/src/input/tutorial.md index f1099b620c..114398626b 100644 --- a/www/generate_tutorial/src/input/tutorial.md +++ b/www/generate_tutorial/src/input/tutorial.md @@ -629,7 +629,7 @@ We can also give `List.map` a named function, instead of an anonymous one: List.map [1, 2, 3] Num.isOdd -This `Num.isOdd` function returns `Bool.true` if it's given an odd number, and `Bool.false` otherwise. So `Num.isOdd 5` returns true and `Num.isOdd 2` returns false. +This `Num.isOdd` function returns `Bool.true` if it's given an odd number, and `Bool.false` otherwise. So `Num.isOdd 5` returns `Bool.true` and `Num.isOdd 2` returns `Bool.false`. As such, calling `List.map [1, 2, 3] Num.isOdd` returns a new list of `[Bool.true, Bool.false, Bool.true]`. @@ -694,7 +694,7 @@ These two versions compile to the same thing. As a convenience, Roc lets you spe ### [`List.any` and `List.all`](#list-any-and-list-all) {#list-any-and-list-all} -There are several functions that work like `List.map`, they walk through each element of a list and do something with it. Another is `List.any`, which returns `Bool.true` if calling the given function on any element in the list returns `true`: +There are several functions that work like `List.map`, they walk through each element of a list and do something with it. Another is `List.any`, which returns `Bool.true` if calling the given function on any element in the list returns `Bool.true`:
List.any [1, 2, 3] Num.isOdd
 # returns `Bool.true` because 1 and 3 are odd
@@ -704,7 +704,7 @@ There are several functions that work like `List.map`, they walk through each el
 # returns `Bool.false` because none of these is negative
 
-There's also `List.all` which only returns `true` if all the elements in the list pass the test: +There's also `List.all` which only returns `Bool.true` if all the elements in the list pass the test:
List.all [1, 2, 3] Num.isOdd
 # returns `Bool.false` because 2 is not odd
@@ -722,7 +722,7 @@ You can also drop elements from a list. One way is `List.dropAt` - for example:
 # drops the element at offset 1 ("Lee") and returns ["Sam", "Ari"]
 
-Another way is to use `List.keepIf`, which passes each of the list's elements to the given function, and then keeps them only if that function returns `true`. +Another way is to use `List.keepIf`, which passes each of the list's elements to the given function, and then keeps them only if that function returns `Bool.true`.
List.keepIf [1, 2, 3, 4, 5] Num.isEven
 # returns [2, 4]
@@ -1279,7 +1279,7 @@ You can write automated tests for your Roc code like so:
 expect pluralize "cactus" "cacti" 2 == "2 cacti"
 
-If you put this in a file named `main.roc` and run `roc test`, Roc will execute the two `expect` expressions (that is, the two `pluralize` calls) and report any that returned `false`. +If you put this in a file named `main.roc` and run `roc test`, Roc will execute the two `expect` expressions (that is, the two `pluralize` calls) and report any that returned `Bool.false`. If a test fails, it will not show the actual value that differs from the expected value. To show the actual value, you can write the expect like this: