Language Tour¶
This tour is a living outline. It gives the website a useful structure now, while leaving room for the actual Catalyst syntax and semantics to become more precise.
Values¶
let answer = 42
let language = "Catalyst"
let ready = true
Functions¶
fn double(value: Int) -> Int {
return value * 2
}
Branching¶
fn label(score: Int) -> String {
if score >= 90 {
return "excellent"
}
return "steady"
}
Data¶
type User {
name: String
reputation: Int
}
Errors¶
Catalyst should make failure visible at the point where it matters. Document the final error model here once it is stable.
Tests¶
test "double multiplies by two" {
assert double(21) == 42
}
Packages¶
Package and module documentation belongs here once the package manager or module layout is finalized.