If expressions
One way to express conditional logic in Gren is with an if expression:
If expressions have the form:
The <condition>
must be an expression that evaluates to a boolean value.
An else
branch is required,
and the two branches must evaluate to the same type.
This is because ifs in Gren are expressions that produce a value:
You can chain multiple if expressions together for more complex logic: