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 debugging section in tutorial #7061

Closed Anton-4 closed 2 months ago

Anton-4 commented 2 months ago

dbg has a new capability, it can now "forward" its argument:

inc = \n -> dbg n + 1

We should tell people about this capability in the tutorial section on debugging.

More examples:

main = Stdout.line! "Hello $(dbg "world")!"
main =
    dbg (dbg 1 + 1)
1
|> dbg
|> Num.add 2
|> dbg