From 48ba897590e65f9c6e7ce9e06b1d43b715f5094f Mon Sep 17 00:00:00 2001 From: Anton-4 <17049058+Anton-4@users.noreply.github.com> Date: Sat, 17 Jun 2023 16:55:35 +0200 Subject: [PATCH 1/2] tutorial small fixes Signed-off-by: Anton-4 <17049058+Anton-4@users.noreply.github.com> --- www/generate_tutorial/src/input/tutorial.md | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/www/generate_tutorial/src/input/tutorial.md b/www/generate_tutorial/src/input/tutorial.md index 583858f187..ab980b27d9 100644 --- a/www/generate_tutorial/src/input/tutorial.md +++ b/www/generate_tutorial/src/input/tutorial.md @@ -699,7 +699,7 @@ List.map ["A", "B", "C", 1, 2, 3] Num.isNegative Every element in a Roc list has to share the same type. For example, we can have a list of strings like `["Sam", "Lee", "Ari"]`, or a list of numbers like `[1, 2, 3, 4, 5]` but we can't have a list which mixes strings and numbers like `["Sam", 1, "Lee", 2, 3]`, that would be a compile-time error. -Ensuring that all elements in a list share a type eliminates entire categories of problems. For example, it means that whenever you use `List.append` to add elements to a list, as long as you don't have any compile-time errors, you won't get any runtime errors from calling `List.map` afterwards, no matter what you appended to the list! More generally, it's safe to assume that unless you run out of memory, `List.map` will run successfully unless you got a compile-time error about an incompatibility (like `Num.negate` on a list of strings). +Ensuring that all elements in a list share a type eliminates entire categories of problems. For example, it means that whenever you use `List.append` to add elements to a list, as long as you don't have any compile-time errors, you won't get any runtime errors from calling `List.map` afterwards, no matter what you appended to the list! More generally, it's safe to assume that unless you run out of memory, `List.map` will run successfully unless you got a compile-time error about an incompatibility (like `Num.neg` on a list of strings). ### [Lists that hold elements of different types](#lists-that-hold-elements-of-different-types) {#lists-that-hold-elements-of-different-types} @@ -1968,8 +1968,6 @@ Here are various Roc expressions involving operators, and what they desugar to. | `a // b` | `Num.divTrunc a b` | | `a ^ b` | `Num.pow a b` | | `a % b` | `Num.rem a b` | -| `a >> b` | `Num.shr a b` | -| `a << b` | `Num.shl a b` | | `-a` | `Num.neg a` | | `-f x y` | `Num.neg (f x y)` | | `a == b` | `Bool.isEq a b` | From de93c961252cdaf1f9df3c70c261d869387227ff Mon Sep 17 00:00:00 2001 From: Anton-4 <17049058+Anton-4@users.noreply.github.com> Date: Sat, 17 Jun 2023 17:10:29 +0200 Subject: [PATCH 2/2] fix desugaring table Signed-off-by: Anton-4 <17049058+Anton-4@users.noreply.github.com> --- www/generate_tutorial/src/input/tutorial.md | 2 -- 1 file changed, 2 deletions(-) diff --git a/www/generate_tutorial/src/input/tutorial.md b/www/generate_tutorial/src/input/tutorial.md index ab980b27d9..90e43fad06 100644 --- a/www/generate_tutorial/src/input/tutorial.md +++ b/www/generate_tutorial/src/input/tutorial.md @@ -1969,13 +1969,11 @@ Here are various Roc expressions involving operators, and what they desugar to. | `a ^ b` | `Num.pow a b` | | `a % b` | `Num.rem a b` | | `-a` | `Num.neg a` | -| `-f x y` | `Num.neg (f x y)` | | `a == b` | `Bool.isEq a b` | | `a != b` | `Bool.isNotEq a b` | | `a && b` | `Bool.and a b` | | a \|\| b | `Bool.or a b` | | `!a` | `Bool.not a` | -| `!f x y` | `Bool.not (f x y)` | | a \|> b | `b a` | | a b c \|> f x y | `f (a b c) x y` |