Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Update tutorial _ #7113

Merged
merged 1 commit into from
Sep 22, 2024
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
16 changes: 0 additions & 16 deletions www/content/tutorial.md
Original file line number Diff line number Diff line change
Expand Up @@ -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:
Expand Down