roc-lang / roc

A fast, friendly, functional language.
https://roc-lang.org
Universal Permissive License v1.0
4.46k stars 313 forks source link

Update the tutorial to add the ? operator #7064

Closed ageron closed 2 months ago

ageron commented 2 months ago

This PR adds a section on the ? try operator.

As the Result.try + ? section was getting a bit long, I added an explicit "Error handling" section. I think it's an important topic so it's worth making it stand out a bit more.

Also, when the ! operator is introduced, I think it's useful to say it's similar to the ? operator, but for Task instead of Result.