From 568343f2e7d9850bd987afae9cd268e681172c2d Mon Sep 17 00:00:00 2001 From: Anton-4 <17049058+Anton-4@users.noreply.github.com> Date: Sun, 22 Sep 2024 16:43:37 +0200 Subject: [PATCH] Update tutorial _ Support for e.g. `RunErr : _` got removed 4 months ago. [More context](https://roc.zulipchat.com/#narrow/stream/231634-beginners/topic/.E2.9C.94.20Type.20alias.20definitions.20may.20not.20use.20inferred.20types/near/472047806). Signed-off-by: Anton-4 <17049058+Anton-4@users.noreply.github.com> --- www/content/tutorial.md | 16 ---------------- 1 file changed, 16 deletions(-) diff --git a/www/content/tutorial.md b/www/content/tutorial.md index 9532fc1b65..2524d006a3 100644 --- a/www/content/tutorial.md +++ b/www/content/tutorial.md @@ -1807,22 +1807,6 @@ This is a useful technique to use when we don't want to write out a bunch of err - If we're using an editor that supports it, hovering over the `_` might display the inferred type that goes there. - We can put an obviously wrong type in there (e.g. replace the `{}` with `Str`, which is totally wrong) and look at the compiler error to see what it inferred as the correct type. -We can also use `_` in type aliases, to express that two types are the same without annotating either of them. For example: - -```roc -RunErr : _ -``` - -```roc -run : Task {} RunErr -``` - -```roc -handleErr : RunErr -> [Exit I32 Str] -``` - -Of course, we could also choose not to use `_` at all and populate the `RunErr` type alias with the full list of errors that could happen in our `run` task. All of these are totally reasonable stylistic choices, depending on how you prefer the code to look. They all compile to exactly the same thing, and have the same runtime characteristics. - ### [The ! suffix](#the-!-suffix) {#the-!-suffix} The `!` suffix operator is syntax sugar for the `Task.await` function, which has this type: