Skip to content

Control Flow & Match

Zyra provides if / else conditionals and match pattern expressions.


Conditionals

if (x > 10) {
  print("Greater than 10")
} else {
  print("10 or less")
}

Pattern Matching (match)

const label = match (status) {
  Active(user) => "Online: {user}"
  Pending => "Pending"
  _ => "Unknown"
}