mirror of
https://github.com/roc-lang/roc.git
synced 2025-08-04 12:18:19 +00:00
Merge pull request #7063 from ageron/update-tutorial-on-dbg
Add a short paragraph to explain dbg forwarding, fixes #7061
This commit is contained in:
commit
3d9c4673af
1 changed files with 6 additions and 0 deletions
|
@ -440,6 +440,12 @@ You can give `dbg` any expression you like, for example:
|
|||
dbg Str.concat singular plural
|
||||
```
|
||||
|
||||
You can also use `dbg` as a function inside an expression, which will print the function argument to stderr and then return the argument to the caller. For example:
|
||||
|
||||
```roc
|
||||
inc = \n -> 1 + dbg n
|
||||
```
|
||||
|
||||
### [Tuples](#tuples) {#tuples}
|
||||
|
||||
One way to have `dbg` print multiple values at a time is to wrap them in a record:
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue