gleam-lang / language-tour

👩🏽‍💻 Learn Gleam in your browser
https://tour.gleam.run/
82 stars 62 forks source link

Improve Language Tour to communicate that `if` guard clause can't take functions #1

Closed erikareads closed 9 months ago

erikareads commented 9 months ago

The current language tour doesn't communicate that you can't use functions in a guard clause: https://gleam.run/book/tour/case-expressions.html#checking-equality-and-ordering-in-pattern

I think there's an implicit "only" here, that should be made explicit:

The guard expression can check for equality or ordering for Int and Float.

erikareads commented 9 months ago

The Try Gleam tour also doesn't yet talk about guard clauses in Flow Control, when you add that section it would be worth mentioning that functions can't be used.

lpil commented 9 months ago

Thank you